This commit is contained in:
zino
2021-03-02 00:06:38 +01:00
parent 3a8aab0e9a
commit eeb745b013
3567 changed files with 1234741 additions and 0 deletions

24
client/node_modules/module-deps/test/row_expose.js generated vendored Normal file
View File

@@ -0,0 +1,24 @@
var parser = require('../');
var test = require('tap').test;
var through = require('through2');
var path = require('path');
// Test that p.options.expose is defined and that the row is properly exposed
// (resolved to the absolute pathname corresponding to the `file` value passed
// in the row, and set in opts.expose).
test('row is exposed', function (t) {
t.plan(1);
var common_path = path.join(__dirname, '/files/main');
var opts = { expose: {} };
var p = parser(opts);
// Note pathname without extension.
p.end({ file: common_path, expose: "whatever" });
p.on('error', t.fail.bind(t));
p.pipe(through.obj());
p.on('end', function () {
// Note pathname with extension.
t.equal(opts.expose.whatever, common_path + '.js');
});
});