Skip to content

Commit

Permalink
enable QUnit.config.noglobals in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
akre54 committed Nov 12, 2015
1 parent b30e40e commit e2e1d65
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions karma.conf-sauce.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ module.exports = function(config) {
// list of files / patterns to load in the browser
files: [
'test/vendor/qunit-extras.js',
'test/qunit-setup.js',
'underscore.js',
'test/*.js'
],
Expand Down
1 change: 1 addition & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module.exports = function(config) {
// list of files / patterns to load in the browser
files: [
'test/vendor/qunit-extras.js',
'test/qunit-setup.js',
'underscore.js',
'test/*.js'
],
Expand Down
2 changes: 1 addition & 1 deletion test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<script src="vendor/qunit.js"></script>
<script src="vendor/qunit-extras.js"></script>
<script src="../underscore.js"></script>

<script src="qunit-setup.js"></script>
<script src="collections.js"></script>
<script src="arrays.js"></script>
<script src="functions.js"></script>
Expand Down
3 changes: 3 additions & 0 deletions test/qunit-setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(function() {
QUnit.config.noglobals = true;
}());
2 changes: 2 additions & 0 deletions test/utility.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
if (typeof require != 'function') {
assert.equal(this._, void 0, 'global underscore is removed');
this._ = underscore;
} else if (typeof global !== 'undefined') {
delete global._;
}
});
}
Expand Down

0 comments on commit e2e1d65

Please sign in to comment.