Use node-runas for testing native modules.
This commit is contained in:
Родитель
e07e26ca76
Коммит
1d88b31edd
|
@ -8,10 +8,7 @@
|
|||
"mocha": "~1.13.0",
|
||||
"walkdir": "~0.0.7",
|
||||
"runas": "0.3.0",
|
||||
|
||||
"formidable": "~1.0.14",
|
||||
"unzip": "~0.1.9",
|
||||
"time": "0.10.0"
|
||||
"formidable": "~1.0.14"
|
||||
},
|
||||
|
||||
"private": true,
|
||||
|
|
|
@ -2,5 +2,5 @@ process.on('uncaughtException', function(err) {
|
|||
process.send(err.message);
|
||||
});
|
||||
|
||||
require('time');
|
||||
require('runas');
|
||||
process.send('ok');
|
|
@ -13,16 +13,13 @@ describe 'third-party module', ->
|
|||
.pipe(unzip.Parse())
|
||||
.on('close', done)
|
||||
|
||||
describe 'time', ->
|
||||
describe 'runas', ->
|
||||
it 'can be required in renderer', ->
|
||||
time = require 'time'
|
||||
now = new time.Date()
|
||||
now.setTimezone 'America/Los_Angeles'
|
||||
assert.equal now.getTimezone(), 'America/Los_Angeles'
|
||||
require 'runas'
|
||||
|
||||
it 'can be required in node binary', (done) ->
|
||||
time = path.join fixtures, 'module', 'time.js'
|
||||
child = require('child_process').fork time
|
||||
runas = path.join fixtures, 'module', 'runas.js'
|
||||
child = require('child_process').fork runas
|
||||
child.on 'message', (msg) ->
|
||||
assert.equal msg, 'ok'
|
||||
done()
|
||||
|
|
Загрузка…
Ссылка в новой задаче