415gotit
This commit is contained in:
77
node_modules/msgpack-lite/test/63.module-deps.js
generated
vendored
Executable file
77
node_modules/msgpack-lite/test/63.module-deps.js
generated
vendored
Executable file
@@ -0,0 +1,77 @@
|
||||
#!/usr/bin/env mocha -R spec
|
||||
|
||||
var TITLE = __filename.replace(/^.*\//, "");
|
||||
|
||||
describe(TITLE, function() {
|
||||
var mdeps;
|
||||
var itSkip = it;
|
||||
|
||||
try {
|
||||
mdeps = require("browserify/node_modules/module-deps");
|
||||
} catch (e) {
|
||||
itSkip = it.skip;
|
||||
}
|
||||
|
||||
// index.js should not require stream modules
|
||||
|
||||
itSkip("index.js dependencies", function(next) {
|
||||
var opt = {file: __dirname + "/../index.js"};
|
||||
var list = [];
|
||||
mdeps().on("data", onData).on("end", onEnd).end(opt);
|
||||
|
||||
function onData(data) {
|
||||
list.push(data.file);
|
||||
}
|
||||
|
||||
function onEnd() {
|
||||
var hit = list.filter(check)[0];
|
||||
next(hit && new Error(hit));
|
||||
}
|
||||
|
||||
function check(value) {
|
||||
return value.match(/stream/) && !value.match(/node_modules/);
|
||||
}
|
||||
});
|
||||
|
||||
// decode.js should not require encode|write modules
|
||||
|
||||
itSkip("decode.js dependencies", function(next) {
|
||||
var opt = {file: __dirname + "/../lib/decode.js"};
|
||||
var list = [];
|
||||
mdeps().on("data", onData).on("end", onEnd).end(opt);
|
||||
|
||||
function onData(data) {
|
||||
list.push(data.file);
|
||||
}
|
||||
|
||||
function onEnd() {
|
||||
var hit = list.filter(check)[0];
|
||||
next(hit && new Error(hit));
|
||||
}
|
||||
|
||||
function check(value) {
|
||||
return value.match(/encode|write/) && !value.match(/node_modules/);
|
||||
}
|
||||
});
|
||||
|
||||
// encode.js should not require decode|read modules
|
||||
|
||||
itSkip("encode.js dependencies", function(next) {
|
||||
var opt = {file: __dirname + "/../lib/encode.js"};
|
||||
var list = [];
|
||||
mdeps().on("data", onData).on("end", onEnd).end(opt);
|
||||
|
||||
function onData(data) {
|
||||
list.push(data.file);
|
||||
}
|
||||
|
||||
function onEnd() {
|
||||
var hit = list.filter(check)[0];
|
||||
next(hit && new Error(hit));
|
||||
}
|
||||
|
||||
function check(value) {
|
||||
return value.match(/decode|read/) && !value.match(/node_modules/);
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user