mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-23 15:16:50 +00:00
Hygiene: Tidy up QUnit references
Since Ieea378c9 all QUnit tests are run in Node.js and not in the browser. Tidy up references to QUnit inside of the codebase and tooling. Changes: * Don't exclude src/processLinks.js in Istanbul code coverage reports. * Don't test for window.QUnit in createSchema. We no longer run the risk of sending beacons while running the QUnit test suite as it's no longer run in the browser. Bug: T160406 Change-Id: Ifb6adb84b8019dd69231b50af00bf978b708fc60
This commit is contained in:
parent
d95badc614
commit
742f341e5c
|
@ -3,6 +3,5 @@ instrumentation:
|
|||
excludes: [
|
||||
"resources/dist/*", # Compiled assets
|
||||
"*.js", # Gruntfile.js and webpack.config.js
|
||||
"src/processLinks.js", # Covered by browser QUnit integration test
|
||||
"src/index.js", # Application entry point
|
||||
]
|
||||
|
|
BIN
resources/dist/index.js
vendored
BIN
resources/dist/index.js
vendored
Binary file not shown.
BIN
resources/dist/index.js.map
vendored
BIN
resources/dist/index.js.map
vendored
Binary file not shown.
|
@ -14,8 +14,7 @@ module.exports = function ( config, window ) {
|
|||
|
||||
if (
|
||||
!window.navigator ||
|
||||
!$.isFunction( window.navigator.sendBeacon ) ||
|
||||
window.QUnit
|
||||
!$.isFunction( window.navigator.sendBeacon )
|
||||
) {
|
||||
samplingRate = 0;
|
||||
}
|
||||
|
|
|
@ -55,13 +55,3 @@ QUnit.test( 'it should use a 0 sampling rate when sendBeacon isn\'t supported',
|
|||
|
||||
assert.deepEqual( mw.eventLog.Schema.getCall( 1 ).args, expectedArgs );
|
||||
} );
|
||||
|
||||
QUnit.test( 'it should use a 0 sampling rate in a unit testing environment', function ( assert ) {
|
||||
assert.expect( 1 );
|
||||
|
||||
this.window.QUnit = {};
|
||||
|
||||
createSchema( this.config, this.window );
|
||||
|
||||
assert.ok( mw.eventLog.Schema.calledWith( 'Popups', 0 ) );
|
||||
} );
|
||||
|
|
Loading…
Reference in a new issue