Primeiro commit do projeto Angular

This commit is contained in:
2026-03-14 20:41:55 +00:00
parent 9bebe1de72
commit 94f4f46395
22413 changed files with 3221690 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
import assert from 'node:assert/strict';
import { test } from 'node:test';
import { resolve } from 'node:path';
import Piscina from '..';
function wait () {
// Timeout here should be little bit longer
// than in the worker timeout
// to ensure there are no flaky tests
return new Promise((resolve) => setTimeout(resolve, 10));
}
test('transferable objects must be transferred', async () => {
const pool = new Piscina({
filename: resolve(__dirname, 'fixtures/send-buffer-then-get-length.js'),
atomics: 'disabled'
});
await pool.run({}, { name: 'send' });
await wait();
const after = await pool.run({}, { name: 'get' });
assert.strictEqual(after, 0);
});
test('objects that implement transferable must be transferred', async () => {
const pool = new Piscina({
filename: resolve(
__dirname,
'fixtures/send-transferrable-then-get-length.js'
),
atomics: 'disabled'
});
await pool.run({}, { name: 'send' });
await wait();
const after = await pool.run({}, { name: 'get' });
assert.strictEqual(after, 0);
});