flow like the river
This commit is contained in:
commit
013fe673f3
42435 changed files with 5764238 additions and 0 deletions
23
BACK_BACK/node_modules/static-module/test/limit-parsing.js
generated
vendored
Executable file
23
BACK_BACK/node_modules/static-module/test/limit-parsing.js
generated
vendored
Executable file
|
|
@ -0,0 +1,23 @@
|
|||
var concat = require('concat-stream');
|
||||
var from = require('from2-string');
|
||||
var staticModule = require('../');
|
||||
var test = require('tape');
|
||||
|
||||
test('limit parsing to files including a target module', function (t) {
|
||||
var passInput = 'THIS WILL NOT PARSE';
|
||||
var failInput = passInput + '; require("fs")';
|
||||
|
||||
t.plan(2);
|
||||
|
||||
from(passInput)
|
||||
.pipe(staticModule({ fs: require('fs') }))
|
||||
.pipe(concat(function (passOutput) {
|
||||
t.equal(passInput, String(passOutput), 'does not parse');
|
||||
}));
|
||||
|
||||
from(failInput)
|
||||
.pipe(staticModule({ fs: require('fs') }))
|
||||
.once('error', function () {
|
||||
t.pass('parses if module is included');
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue