Permalink
Browse files

Get tests to work in node 0.4.x

require() does not work for JSON files in 0.4.
  • Loading branch information...
1 parent 2257c46 commit d941665feade66ef3e7bbdd17427a11bae66eb0c @felixge committed Dec 20, 2011
Showing with 14 additions and 13 deletions.
  1. +14 −13 test/test.js
View
@@ -1,7 +1,6 @@
var assert = require('assert');
var requireAll = require('..');
-
var controllers = requireAll({
dirname: __dirname + '/controllers',
filter: /(.+Controller)\.js$/
@@ -22,16 +21,18 @@ assert.deepEqual(controllers, {
});
-var mydir = requireAll({
- dirname: __dirname + '/mydir',
- filter: /(.+)\.(js|json)$/
-});
+if (process.version > 'v0.6.0') {
+ var mydir = requireAll({
+ dirname: __dirname + '/mydir',
+ filter: /(.+)\.(js|json)$/
+ });
-assert.deepEqual(mydir, {
- foo: 'bar',
- hello: { world: true, universe: 42 },
- sub: {
- config: { settingA: 'A', settingB: 'B' },
- yes: true
- }
-});
+ assert.deepEqual(mydir, {
+ foo: 'bar',
+ hello: { world: true, universe: 42 },
+ sub: {
+ config: { settingA: 'A', settingB: 'B' },
+ yes: true
+ }
+ });
+}

0 comments on commit d941665

Please sign in to comment.