Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Get tests to work in node 0.4.x

require() does not work for JSON files in 0.4.
  • Loading branch information...
commit d941665feade66ef3e7bbdd17427a11bae66eb0c 1 parent 2257c46
Felix Geisendörfer authored

Showing 1 changed file with 14 additions and 13 deletions. Show diff stats Hide diff stats

  1. 27  test/test.js
27  test/test.js
... ...
@@ -1,7 +1,6 @@
1 1
 var assert = require('assert');
2 2
 var requireAll = require('..');
3 3
 
4  
-
5 4
 var controllers = requireAll({
6 5
   dirname: __dirname + '/controllers',
7 6
   filter: /(.+Controller)\.js$/
@@ -22,16 +21,18 @@ assert.deepEqual(controllers, {
22 21
 });
23 22
 
24 23
 
25  
-var mydir = requireAll({
26  
-  dirname: __dirname + '/mydir',
27  
-  filter: /(.+)\.(js|json)$/
28  
-});
  24
+if (process.version > 'v0.6.0') {
  25
+  var mydir = requireAll({
  26
+    dirname: __dirname + '/mydir',
  27
+    filter: /(.+)\.(js|json)$/
  28
+  });
29 29
 
30  
-assert.deepEqual(mydir, {
31  
-  foo: 'bar',
32  
-  hello: { world: true, universe: 42 },
33  
-  sub: {
34  
-    config: { settingA: 'A', settingB: 'B' },
35  
-    yes: true
36  
-  }
37  
-});
  30
+  assert.deepEqual(mydir, {
  31
+    foo: 'bar',
  32
+    hello: { world: true, universe: 42 },
  33
+    sub: {
  34
+      config: { settingA: 'A', settingB: 'B' },
  35
+      yes: true
  36
+    }
  37
+  });
  38
+}

0 notes on commit d941665

Please sign in to comment.
Something went wrong with that request. Please try again.