Skip to content

Instantly share code, notes, and snippets.

@shaohua
Created November 13, 2013 01:14
Show Gist options
  • Select an option

  • Save shaohua/7441902 to your computer and use it in GitHub Desktop.

Select an option

Save shaohua/7441902 to your computer and use it in GitHub Desktop.
TestRunner.js
define([], function() {
/*
There may be times when you do want to reference a script directly and not conform to the "baseUrl + paths" rules for finding it. If a module ID has one of the following characterstics, the ID will not be passed through the "baseUrl + paths" configuration, and just be treated like a regular URL that is relative to the document:
Ends in ".js".
Starts with a "/".
Contains an URL protocol, like "http:" or "https:".
*/
/* app specs here */
var specs = [
'test/basic_functions_spec',
'test/html2markdown_spec',
'test/markdown2html_spec',
'test/sanitizeHTML_spec',
'test/medium_editor_spec',
'test/toolbar_buttons_spec'
];
//this is from git submodule
var sharedLibUrl = 'test/shared-libs';
require.config({
deps: ['test/shared-libs/config'],
paths: {
'shared-libs': sharedLibUrl,
'text': 'test/lib/text'
//this needs to be downloaded mannually from https://raw.github.com/requirejs/text/latest/text.js
},
callback: function(registerCdn) {
registerCdn(sharedLibUrl);
require(specs, function() {
if (window.mochaPhantomJS) {
mochaPhantomJS.run();
} else {
mocha.run();
}
});
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment