[Pkg-javascript-commits] [node-lexical-scope] 27/83: using brfs for test files

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


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

rouca pushed a commit to branch master
in repository node-lexical-scope.

commit 42b3584e7bedc28d3b9a956982edfb50a8fb63b9
Author: James Halliday <mail at substack.net>
Date:   Fri Mar 29 23:30:43 2013 -0700

    using brfs for test files
---
 package.json               | 3 ++-
 test/argument.js           | 3 ++-
 test/detect.js             | 3 ++-
 test/package.json          | 3 +++
 test/right_hand.js         | 3 ++-
 test/shebang.js            | 5 ++++-
 test/sources/detect.js     | 1 -
 test/sources/right_hand.js | 1 -
 8 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/package.json b/package.json
index 37d84af..d95ff6d 100644
--- a/package.json
+++ b/package.json
@@ -8,7 +8,8 @@
     },
     "devDependencies": {
         "tap": "~0.4.0",
-        "tape": "~0.2.2"
+        "tape": "~0.2.2",
+        "brfs": "~2.10.2"
     },
     "scripts": {
         "test": "tap test/*.js"
diff --git a/test/argument.js b/test/argument.js
index 1576f40..3ba102d 100644
--- a/test/argument.js
+++ b/test/argument.js
@@ -1,6 +1,7 @@
 var test = require('tape');
 var detect = require('../');
-var src = require('./sources/argument.js');
+var fs = require('fs');
+var src = fs.readFileSync(__dirname + '/files/argument.js');
 
 test('parameters from inline arguments', function (t) {
     t.plan(3);
diff --git a/test/detect.js b/test/detect.js
index 9c2b2ce..0230ad6 100644
--- a/test/detect.js
+++ b/test/detect.js
@@ -1,6 +1,7 @@
 var test = require('tape');
 var detect = require('../');
-var src = require('./sources/detect.js');
+var fs = require('fs');
+var src = fs.readFileSync(__dirname + '/files/detect.js');
 
 test('check locals and globals', function (t) {
     t.plan(3);
diff --git a/test/package.json b/test/package.json
new file mode 100644
index 0000000..21c4e9c
--- /dev/null
+++ b/test/package.json
@@ -0,0 +1,3 @@
+{
+  "browserify": { "transform": "brfs" }
+}
diff --git a/test/right_hand.js b/test/right_hand.js
index 3df78b9..28b283d 100644
--- a/test/right_hand.js
+++ b/test/right_hand.js
@@ -1,6 +1,7 @@
 var test = require('tape');
 var detect = require('../');
-var src = require('./sources/right_hand.js');
+var fs = require('fs');
+var src = fs.readFileSync(__dirname + '/files/right_hand.js');
 
 test('globals on the right-hand of assignment', function (t) {
     t.plan(3);
diff --git a/test/shebang.js b/test/shebang.js
index db3b1b5..5445580 100644
--- a/test/shebang.js
+++ b/test/shebang.js
@@ -1,6 +1,9 @@
 var test = require('tape');
 var detect = require('../');
-var src = '#!/beep/boop blah\n' + require('./sources/detect.js');
+var fs = require('fs');
+var src = '#!/beep/boop blah\n'
+    + fs.readFileSync(__dirname + '/files/detect.js')
+;
 
 test('shebangs', function (t) {
     t.plan(3);
diff --git a/test/sources/detect.js b/test/sources/detect.js
deleted file mode 100644
index 8e56306..0000000
--- a/test/sources/detect.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = "var x = 5;\nvar y = 3, z = 2;\n\nw.foo();\nw = 2;\n\nRAWR=444;\nRAWR.foo();\n\nBLARG=3;\n\nfoo(function () {\n    var BAR = 3;\n    process.nextTick(function (ZZZZZZZZZZZZ) {\n        console.log('beep boop');\n        var xyz = 4;\n        x += 10;\n        x.zzzzzz;\n        ZZZ=6;\n    });\n    function doom () {\n        if (AAA.aaa) {}\n        BBB.bbb = 3;\n        var z = 2 + CCC.x * 5;\n    }\n    ZZZ.foo();\n\n});\n\nfunction beep () {}\n\nconsole.log(xyz);\n"
diff --git a/test/sources/right_hand.js b/test/sources/right_hand.js
deleted file mode 100644
index 11584d8..0000000
--- a/test/sources/right_hand.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = "exports.filename = __filename;\nexports.dirname = __dirname;\n"

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



More information about the Pkg-javascript-commits mailing list