]> khamidou — GitHub mirrors - electron.git/commitdiff
Fix third party module specs.
authorCheng Zhao <zcbenz@gmail.com>
Mon, 16 Dec 2013 14:46:16 +0000 (22:46 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Mon, 16 Dec 2013 14:46:16 +0000 (22:46 +0800)
package.json
spec/fixtures/module/time.js [moved from spec/fixtures/module/int64_native.js with 80% similarity]
spec/modules-spec.coffee

index 7984b41a79798e55c378c9be5b061e6fdbbd9df0..51bd424ec0841c2c358e369ffe3f874e32d14055 100644 (file)
@@ -7,12 +7,11 @@
     "coffeelint": "~0.6.1",
     "mocha": "~1.13.0",
     "walkdir": "~0.0.7",
-    "runas": "~0.2.0",
+    "runas": "0.3.0",
 
     "formidable": "~1.0.14",
     "unzip": "~0.1.9",
-    "d3": "~3.3.8",
-    "int64-native": "~0.2.0"
+    "time": "0.10.0"
   },
 
   "private": true,
similarity index 80%
rename from spec/fixtures/module/int64_native.js
rename to spec/fixtures/module/time.js
index bcc08d2aa739d852f1d31d398cca2b40ca339a3a..c822aaeb9b04d3d8a455780ecd50957b20412607 100644 (file)
@@ -2,5 +2,5 @@ process.on('uncaughtException', function(err) {
   process.send(err.message);
 });
 
-require('int64-native');
+require('time');
 process.send('ok');
index b83f8d0530a1755d596f6f2cf9fe167bc492ad3a..dadbde05ffe3b74789ddf96c452a02abf34e074e 100644 (file)
@@ -5,11 +5,6 @@ path   = require 'path'
 describe 'third-party module', ->
   fixtures = path.join __dirname, 'fixtures'
 
-  describe 'd3', ->
-    it 'can be required', (done) ->
-      require 'd3'
-      done()
-
   xdescribe 'unzip', ->
     unzip = require 'unzip'
 
@@ -18,21 +13,16 @@ describe 'third-party module', ->
         .pipe(unzip.Parse())
         .on('close', done)
 
-  describe 'int64-native', ->
+  describe 'time', ->
     it 'can be required in renderer', ->
-      Int64 = require 'int64-native'
-      x = new Int64()
-      y = new Int64(42)
-      z = new Int64(0xfedcba98, 0x76543210)
-      w = new Int64('fedcba9876543210')
-      assert.equal x.toString(), '0000000000000000'
-      assert.equal y.toString(), '000000000000002a'
-      assert.equal z.toString(), 'fedcba9876543210'
-      assert.equal w.toString(), 'fedcba9876543210'
+      time = require 'time'
+      now = new time.Date()
+      now.setTimezone 'America/Los_Angeles'
+      assert.equal now.getTimezone(), 'America/Los_Angeles'
 
     it 'can be required in node binary', (done) ->
-      int64_native = path.join fixtures, 'module', 'int64_native.js'
-      child = require('child_process').fork int64_native
+      time = path.join fixtures, 'module', 'time.js'
+      child = require('child_process').fork time
       child.on 'message', (msg) ->
         assert.equal msg, 'ok'
         done()