diff --git a/.istanbul.yml b/.istanbul.yml index 22c9c5f3e..96fc6c90c 100644 --- a/.istanbul.yml +++ b/.istanbul.yml @@ -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 ] diff --git a/resources/dist/index.js b/resources/dist/index.js index 4f279c3a2..28c6f6e2d 100644 Binary files a/resources/dist/index.js and b/resources/dist/index.js differ diff --git a/resources/dist/index.js.map b/resources/dist/index.js.map index 49e009fbc..259604493 100644 Binary files a/resources/dist/index.js.map and b/resources/dist/index.js.map differ diff --git a/src/schema.js b/src/schema.js index 569278e23..870f65349 100644 --- a/src/schema.js +++ b/src/schema.js @@ -14,8 +14,7 @@ module.exports = function ( config, window ) { if ( !window.navigator || - !$.isFunction( window.navigator.sendBeacon ) || - window.QUnit + !$.isFunction( window.navigator.sendBeacon ) ) { samplingRate = 0; } diff --git a/tests/node-qunit/schema.test.js b/tests/node-qunit/schema.test.js index 928597c02..aea9c15fa 100644 --- a/tests/node-qunit/schema.test.js +++ b/tests/node-qunit/schema.test.js @@ -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 ) ); -} );