[Pkg-javascript-commits] [node-module-deps] 334/444: Test for proper module exposure.

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 15 09:48:10 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-module-deps.

commit e51936ab4856bd9b44ac7236f90c76dabd148988
Author: Jesse McCarthy <git_commits at jessemccarthy.net>
Date:   Thu Jan 15 15:56:48 2015 -0500

    Test for proper module exposure.
---
 test/row_expose.js | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/test/row_expose.js b/test/row_expose.js
new file mode 100644
index 0000000..a5311ca
--- /dev/null
+++ b/test/row_expose.js
@@ -0,0 +1,24 @@
+var parser = require('../');
+var test = require('tape');
+var stream = require('readable-stream');
+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(new stream.PassThrough({ objectMode: true }));
+
+    p.on('end', function () {
+        // Note pathname with extension.
+        t.equal(opts.expose.whatever, common_path + '.js');
+    });
+});

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-module-deps.git



More information about the Pkg-javascript-commits mailing list