Skip to content
Browse files

failing test for requiring json files

  • Loading branch information...
1 parent 757baa7 commit cfa0ffac95f2e72594fe2dfc91a2242ea00f2e47 @substack committed Aug 20, 2012
Showing with 19 additions and 0 deletions.
  1. +14 −0 test/json.js
  2. +4 −0 test/json/beep.json
  3. +1 −0 test/json/main.js
View
14 test/json.js
@@ -0,0 +1,14 @@
+var browserify = require('../');
+var vm = require('vm');
+var test = require('tap').test;
+
+test('json', function (t) {
+ t.plan(1);
+ var src = browserify(__dirname + '/json/main.js').bundle();
+ var c = {
+ export : function (obj) {
+ t.same(obj, { beep : 'boop', x : 555 });
+ }
+ };
+ vm.runInNewContext(src, c);
+});
View
4 test/json/beep.json
@@ -0,0 +1,4 @@
+{
+ "beep" : "boop",
+ "x" : 555
+}
View
1 test/json/main.js
@@ -0,0 +1 @@
+export(require('./beep.json'));

0 comments on commit cfa0ffa

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