Created
November 13, 2013 01:14
-
-
Save shaohua/7441902 to your computer and use it in GitHub Desktop.
TestRunner.js
This file contains hidden or 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
| 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