flow like the river
This commit is contained in:
commit
013fe673f3
42435 changed files with 5764238 additions and 0 deletions
26
BACK_BACK/node_modules/brfs/test/cmd.js
generated
vendored
Executable file
26
BACK_BACK/node_modules/brfs/test/cmd.js
generated
vendored
Executable file
|
|
@ -0,0 +1,26 @@
|
|||
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);
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue