Skip to content
Browse files

Add requirejs circular 414 test

  • Loading branch information...
1 parent 689b148 commit d4c88452bf2126f5b8c3718f88ff2f02d7c634c2 @jrburke committed
Showing with 131 additions and 0 deletions.
  1. +1 −0 tests/all.js
  2. +20 −0 tests/circular/414/414.html
  3. +110 −0 tests/circular/414/414.js
View
1 tests/all.js
@@ -15,6 +15,7 @@ doh.registerUrl("emptyFactory", "../emptyFactory/emptyFactory.html");
doh.registerUrl("missing", "../missing/missing.html");
doh.registerUrl("insertRequire", "../insertRequire/insertRequire.html", 4000);
doh.registerUrl("circular", "../circular/circular.html");
+doh.registerUrl("circular414", "../circular/414/414.html");
doh.registerUrl("relativePaths", "../relativePaths/relativePaths.html");
doh.registerUrl("errback", "../errback/errback.html");
doh.registerUrl("specialDeps", "../specialDeps/specialDeps.html");
View
20 tests/circular/414/414.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>almond: requirejs#414: Multi-cycle Bundle Test</title>
+ <script type="text/javascript" src="../../doh/runner.js"></script>
+ <script type="text/javascript" src="../../doh/_browserRunner.js"></script>
+ <script src="../../../almond.js"></script>
+ <script type="text/javascript" src="414.js"></script>
+</head>
+<body>
+ <h1>almond: requirejs#414: Multi-cycle Bundle Test</h1>
+
+ <p>A set of modules have multiple cycles in them, but the require() that
+ uses the top module in that bundle should get a fully constructed
+ module set.<a href="https://github.com/jrburke/requirejs/issues/414">More info</a>.</p>
+
+ <p>Check console for messages</p>
+
+</body>
+</html>
View
110 tests/circular/414/414.js
@@ -0,0 +1,110 @@
+
+define('C',
+ [
+ "exports",
+ "./MyClass",
+ "./A",
+ "./B"
+ ],
+
+ function (exports, MyClass, A, B) {
+
+ exports.name = "C";
+
+ exports.say = function(){
+ return [MyClass.name, A.name, B.name, exports.name].join(',');
+ };
+
+ }
+
+);
+
+
+define('B',
+ [
+ "exports",
+ "./MyClass",
+ "./A",
+ "./C"
+ ],
+
+ function (exports, MyClass, A, C) {
+
+ exports.name = "B";
+
+ exports.say = function(){
+ return [MyClass.name, A.name, exports.name, C.name].join(',');
+ };
+
+ }
+
+);
+define('A',
+ [
+ "exports",
+ "./MyClass",
+ "./B",
+ "./C"
+ ],
+
+ function (exports, MyClass, B, C) {
+
+ exports.name = "A";
+
+ exports.say = function(){
+ return [MyClass.name, exports.name, B.name, C.name].join(',');
+ };
+
+ }
+
+);
+
+define('MyClass',
+ [
+ "exports",
+ "./A",
+ "./B",
+ "./C"
+ ],
+
+ function (exports, A, B, C) {
+
+ exports.name = "MyClass";
+
+ exports.sayAll = function(){
+ return [
+ exports.say(),
+ A.say(),
+ B.say(),
+ C.say()
+ ].join(':');
+ };
+
+ exports.say = function(){
+ return [exports.name, A.name, B.name, C.name].join(',');
+ };
+
+ return exports;
+
+ }
+
+);
+
+require({
+ baseUrl: requirejs.isBrowser ? './' : './circular/414'
+ },
+ ["MyClass"],
+ function(MyClass) {
+ doh.register(
+ "circular414",
+ [
+ function circularComplexPlugin(t) {
+ t.is("MyClass,A,B,C:MyClass,A,B,C:MyClass,A,B,C:MyClass,A,B,C", MyClass.sayAll());
+ }
+ ]
+ );
+ doh.run();
+ }
+);
+
+define("414-tests", function(){});

0 comments on commit d4c8845

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