This commit is contained in:
Cheng Zhao 2013-08-12 14:15:28 +08:00
parent f9750f9ea9
commit 3d9af77b37
3 changed files with 26 additions and 29 deletions

View file

@ -1,5 +1,4 @@
describe 'modules', ->
describe 'd3 module', ->
it 'can be required', (done) ->
require 'd3'
done()
describe 'd3 module', ->
it 'can be required', (done) ->
require 'd3'
done()

View file

@ -3,22 +3,21 @@ path = require 'path'
fixtures = path.resolve __dirname, '..', 'fixtures'
describe 'modules', ->
describe 'native module', ->
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'
describe 'native module', ->
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'
it 'can be required in node binary', (done) ->
int64_native = path.join fixtures, 'module', 'int64_native.js'
child = require('child_process').fork int64_native
child.on 'message', (msg) ->
assert.equal msg, 'ok'
done()
it 'can be required in node binary', (done) ->
int64_native = path.join fixtures, 'module', 'int64_native.js'
child = require('child_process').fork int64_native
child.on 'message', (msg) ->
assert.equal msg, 'ok'
done()

View file

@ -5,9 +5,8 @@ unzip = require 'unzip'
fixtures = path.resolve __dirname, '..', 'fixtures'
describe 'modules', ->
describe 'unzip module', ->
it 'fires close event', (done) ->
fs.createReadStream(path.join(fixtures, 'zip', 'a.zip'))
.pipe(unzip.Parse())
.on('close', done)
describe 'unzip module', ->
it 'fires close event', (done) ->
fs.createReadStream(path.join(fixtures, 'zip', 'a.zip'))
.pipe(unzip.Parse())
.on('close', done)