Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added a failing test for multi level require within the same dir

  • Loading branch information...
commit 7f0450c4fe5c9b4aa66541bc8ee45092bd10ba23 1 parent f11415b
@rbgrouleff authored
View
8 test/bundle_test.coffee
@@ -29,6 +29,14 @@ module.exports = class BundleTest extends Janitor.TestCase
main = context.require './main'
@assertEqual 'Child 1', main.child1.name
+ 'test multi-leveled chained require': ->
+ root_dir = path.join __dirname, 'fixtures', 'simple-package-multi-level-require'
+ bundle = new Bundle root_dir
+ result_in_closure = -> eval bundle.toString()
+ result_in_closure.call context = {}
+ main = context.require './main'
+ @assertEqual 'Child 3', main.child1.child2.child3.name
+
'test caching': ->
root_dir = path.join __dirname, 'fixtures', 'simple-package'
bundle = new Bundle root_dir
View
2  test/fixtures/simple-package-multi-level-require/lib/child1.js
@@ -0,0 +1,2 @@
+exports.child2 = require('./child2.js');
+exports.name = 'Child 1';
View
2  test/fixtures/simple-package-multi-level-require/lib/child2.js
@@ -0,0 +1,2 @@
+exports.child3 = require('./child3');
+exports.name = "Child 2";
View
1  test/fixtures/simple-package-multi-level-require/lib/child3.js
@@ -0,0 +1 @@
+exports.name = "Child 3";
View
2  test/fixtures/simple-package-multi-level-require/main.js
@@ -0,0 +1,2 @@
+exports.name = 'Rasmus';
+exports.child1 = require('./lib/child1');
View
0  test/fixtures/simple-package-multi-level-require/text.txt
No changes.
Please sign in to comment.
Something went wrong with that request. Please try again.