Created
April 14, 2011 20:21
-
-
Save drewwells/920405 to your computer and use it in GitHub Desktop.
RequireJS and QUnit sitting in a tree
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Wait for relevant code bits to load before starting any tests | |
define(['core.js'], function( core ) { | |
module("Core Tests"); | |
test("Test core methods", function(){ | |
expect(2); | |
equals( 1, 1, "A trivial test"); | |
ok( true, "Another trivial test"); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Main file for loading RequireJS necessary bits | |
QUnit.config.autostart = false; | |
require(['core.test.js'], function(){ | |
QUnit.start(); //Tests loaded, run tests | |
}); |
Indeed, thanks!
Hm, not working for me. My config.js file...
config.js
https://gist.github.com/roycehaynes/26376f8aa213e6de654a
Thoughts?
Problem with "pushFailure() assertion outside test context". Solution: http://stackoverflow.com/a/15732622/257443
Thanks @drewwells and @ciastek. Very helpful.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Was looking for something along these lines. Thanks!