refactor(Cypress): add nodemodules

This commit is contained in:
2021-09-02 17:18:41 +02:00
parent 1aa57bbd0a
commit bc6e1bc12e
4238 changed files with 340975 additions and 8 deletions

32
node_modules/module-deps/test/detect.js generated vendored Normal file
View File

@@ -0,0 +1,32 @@
var parser = require('../');
var test = require('tap').test;
var JSONStream = require('JSONStream');
var packer = require('browser-pack');
var path = require('path');
test('detect', function (t) {
t.plan(1);
var p = parser({
detect: function (source) {
var rx = /require\(["'](.*?)["']\)/g;
var m, deps = [];
while (m = rx.exec(source)) {
deps.push(m[1]);
}
return deps;
}
});
p.end(path.join(__dirname, '/files/main.js'));
p.on('error', t.fail.bind(t));
var pack = packer();
p.pipe(JSONStream.stringify()).pipe(pack);
var src = '';
pack.on('data', function (buf) { src += buf });
pack.on('end', function () {
Function('console', src)({
log: function (s) { t.equal(s, 'main: 1055') }
});
});
});