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:
Sam Smith 2017-05-04 10:20:00 +01:00
parent d95badc614
commit 742f341e5c
5 changed files with 1 additions and 13 deletions

View file

@ -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
]

Binary file not shown.

Binary file not shown.

View file

@ -14,8 +14,7 @@ module.exports = function ( config, window ) {
if (
!window.navigator ||
!$.isFunction( window.navigator.sendBeacon ) ||
window.QUnit
!$.isFunction( window.navigator.sendBeacon )
) {
samplingRate = 0;
}

View file

@ -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 ) );
} );