Permalink
Browse files

Green light everywhere! All the tests are OK

  • Loading branch information...
1 parent d9258bf commit ea9ac646f58c3540cab61d0d34f9a76a8d4721de @xcambar committed Apr 15, 2012
@@ -1,6 +1,6 @@
/**
module child {
- module common at '/test/fixtures/recursive/useCase2/common.js';
+ module common at 'fixtures/recursive/useCase2/common.js';
export common, whatever;
}
**/
@@ -1,7 +1,7 @@
/**
module parent {
- module common at '/test/fixtures/recursive/useCase2/common.js';
- module child at '/test/fixtures/recursive/useCase2/child.js';
+ module common at 'fixtures/recursive/useCase2/common.js';
+ module child at 'fixtures/recursive/useCase2/child.js';
export common, child;
}
**/
View
@@ -56,7 +56,7 @@ describe('Declare modules by their paths', function () {
describe('Importing module declared by a canonical URL', function () {
it ('should be able to import modules from a canonical URL', function () {
- var spy = this.loadModule('fixtures/importFromCanonicalURL.js');
+ var spy = this.loadModule('fixtures/importFromCanonicalURL.js', 2000);
runs(function () {
expect(s6d.get('fixtures/importFromCanonicalURL.js').export1).toBeTruthy();
expect(s6d.get('fixtures/importFromCanonicalURL.js').export1.var1).toBe('EXPORTED NAMED MODULE!!');
View
@@ -202,21 +202,20 @@ describe('Recursive module loading', function () {
});
it ('should load correctly shared dependencies between parent and child', function () {
- var spy = this.loadModule('/test/fixtures/recursive/useCase2/index.js');
+ var spy = this.loadModule('fixtures/recursive/useCase2/index.js');
runs(function () {
expect(spy).toHaveBeenCalled();
expect(spy.callCount).toEqual(1);
- expect(s6d.get('/test/fixtures/recursive/useCase2/index.js').common).toEqual({something: 'worth it'});
- expect(s6d.get('/test/fixtures/recursive/useCase2/index.js').child.whatever).toEqual('some value');
- expect(s6d.get('/test/fixtures/recursive/useCase2/index.js').child.common).toEqual(s6d.get('/test/fixtures/recursive/useCase2/common.js'));
- expect(s6d.get('/test/fixtures/recursive/useCase2/child.js').common).toEqual({something: 'worth it'});
- expect(s6d.get('/test/fixtures/recursive/useCase2/child.js').whatever).toBe('some value');
- expect(s6d.get('/test/fixtures/recursive/useCase2/common.js').something).toBe('worth it');
+ expect(s6d.get('fixtures/recursive/useCase2/index.js').common).toEqual({something: 'worth it'});
+ expect(s6d.get('fixtures/recursive/useCase2/index.js').child.whatever).toEqual('some value');
+ expect(s6d.get('fixtures/recursive/useCase2/index.js').child.common).toEqual(s6d.get('fixtures/recursive/useCase2/common.js'));
+ expect(s6d.get('fixtures/recursive/useCase2/child.js').common).toEqual({something: 'worth it'});
+ expect(s6d.get('fixtures/recursive/useCase2/child.js').whatever).toBe('some value');
+ expect(s6d.get('fixtures/recursive/useCase2/common.js').something).toBe('worth it');
});
});
xit ('allows cyclic dependencies', function () {
- throw 'Not implemented';
var spy = this.loadModule('fixtures/cyclic/a.js');
runs(function () {
expect(s6d.get('./fixtures/cycle/a.js')).toBeTruthy();
View
@@ -26,14 +26,14 @@ beforeEach(function () {
}
});
- this.loadModule = function (moduleName) {
+ this.loadModule = function (moduleName, timeout) {
var spy = jasmine.createSpy();
runs(function () {
s6d(moduleName, spy);
});
waitsFor(function () {
return !!s6d.get(moduleName);
- }, 'The module has been loaded', 200);
+ }, 'the module ' + moduleName + ' to be loaded', timeout || 200);
return spy;
};

0 comments on commit ea9ac64

Please sign in to comment.