-
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create centralized globals.json for test globals
Removes the need to update two objects. It's too easy to update one and for get the other. It wasn't consistent as it was. And it's in the test/setup directory which seems pretty self explanatory.
- Loading branch information
1 parent
2fab067
commit ceb2941
Showing
5 changed files
with
17 additions
and
19 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
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"globals": { | ||
"expect": true, | ||
"mock": true, | ||
"sandbox": true, | ||
"spy": true, | ||
"stub": true, | ||
"useFakeServer": true, | ||
"useFakeTimers": true, | ||
"useFakeXMLHttpRequest": true | ||
} | ||
} |
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,9 +1,9 @@ | ||
var config = require('../../package.json').babelBoilerplateOptions; | ||
+var mochaGlobals = require('./.globals.json').globals; | ||
|
||
window.mocha.setup('bdd'); | ||
window.onload = function() { | ||
window.mocha.checkLeaks(); | ||
window.mocha.globals(config.mochaGlobals); | ||
window.mocha.globals(Object.keys(mochaGlobals)); | ||
window.mocha.run(); | ||
require('./setup')(window); | ||
}; |