[Pkg-javascript-commits] [node-detective] 02/119: a passing expression test
Bastien Roucariès
rouca at moszumanska.debian.org
Wed Sep 6 09:44:29 UTC 2017
This is an automated email from the git hooks/post-receive script.
rouca pushed a commit to branch master
in repository node-detective.
commit db98822f821161b67e84c08540a516e639ef4f5b
Author: James Halliday <mail at substack.net>
Date: Fri Jun 17 17:58:49 2011 -0700
a passing expression test
---
test/both.js | 10 ++++++++++
test/{strings/src.js => files/both.js} | 2 +-
test/{strings/src.js => files/strings.js} | 0
test/strings.js | 2 +-
4 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/test/both.js b/test/both.js
new file mode 100644
index 0000000..8e97f84
--- /dev/null
+++ b/test/both.js
@@ -0,0 +1,10 @@
+var assert = require('assert');
+var detective = require('../');
+var fs = require('fs');
+var src = fs.readFileSync(__dirname + '/files/both.js');
+
+exports.both = function () {
+ var modules = detective.find(src);
+ assert.deepEqual(modules.strings, [ 'a', 'b' ]);
+ assert.deepEqual(modules.expressions, [ '"c"+x' ]);
+};
diff --git a/test/strings/src.js b/test/files/both.js
similarity index 63%
copy from test/strings/src.js
copy to test/files/both.js
index 62e5cf6..5f6c1b3 100644
--- a/test/strings/src.js
+++ b/test/files/both.js
@@ -1,3 +1,3 @@
require('a');
require('b');
-require('c');
+require('c'+x);
diff --git a/test/strings/src.js b/test/files/strings.js
similarity index 100%
rename from test/strings/src.js
rename to test/files/strings.js
diff --git a/test/strings.js b/test/strings.js
index 2837e87..8dcddc8 100644
--- a/test/strings.js
+++ b/test/strings.js
@@ -1,7 +1,7 @@
var assert = require('assert');
var detective = require('../');
var fs = require('fs');
-var src = fs.readFileSync(__dirname + '/strings/src.js');
+var src = fs.readFileSync(__dirname + '/files/strings.js');
exports.single = function () {
assert.deepEqual(detective(src), [ 'a', 'b', 'c' ]);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-detective.git
More information about the Pkg-javascript-commits
mailing list