mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
fixes
This commit is contained in:
@@ -469,6 +469,7 @@ async function runTests() {
|
||||
const label = `${getAnsi(color)}[${index}/${total}] ${title} - ${error}${getAnsi("reset")}`;
|
||||
startGroup(label, () => {
|
||||
if (parallelism > 1) return;
|
||||
if (!isCI) return;
|
||||
process.stderr.write(stdoutPreview);
|
||||
});
|
||||
|
||||
@@ -639,7 +640,7 @@ async function runTests() {
|
||||
}
|
||||
|
||||
if (vendorTests?.length) {
|
||||
for (const { cwd: vendorPath, packageManager, testRunner, testPaths, build } of vendorTests) {
|
||||
for (const { cwd: vendorPath, packageManager, testRunner, testPaths, build, todoTests } of vendorTests) {
|
||||
if (!testPaths.length) {
|
||||
continue;
|
||||
}
|
||||
@@ -664,6 +665,7 @@ async function runTests() {
|
||||
}
|
||||
|
||||
for (const testPath of testPaths) {
|
||||
if (todoTests.includes(testPath)) continue;
|
||||
const title = join(relative(cwd, vendorPath), testPath).replace(/\\/g, "/");
|
||||
|
||||
if (testRunner === "bun") {
|
||||
@@ -1651,6 +1653,7 @@ function getTests(cwd) {
|
||||
* @property {string[]} [testExtensions]
|
||||
* @property {boolean | Record<string, boolean | string>} [skipTests]
|
||||
* @property {boolean} [build]
|
||||
* @property {string[]} todoTests
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -1660,6 +1663,7 @@ function getTests(cwd) {
|
||||
* @property {string} testRunner
|
||||
* @property {string[]} testPaths
|
||||
* @property {boolean} build
|
||||
* @property {string[]} todoTests
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -1704,6 +1708,7 @@ async function getVendorTests(cwd) {
|
||||
packageManager,
|
||||
skipTests,
|
||||
build,
|
||||
todoTests,
|
||||
}) => {
|
||||
const vendorPath = join(cwd, "vendor", name);
|
||||
|
||||
@@ -1782,6 +1787,7 @@ async function getVendorTests(cwd) {
|
||||
testRunner: testRunner || "bun",
|
||||
testPaths,
|
||||
build: build ?? true,
|
||||
todoTests: todoTests || [],
|
||||
};
|
||||
},
|
||||
),
|
||||
|
||||
@@ -57,7 +57,7 @@ static const DOMException::Description descriptions[] = {
|
||||
{ "QuotaExceededError"_s, "The quota has been exceeded."_s, 22 },
|
||||
{ "TimeoutError"_s, "The operation timed out."_s, 23 },
|
||||
{ "InvalidNodeTypeError"_s, "The supplied node is incorrect or has an incorrect ancestor for this operation."_s, 24 },
|
||||
{ "DataCloneError"_s, "The object can not be cloned."_s, 25 },
|
||||
{ "DataCloneError"_s, "The object could not be cloned."_s, 25 },
|
||||
{ "EncodingError"_s, "The encoding operation (either encoded or decoding) failed."_s, 0 },
|
||||
{ "NotReadableError"_s, "The I/O read operation failed."_s, 0 },
|
||||
{ "UnknownError"_s, "The operation failed for an unknown transient reason (e.g. out of memory)."_s, 0 },
|
||||
|
||||
@@ -240,51 +240,51 @@ function bunTest() {
|
||||
let ctx: TestContext | undefined = undefined;
|
||||
|
||||
function describe(arg0: unknown, arg1: unknown, arg2: unknown) {
|
||||
const { name, fn } = createDescribe(arg0, arg1, arg2);
|
||||
const { name, fn, options } = createDescribe(arg0, arg1, arg2);
|
||||
const { describe } = bunTest();
|
||||
if (options.skip) return describe.skip(name, fn);
|
||||
if (options.todo) return describe.todo(name, fn);
|
||||
if (options.only) return describe.only(name, fn);
|
||||
describe(name, fn);
|
||||
}
|
||||
|
||||
describe.skip = function (arg0: unknown, arg1: unknown, arg2: unknown) {
|
||||
const { name, fn } = createDescribe(arg0, arg1, arg2);
|
||||
const { describe } = bunTest();
|
||||
describe.skip(name, fn);
|
||||
const { name, fn, options } = createDescribe(arg0, arg1, arg2);
|
||||
describe(name, { ...options, skip: true }, fn);
|
||||
};
|
||||
|
||||
describe.todo = function (arg0: unknown, arg1: unknown, arg2: unknown) {
|
||||
const { name, fn } = createDescribe(arg0, arg1, arg2);
|
||||
const { describe } = bunTest();
|
||||
describe.todo(name, fn);
|
||||
const { name, fn, options } = createDescribe(arg0, arg1, arg2);
|
||||
describe(name, { ...options, todo: true }, fn);
|
||||
};
|
||||
|
||||
describe.only = function (arg0: unknown, arg1: unknown, arg2: unknown) {
|
||||
const { name, fn } = createDescribe(arg0, arg1, arg2);
|
||||
const { describe } = bunTest();
|
||||
describe.only(name, fn);
|
||||
const { name, fn, options } = createDescribe(arg0, arg1, arg2);
|
||||
describe(name, { ...options, only: true }, fn);
|
||||
};
|
||||
|
||||
function test(arg0: unknown, arg1: unknown, arg2: unknown) {
|
||||
const { name, fn, options } = createTest(arg0, arg1, arg2);
|
||||
const { test } = bunTest();
|
||||
test(name, fn, options);
|
||||
if (options.skip) return test.skip(name, fn);
|
||||
if (options.todo) return test.todo(name, fn);
|
||||
if (options.only) return test.only(name, fn);
|
||||
test(name, fn);
|
||||
}
|
||||
|
||||
test.skip = function (arg0: unknown, arg1: unknown, arg2: unknown) {
|
||||
const { name, fn, options } = createTest(arg0, arg1, arg2);
|
||||
const { test } = bunTest();
|
||||
test.skip(name, fn, options);
|
||||
test(name, { ...options, skip: true }, fn);
|
||||
};
|
||||
|
||||
test.todo = function (arg0: unknown, arg1: unknown, arg2: unknown) {
|
||||
const { name, fn, options } = createTest(arg0, arg1, arg2);
|
||||
const { test } = bunTest();
|
||||
test.todo(name, fn, options);
|
||||
test(name, { ...options, todo: true }, fn);
|
||||
};
|
||||
|
||||
test.only = function (arg0: unknown, arg1: unknown, arg2: unknown) {
|
||||
const { name, fn, options } = createTest(arg0, arg1, arg2);
|
||||
const { test } = bunTest();
|
||||
test.only(name, fn, options);
|
||||
test(name, { ...options, only: true }, fn);
|
||||
};
|
||||
|
||||
function before(arg0: unknown, arg1: unknown) {
|
||||
|
||||
@@ -116,7 +116,7 @@ for (const testType of testTypes) {
|
||||
if (!testType.isTransferable) {
|
||||
expect(() =>
|
||||
structuredCloneAdvanced(original, transferList, !!isForTransfer, isForStorage, context),
|
||||
).toThrowError("The object can not be cloned.");
|
||||
).toThrowError("The object could not be cloned.");
|
||||
} else {
|
||||
const cloned = structuredCloneAdvanced(original, transferList, !!isForTransfer, isForStorage, context);
|
||||
testType.expectedAfterClone(original, cloned, isForTransfer, isForStorage);
|
||||
|
||||
@@ -112,6 +112,7 @@ test/napi/node-napi-tests/test/node-api/test_make_callback_recurse/do.test.ts
|
||||
test/napi/node-napi-tests/test/node-api/test_threadsafe_function/do.test.ts
|
||||
test/napi/node-napi-tests/test/node-api/test_worker_terminate_finalization/do.test.ts
|
||||
test/napi/node-napi-tests/test/node-api/test_reference_by_node_api_version/do.test.ts
|
||||
vendor/piscina/test/nice.test.ts
|
||||
|
||||
# normalizeCryptoAlgorithmParameters
|
||||
test/js/node/test/parallel/test-webcrypto-derivekey.js
|
||||
@@ -150,8 +151,3 @@ test/cli/install/bun-repl.test.ts
|
||||
test/bundler/esbuild/default.test.ts
|
||||
test/integration/vite-build/vite-build.test.ts
|
||||
test/cli/inspect/HTTPServerAgent.test.ts
|
||||
|
||||
vendor/piscina/test/idle-timeout.test.ts
|
||||
vendor/piscina/test/nice.test.ts
|
||||
vendor/piscina/test/simple-test.test.ts
|
||||
vendor/piscina/test/test-uncaught-exception-from-handler.test.ts
|
||||
|
||||
@@ -55,6 +55,7 @@ test/js/node/test/parallel/test-worker-terminate-nested.js
|
||||
test/js/node/test/parallel/test-worker-terminate-null-handler.js
|
||||
test/js/node/test/parallel/test-worker-terminate-timers.js
|
||||
test/js/node/test/parallel/test-worker-type-check.js
|
||||
test/js/node/test/parallel/test-worker-uncaught-exception-async.js
|
||||
test/js/node/test/parallel/test-worker-unref-from-message-during-exit.js
|
||||
test/js/node/test/parallel/test-worker-workerdata-sharedarraybuffer.js
|
||||
test/js/node/test/parallel/test-worker.js
|
||||
@@ -202,13 +203,16 @@ vendor/piscina/test/async-context.test.ts
|
||||
vendor/piscina/test/atomics-optimization.test.ts
|
||||
vendor/piscina/test/generics.test.ts
|
||||
vendor/piscina/test/histogram.test.ts
|
||||
vendor/piscina/test/idle-timeout.test.ts
|
||||
vendor/piscina/test/issue-513.test.ts
|
||||
vendor/piscina/test/messages.test.ts
|
||||
vendor/piscina/test/move-test.test.ts
|
||||
vendor/piscina/test/option-validation.test.ts
|
||||
vendor/piscina/test/pool.test.ts
|
||||
vendor/piscina/test/pool-close.test.ts
|
||||
vendor/piscina/test/pool-destroy.test.ts
|
||||
vendor/piscina/test/post-task.test.ts
|
||||
vendor/piscina/test/simple-test.test.ts
|
||||
vendor/piscina/test/task-queue.test.ts
|
||||
vendor/piscina/test/test-is-buffer-transferred.test.ts
|
||||
vendor/piscina/test/test-resourcelimits.test.ts
|
||||
|
||||
@@ -8,6 +8,14 @@
|
||||
"package": "piscina",
|
||||
"repository": "https://github.com/piscinajs/piscina",
|
||||
"tag": "v5.1.3",
|
||||
"build": false
|
||||
"build": false,
|
||||
"todoTests": [
|
||||
"test/post-task.test.ts",
|
||||
"test/nice.test.ts",
|
||||
"test/histogram.test.ts",
|
||||
"test/load-with-esm.test.ts",
|
||||
"test/fixed-queue.test.ts",
|
||||
"test/option-validation.test.ts"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user