forked from qunitjs/qunit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Core: Support a predefined QUnit.config
If a global QUnit.config object is present before QUnit is loaded, the default config values will be extended. The use case is to configure QUnit before it is loaded. Closes qunitjs#1059
- Loading branch information
1 parent
eb642e7
commit 42f2e9c
Showing
5 changed files
with
52 additions
and
2 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,21 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>QUnit Preconfigured Test Suite</title> | ||
<link rel="stylesheet" href="../dist/qunit.css"> | ||
<script> | ||
window.QUnit = { | ||
config: { | ||
autostart: false, | ||
reorder: false | ||
} | ||
}; | ||
</script> | ||
<script src="../dist/qunit.js"></script> | ||
<script src="preconfigured.js"></script> | ||
</head> | ||
<body> | ||
<div id="qunit"></div> | ||
</body> | ||
</html> |
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,21 @@ | ||
window.addEventListener( "load", function() { | ||
|
||
// make sure QUnit has started if autostart would be true | ||
setTimeout( function() { | ||
QUnit.module( "QUnit.preconfigured.asyncTests" ); | ||
QUnit.test( "QUnit.config should have an expected default", function( assert ) { | ||
assert.ok( QUnit.config.scrolltop, "The scrolltop default is true" ); | ||
} ); | ||
|
||
QUnit.test( "Qunit.config.reorder default was overwritten", function( assert ) { | ||
assert.notOk( QUnit.config.reorder, "reorder was overwritten" ); | ||
} ); | ||
|
||
QUnit.start(); | ||
}, 100 ); | ||
} ); | ||
|
||
QUnit.module( "QUnit.preconfigured" ); | ||
QUnit.test( "Autostart is false", function( assert ) { | ||
assert.notOk( QUnit.config.autostart, "The global autostart setting is applied" ); | ||
} ); |