1 | var parser = require('../');
|
2 | var test = require('tap').test;
|
3 | var through = require('through2');
|
4 | var path = require('path');
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | test('row is exposed', function (t) {
|
10 | t.plan(1);
|
11 | var common_path = path.join(__dirname, '/files/main');
|
12 | var opts = { expose: {} };
|
13 | var p = parser(opts);
|
14 |
|
15 | p.end({ file: common_path, expose: "whatever" });
|
16 | p.on('error', t.fail.bind(t));
|
17 |
|
18 | p.pipe(through.obj());
|
19 |
|
20 | p.on('end', function () {
|
21 |
|
22 | t.equal(opts.expose.whatever, common_path + '.js');
|
23 | });
|
24 | });
|