-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(adapter.requirejs): do not configure baseUrl automatically
I believe in most cases people need to use different baseUrl anyway. This means people need to understand that Testacular serves files under `/base/*` (which is the basePath from the testacular.conf.js) and under `/absolute/*` (files from outside of the project's basePath). But it's less magic and less confusing. See #291, #292 for more info. Closes #291
- Loading branch information
Showing
3 changed files
with
21 additions
and
14 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,26 @@ | ||
var allTestFiles = []; | ||
var TEST_REGEXP = /test/; | ||
|
||
Object.keys(window.__testacular__.files).forEach(function(file) { | ||
if (TEST_REGEXP.test(file)) { | ||
allTestFiles.push(file); | ||
} | ||
}); | ||
|
||
require.config({ | ||
// Testacular serves files under /base, which is the basePath from your config file | ||
baseUrl: '/base', | ||
|
||
// example of using shim, to load non AMD libraries (such as Backbone, jquery) | ||
shim: { | ||
'/base/shim.js': { | ||
exports: 'global' | ||
} | ||
} | ||
}); | ||
}, | ||
|
||
// dynamically load all test files | ||
deps: allTestFiles, | ||
|
||
// bootstrap - require, once loaded, kick off test run | ||
require(['test', '/base/shim.js'], function(test, shim) { | ||
window.__testacular__.start(); | ||
console.log('shim.js:', shim); | ||
// we have to kick of jasmine, as it is asynchronous | ||
callback: window.__testacular__.start | ||
}); |
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