From bba906efe9db8f6922bac12678d99405b3509a53 Mon Sep 17 00:00:00 2001 From: Denis Pushkarev Date: Sat, 16 Jul 2022 04:46:35 +0700 Subject: [PATCH] add compat tests for splitted timer modules --- tests/compat/tests.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/compat/tests.js b/tests/compat/tests.js index b784bb495023..1b50487a8553 100644 --- a/tests/compat/tests.js +++ b/tests/compat/tests.js @@ -223,6 +223,10 @@ function IMMEDIATE() { return setImmediate && clearImmediate; } +function TIMERS() { + return !/MSIE .\./.test(USERAGENT); +} + GLOBAL.tests = { // TODO: Remove this module from `core-js@4` since it's split to modules listed below 'es.symbol': [SYMBOLS_SUPPORT, function () { @@ -1851,6 +1855,8 @@ GLOBAL.tests = { return Object.getOwnPropertyDescriptor(GLOBAL, 'queueMicrotask').value; }, 'web.set-immediate': IMMEDIATE, + 'web.set-interval': TIMERS, + 'web.set-timeout': TIMERS, 'web.structured-clone': function () { var error = new Error(); var test = structuredClone({ a: error, b: error }); @@ -1858,9 +1864,8 @@ GLOBAL.tests = { test = structuredClone(new AggregateError([1], 'a', { cause: 3 })); return test.name == 'AggregateError' && test.errors[0] == 1 && test.message == 'a' && test.cause == 3; }, - 'web.timers': function () { - return !/MSIE .\./.test(USERAGENT); - }, + // TODO: Remove this module from `core-js@4` since it's split to submodules + 'web.timers': TIMERS, 'web.url.constructor': URL_AND_URL_SEARCH_PARAMS_SUPPORT, 'web.url.to-json': [URL_AND_URL_SEARCH_PARAMS_SUPPORT, function () { return URL.prototype.toJSON;