From a56412fe56e2f55c0506489ffa4cd29b6c284f6b Mon Sep 17 00:00:00 2001 From: make-github-pseudonymous-again <5165674+make-github-pseudonymous-again@users.noreply.github.com> Date: Mon, 13 May 2024 18:37:00 +0200 Subject: [PATCH] :woman_technologist: dx(tests): Simplify server polyfill setup. --- imports/_test/fixtures.ts | 2 ++ imports/api/endpoint/documents/fetch.tests.ts | 3 +-- imports/api/endpoint/documents/insert.tests.ts | 3 +-- imports/lib/blob/dataURL.tests.ts | 4 ---- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/imports/_test/fixtures.ts b/imports/_test/fixtures.ts index 8f60c8635..8a238a785 100644 --- a/imports/_test/fixtures.ts +++ b/imports/_test/fixtures.ts @@ -113,6 +113,8 @@ export const server = (title, fn) => { }; const prepare = async () => { + await import('../../server/polyfill'); + if (isAppTest()) { await appIsReady(); } diff --git a/imports/api/endpoint/documents/fetch.tests.ts b/imports/api/endpoint/documents/fetch.tests.ts index 14e4d1496..b34e04092 100644 --- a/imports/api/endpoint/documents/fetch.tests.ts +++ b/imports/api/endpoint/documents/fetch.tests.ts @@ -1,7 +1,6 @@ // eslint-disable-next-line import/no-unassigned-import import 'regenerator-runtime/runtime.js'; -// eslint-disable-next-line import/no-unassigned-import -import 'core-js/features/string/replace-all'; + import {assert} from 'chai'; import {randomUserId, server, throws} from '../../../_test/fixtures'; diff --git a/imports/api/endpoint/documents/insert.tests.ts b/imports/api/endpoint/documents/insert.tests.ts index a054b1463..cff55bbe1 100644 --- a/imports/api/endpoint/documents/insert.tests.ts +++ b/imports/api/endpoint/documents/insert.tests.ts @@ -1,7 +1,6 @@ // eslint-disable-next-line import/no-unassigned-import import 'regenerator-runtime/runtime.js'; -// eslint-disable-next-line import/no-unassigned-import -import 'core-js/features/string/replace-all'; + import {assert} from 'chai'; import {randomUserId, server, throws} from '../../../_test/fixtures'; diff --git a/imports/lib/blob/dataURL.tests.ts b/imports/lib/blob/dataURL.tests.ts index 4328d3bcd..feb292cee 100644 --- a/imports/lib/blob/dataURL.tests.ts +++ b/imports/lib/blob/dataURL.tests.ts @@ -11,10 +11,6 @@ import blobToDataURL from './blobToDataURL'; isomorphic(__filename, () => { it('should allow to convert back and forth from a dataURL', async () => { - if (Meteor.isServer) { - await import('../../../server/polyfill/fetch'); - } - const url = randomPNGDataURI(); const blob = await blobFromDataURL(url);