This commit is contained in:
CHEVALLIER Abel
2025-11-13 16:23:22 +01:00
parent de9c515a47
commit cb235644dc
34924 changed files with 3811102 additions and 0 deletions

23
node_modules/piscina/test/load-with-esm.test.ts generated vendored Normal file
View File

@@ -0,0 +1,23 @@
import assert from 'node:assert/strict';
import { test } from 'node:test';
const importESM : (specifier : string) => Promise<any> =
// eslint-disable-next-line no-eval
eval('(specifier) => import(specifier)');
test('Piscina is default export', {}, async () => {
assert.strictEqual((await importESM('piscina')).default, require('../'));
});
test('Exports match own property names', {}, async () => {
// Check that version, workerData, etc. are re-exported.
const exported = new Set(Object.getOwnPropertyNames(await importESM('piscina')));
const required = new Set(Object.getOwnPropertyNames(require('../')));
// Remove constructor properties + default export.
for (const k of ['prototype', 'length', 'name']) required.delete(k);
exported.delete('default');
assert.deepStrictEqual(exported, required);
});