Skip to content

Commit bba906e

Browse files
committed
add compat tests for splitted timer modules
1 parent d2d1ef7 commit bba906e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

tests/compat/tests.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,10 @@ function IMMEDIATE() {
223223
return setImmediate && clearImmediate;
224224
}
225225

226+
function TIMERS() {
227+
return !/MSIE .\./.test(USERAGENT);
228+
}
229+
226230
GLOBAL.tests = {
227231
// TODO: Remove this module from `core-js@4` since it's split to modules listed below
228232
'es.symbol': [SYMBOLS_SUPPORT, function () {
@@ -1851,16 +1855,17 @@ GLOBAL.tests = {
18511855
return Object.getOwnPropertyDescriptor(GLOBAL, 'queueMicrotask').value;
18521856
},
18531857
'web.set-immediate': IMMEDIATE,
1858+
'web.set-interval': TIMERS,
1859+
'web.set-timeout': TIMERS,
18541860
'web.structured-clone': function () {
18551861
var error = new Error();
18561862
var test = structuredClone({ a: error, b: error });
18571863
if (!(test && test.a === test.b && test.a instanceof Error && test.stack === error.stack)) return false;
18581864
test = structuredClone(new AggregateError([1], 'a', { cause: 3 }));
18591865
return test.name == 'AggregateError' && test.errors[0] == 1 && test.message == 'a' && test.cause == 3;
18601866
},
1861-
'web.timers': function () {
1862-
return !/MSIE .\./.test(USERAGENT);
1863-
},
1867+
// TODO: Remove this module from `core-js@4` since it's split to submodules
1868+
'web.timers': TIMERS,
18641869
'web.url.constructor': URL_AND_URL_SEARCH_PARAMS_SUPPORT,
18651870
'web.url.to-json': [URL_AND_URL_SEARCH_PARAMS_SUPPORT, function () {
18661871
return URL.prototype.toJSON;

0 commit comments

Comments
 (0)