Show More
Commit Description:
force log out when password change
Commit Description:
force log out when password change
References:
File last commit:
Show/Diff file:
Action:
node_modules/brfs/test/cmd.js
| 25 lines
| 616 B
| application/javascript
| JavascriptLexer
|
r789 | var test = require('tap').test; | ||
var exec = require('child_process').exec; | |||
var vm = require('vm'); | |||
var fs = require('fs'); | |||
var html = fs.readFileSync(__dirname + '/files/robot.html', 'utf8'); | |||
test('cmd.js', function (t) { | |||
t.plan(1); | |||
exec(__dirname + '/../bin/cmd.js ' + __dirname + '/files/main.js', | |||
function (error, stdout, stderr) { | |||
if (error !== null) { | |||
t.fail(); | |||
} else { | |||
vm.runInNewContext(stdout, { | |||
require: function () {}, | |||
console: { log: log } | |||
}); | |||
function log (msg) { | |||
t.equal(html, msg); | |||
}; | |||
}; | |||
} | |||
); | |||
}); |