Phuedx has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/351798 )
Change subject: Hygiene: Tidy up QUnit references
......................................................................
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
---
M .istanbul.yml
M src/schema.js
M tests/node-qunit/schema.test.js
3 files changed, 1 insertion(+), 13 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Popups
refs/changes/98/351798/1
diff --git a/.istanbul.yml b/.istanbul.yml
index 22c9c5f..96fc6c9 100644
--- a/.istanbul.yml
+++ b/.istanbul.yml
@@ -3,6 +3,5 @@
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/src/schema.js b/src/schema.js
index 569278e..870f653 100644
--- a/src/schema.js
+++ b/src/schema.js
@@ -14,8 +14,7 @@
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 928597c..aea9c15 100644
--- a/tests/node-qunit/schema.test.js
+++ b/tests/node-qunit/schema.test.js
@@ -55,13 +55,3 @@
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 ) );
-} );
--
To view, visit https://gerrit.wikimedia.org/r/351798
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifb6adb84b8019dd69231b50af00bf978b708fc60
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Popups
Gerrit-Branch: master
Gerrit-Owner: Phuedx <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits