tests: Modernize test syntax

* Remove redundant file closure.
* Remove needless QUnit.newMwEnvironment() calls as the tested
  methods don't alter mw.config or mw.messages. Slow, as per
  https://gerrit.wikimedia.org/r/c/mediawiki/core/+/912936/

Change-Id: I61bf03325d5067568d057ff2af6bf65f279a8a84
This commit is contained in:
Timo Tijhof 2023-06-02 16:09:38 +01:00
parent ea2e23bf54
commit c51bb93320

View file

@ -1,4 +1,4 @@
( function () {
QUnit.module( 'ext.echo.dm - NotificationItem', function ( hooks ) {
var fakeData = {
type: 'alert',
read: true,
@ -28,11 +28,9 @@
var now = 1234567890000;
var nowFormatted = '2009-02-13T23:31:30Z';
QUnit.module( 'ext.echo.dm - NotificationItem', QUnit.newMwEnvironment( {
beforeEach: function () {
hooks.beforeEach( function () {
this.sandbox.useFakeTimers( now );
}
} ) );
} );
QUnit.test.each( 'Constructing items', {
'Empty data': {
@ -137,4 +135,4 @@
);
} );
}() );
} );