Skip to content

Commit 6be875c

Browse files
committed
Tests: Remove usage of QUnit.extend
1 parent ca3e767 commit 6be875c

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

tests/lib/vendor/qunit-assert-classes/qunit-assert-classes.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@
7575
return message + ( classes.length > 1 ? "es" : "" );
7676
}
7777

78-
QUnit.extend( QUnit.assert, {
78+
// Custom modification: removing QUnit.extend
79+
var key;
80+
var qunitAssertExtensions = {
7981
hasClasses: function( element, classes, message ) {
8082
var classArray = splitClasses( classes ),
8183
results = check( element, classArray );
@@ -233,5 +235,11 @@
233235
message: message
234236
} );
235237
}
236-
});
238+
};
239+
240+
// Custom modification: removing QUnit.extend
241+
for ( key in qunitAssertExtensions ) {
242+
QUnit.assert[ key ] = qunitAssertExtensions[ key ];
243+
}
244+
237245
} ) );

tests/lib/vendor/qunit-assert-close/qunit-assert-close.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@
1414
else if (typeof module !== "undefined" && module && module.exports && typeof require === "function") {
1515
module.exports = factory(require("qunitjs"));
1616
}
17-
// For CommonJS with `exports`, but without `module.exports`, like Rhino
18-
else if (typeof exports !== "undefined" && exports && typeof require === "function") {
19-
var qunit = require("qunitjs");
20-
qunit.extend(exports, factory(qunit));
21-
}
17+
18+
// Custom modification: remove the non-Node.js CommonJS part due to its
19+
// usage of QUnit.extend.
20+
//
2221
// For browser globals
2322
else {
2423
factory(QUnit);
@@ -194,15 +193,17 @@
194193
});
195194
};
196195

197-
196+
var key;
198197
var api = {
199198
close: close,
200199
notClose: notClose,
201200
closePercent: close.percent,
202201
notClosePercent: notClose.percent
203202
};
204203

205-
QUnit.extend(QUnit.assert, api);
204+
for (key in api) {
205+
QUnit.assert[key] = api[key];
206+
}
206207

207208
return api;
208209
}));

0 commit comments

Comments
 (0)