2013-12-06 07:23:02 -07:00
|
|
|
assert = require 'assert'
|
|
|
|
fs = require 'fs'
|
|
|
|
path = require 'path'
|
2014-01-09 05:29:54 -07:00
|
|
|
temp = require 'temp'
|
2013-12-06 07:23:02 -07:00
|
|
|
|
2013-12-15 09:31:40 -07:00
|
|
|
describe 'third-party module', ->
|
2013-12-06 07:23:02 -07:00
|
|
|
fixtures = path.join __dirname, 'fixtures'
|
2014-01-09 05:29:54 -07:00
|
|
|
temp.track()
|
2013-12-06 07:23:02 -07:00
|
|
|
|
2013-12-16 21:00:21 -07:00
|
|
|
describe 'runas', ->
|
2013-12-06 07:23:02 -07:00
|
|
|
it 'can be required in renderer', ->
|
2013-12-16 21:00:21 -07:00
|
|
|
require 'runas'
|
2013-12-06 07:23:02 -07:00
|
|
|
|
|
|
|
it 'can be required in node binary', (done) ->
|
2013-12-16 21:00:21 -07:00
|
|
|
runas = path.join fixtures, 'module', 'runas.js'
|
|
|
|
child = require('child_process').fork runas
|
2013-12-06 07:23:02 -07:00
|
|
|
child.on 'message', (msg) ->
|
|
|
|
assert.equal msg, 'ok'
|
|
|
|
done()
|
2014-01-09 05:29:54 -07:00
|
|
|
|
2014-01-10 00:19:08 -07:00
|
|
|
describe 'q', ->
|
|
|
|
Q = require 'q'
|
|
|
|
|
|
|
|
describe 'Q.when', ->
|
|
|
|
it 'emits the fullfil callback', (done) ->
|
|
|
|
Q(true).then (val) ->
|
|
|
|
assert.equal val, true
|
|
|
|
done()
|