Skip to content

Commit

Permalink
👩‍💻 dx(tests): Simplify server polyfill setup.
Browse files Browse the repository at this point in the history
  • Loading branch information
make-github-pseudonymous-again committed May 13, 2024
1 parent 368e7b1 commit a56412f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
2 changes: 2 additions & 0 deletions imports/_test/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ export const server = (title, fn) => {
};

const prepare = async () => {
await import('../../server/polyfill');

if (isAppTest()) {
await appIsReady();
}
Expand Down
3 changes: 1 addition & 2 deletions imports/api/endpoint/documents/fetch.tests.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
3 changes: 1 addition & 2 deletions imports/api/endpoint/documents/insert.tests.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
4 changes: 0 additions & 4 deletions imports/lib/blob/dataURL.tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a56412f

Please sign in to comment.