Skip to content

Instantly share code, notes, and snippets.

@zhuochun
Forked from drewwells/core.test.js
Created July 12, 2012 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zhuochun/3098383 to your computer and use it in GitHub Desktop.
Save zhuochun/3098383 to your computer and use it in GitHub Desktop.
RequireJS and QUnit sitting in a tree
//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");
});
});
//Main file for loading RequireJS necessary bits
QUnit.config.autostart = false;
require(['core.test.js'], function(){
QUnit.start(); //Tests loaded, run tests
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment