Skip to content

Commit

Permalink
added test demonstrating bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mmacaula committed Oct 7, 2013
1 parent 616a97b commit 2c669b6
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
15 changes: 11 additions & 4 deletions test/legacy.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
loader: 'curl/loader/legacy',
exports: 'testDomain.foo.bar'
}
}
},
definedUpTop : 'stuff/dep-on-test1-in-define',
usingRequire : 'stuff/dep-on-test1'
},
packages: [
{
Expand Down Expand Up @@ -44,15 +46,20 @@
[
'stuff/three',
'test2',
'test1'
'test1',
'definedUpTop',
'usingRequire'
]
).then(
function (three, saucer, foobar) {
function (three, saucer, foobar,definedUpTop, usingRequire) {
write('A module with dependencies loaded successfully if 3 == ' + three + '.');
write('If the following line says something then the plain js files loaded in the right order:');

//write(testDomain.foo.bar + ' ' + testDomain.awesome.sauce);
write('Did js file with no deps return a value? ' + (foobar == 'whizzah!' ? 'SUCCESS' : 'FAILED'));
write('Did js file with deps return a value? ' + (saucer.sauce == 'ketchup' ? 'SUCCESS' : 'FAILED'));

write('Did module with non-amd deps load dep correctly? ' + (definedUpTop == 'whizzah!' ? 'SUCCESS' : 'FAILED'));
write('Did module with non-amd deps load dep correctly? ' + (usingRequire == 'whizzah!' ? 'SUCCESS' : 'FAILED'));
}
);

Expand Down
6 changes: 6 additions & 0 deletions test/stuff/dep-on-test1-in-define.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/*
* depends on 'test1'
*/
define(['test1'], function (test1) {
return test1;
});
6 changes: 6 additions & 0 deletions test/stuff/dep-on-test1.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/*
* depends on 'test1'
*/
define(function (require) {
return require('test1');
});

0 comments on commit 2c669b6

Please sign in to comment.