From dfb6acd2d53177c2c31e2e7d624c232e9bf47716 Mon Sep 17 00:00:00 2001 From: Simon Chan <1330321+yume-chan@users.noreply.github.com> Date: Tue, 16 Jul 2024 16:10:31 +0800 Subject: [PATCH] chore: switch to node test --- .vscode/settings.json | 2 +- apps/cli/package.json | 1 - apps/cli/tsconfig.build.json | 10 +- libraries/adb-credential-web/tsconfig.json | 2 +- libraries/adb-daemon-webusb/package.json | 7 +- .../adb-daemon-webusb/src/manager.spec.ts | 182 +- .../adb-daemon-webusb/tsconfig.build.json | 4 +- libraries/adb-daemon-webusb/tsconfig.json | 3 + libraries/adb-scrcpy/jest.config.js | 14 - libraries/adb-scrcpy/package.json | 4 - libraries/adb-scrcpy/tsconfig.build.json | 2 +- libraries/adb-scrcpy/tsconfig.json | 6 +- libraries/adb-server-node-tcp/package.json | 1 - libraries/adb-server-node-tcp/tsconfig.json | 2 +- libraries/adb/jest.config.js | 14 - libraries/adb/package.json | 7 +- libraries/adb/src/banner.spec.ts | 19 +- .../subprocess/protocols/none.spec.ts | 37 +- .../subprocess/protocols/shell.spec.ts | 49 +- .../adb/src/commands/subprocess/utils.spec.ts | 54 +- .../adb/src/commands/sync/socket.spec.ts | 6 +- libraries/adb/src/daemon/auth.spec.ts | 8 +- libraries/adb/src/daemon/crypto.spec.ts | 59 +- libraries/adb/src/utils/base64.spec.ts | 46 +- libraries/adb/tsconfig.json | 6 +- libraries/android-bin/jest.config.js | 14 - libraries/android-bin/package.json | 10 +- libraries/android-bin/src/intent.spec.ts | 34 +- .../android-bin/src/overlay-display.spec.ts | 156 +- .../android-bin/src/string-format.spec.ts | 9 +- libraries/android-bin/tsconfig.build.json | 2 +- libraries/android-bin/tsconfig.json | 6 +- libraries/android-bin/tsconfig.test.json | 4 +- libraries/aoa/tsconfig.build.json | 2 +- libraries/aoa/tsconfig.json | 6 +- libraries/event/jest.config.js | 13 - libraries/event/package.json | 10 +- libraries/event/src/disposable.spec.ts | 7 +- libraries/event/tsconfig.json | 6 +- libraries/event/tsconfig.test.json | 4 +- libraries/no-data-view/jest.config.js | 14 - libraries/no-data-view/package.json | 9 +- libraries/no-data-view/src/int16.spec.ts | 49 +- libraries/no-data-view/src/int32.spec.ts | 49 +- libraries/no-data-view/src/int64.spec.ts | 53 +- libraries/no-data-view/src/int8.spec.ts | 18 +- libraries/no-data-view/src/uint16.spec.ts | 49 +- libraries/no-data-view/src/uint32.spec.ts | 49 +- libraries/no-data-view/src/uint64.spec.ts | 49 +- libraries/no-data-view/tsconfig.json | 6 +- libraries/no-data-view/tsconfig.test.json | 1 + libraries/pcm-player/jest.config.js | 14 - libraries/pcm-player/package.json | 4 - libraries/pcm-player/tsconfig.json | 6 +- .../scrcpy-decoder-tinyh264/jest.config.js | 14 - .../scrcpy-decoder-tinyh264/package.json | 5 - .../tsconfig.build.json | 4 +- .../scrcpy-decoder-tinyh264/tsconfig.json | 6 +- .../scrcpy-decoder-webcodecs/jest.config.js | 14 - .../scrcpy-decoder-webcodecs/package.json | 4 - .../tsconfig.build.json | 5 +- .../scrcpy-decoder-webcodecs/tsconfig.json | 7 +- libraries/scrcpy/jest.config.js | 14 - libraries/scrcpy/package.json | 10 +- libraries/scrcpy/src/codec/h265.spec.ts | 5 +- libraries/scrcpy/src/codec/nalu.spec.ts | 146 +- .../src/options/1_16/codec-options.spec.ts | 5 +- .../scrcpy/src/options/1_16/options.spec.ts | 7 +- .../scrcpy/src/options/1_16/scroll.spec.ts | 17 +- libraries/scrcpy/src/options/1_17.spec.ts | 7 +- libraries/scrcpy/src/options/1_18.spec.ts | 5 +- libraries/scrcpy/src/options/1_21.spec.ts | 11 +- .../scrcpy/src/options/1_22/options.spec.ts | 5 +- .../scrcpy/src/options/1_22/scroll.spec.ts | 7 +- .../scrcpy/src/options/1_25/options.spec.ts | 7 +- .../scrcpy/src/options/1_25/scroll.spec.ts | 36 +- libraries/scrcpy/src/options/2_0.spec.ts | 7 +- libraries/scrcpy/src/options/2_1.spec.ts | 7 +- libraries/scrcpy/tsconfig.build.json | 2 +- libraries/scrcpy/tsconfig.json | 6 +- libraries/scrcpy/tsconfig.test.json | 1 + libraries/stream-extra/jest.config.js | 14 - libraries/stream-extra/package.json | 10 +- libraries/stream-extra/src/buffered.spec.ts | 19 +- libraries/stream-extra/src/concat.spec.ts | 52 +- .../stream-extra/src/distribution.spec.ts | 12 +- libraries/stream-extra/src/duplex.spec.ts | 2 +- .../stream-extra/src/push-readable.spec.ts | 946 ++++--- .../stream-extra/src/wrap-writable.spec.ts | 53 +- libraries/stream-extra/tsconfig.json | 6 +- libraries/stream-extra/tsconfig.test.json | 4 +- libraries/struct/package.json | 10 +- libraries/struct/src/basic/definition.spec.ts | 5 +- .../struct/src/basic/field-value.spec.ts | 17 +- libraries/struct/src/basic/options.spec.ts | 5 +- .../struct/src/basic/struct-value.spec.ts | 39 +- libraries/struct/src/index.spec.ts | 5 +- libraries/struct/src/struct.spec.ts | 331 +-- libraries/struct/src/sync-promise.spec.ts | 61 +- .../struct/src/types/buffer/base.spec.ts | 70 +- .../src/types/buffer/fixed-length.spec.ts | 5 +- .../src/types/buffer/variable-length.spec.ts | 449 ++- libraries/struct/src/types/number.spec.ts | 139 +- libraries/struct/src/utils.spec.ts | 5 +- libraries/struct/tsconfig.build.json | 7 +- libraries/struct/tsconfig.json | 7 +- libraries/struct/tsconfig.test.json | 1 + pnpm-lock.yaml | 2511 +---------------- toolchain/eslint-config/eslint.config.js | 7 +- toolchain/package-lint/index.mjs | 143 + toolchain/package-lint/package.json | 15 + toolchain/test-runner/jsconfig.json | 7 + toolchain/test-runner/package.json | 13 + toolchain/test-runner/run-test.js | 136 + toolchain/test-runner/wrapper.js | 23 + 115 files changed, 2433 insertions(+), 4258 deletions(-) delete mode 100644 libraries/adb-scrcpy/jest.config.js delete mode 100644 libraries/adb/jest.config.js delete mode 100644 libraries/android-bin/jest.config.js delete mode 100644 libraries/event/jest.config.js delete mode 100644 libraries/no-data-view/jest.config.js delete mode 100644 libraries/pcm-player/jest.config.js delete mode 100644 libraries/scrcpy-decoder-tinyh264/jest.config.js delete mode 100644 libraries/scrcpy-decoder-webcodecs/jest.config.js delete mode 100644 libraries/scrcpy/jest.config.js delete mode 100644 libraries/stream-extra/jest.config.js create mode 100644 toolchain/package-lint/index.mjs create mode 100644 toolchain/package-lint/package.json create mode 100644 toolchain/test-runner/jsconfig.json create mode 100644 toolchain/test-runner/package.json create mode 100644 toolchain/test-runner/run-test.js create mode 100644 toolchain/test-runner/wrapper.js diff --git a/.vscode/settings.json b/.vscode/settings.json index 56293c13..21b340b5 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -114,7 +114,7 @@ "editor.defaultFormatter": "esbenp.prettier-vscode" }, "explorer.sortOrder": "mixed", - "prettier.prettierPath": "./common/temp/node_modules/prettier/index.cjs", + "prettier.prettierPath": "./node_modules/prettier/index.cjs", "cSpell.numSuggestions": 4, "cSpell.ignoreRegExpList": [ "0x[0-9a-f_]+" diff --git a/apps/cli/package.json b/apps/cli/package.json index 3d9459f3..cbe208b7 100644 --- a/apps/cli/package.json +++ b/apps/cli/package.json @@ -45,7 +45,6 @@ "@types/node": "^20.14.9", "@yume-chan/eslint-config": "workspace:^1.0.0", "@yume-chan/tsconfig": "workspace:^1.0.0", - "jest": "^30.0.0-alpha.4", "prettier": "^3.3.3", "typescript": "^5.5.3" } diff --git a/apps/cli/tsconfig.build.json b/apps/cli/tsconfig.build.json index d1b6d49f..2dc51796 100644 --- a/apps/cli/tsconfig.build.json +++ b/apps/cli/tsconfig.build.json @@ -4,17 +4,17 @@ "lib": [ "ESNext", "DOM" - ], + ] }, "references": [ - { - "path": "../../libraries/adb/tsconfig.build.json" - }, { "path": "../../libraries/adb-server-node-tcp/tsconfig.build.json" }, + { + "path": "../../libraries/adb/tsconfig.build.json" + }, { "path": "../../libraries/stream-extra/tsconfig.build.json" } - ], + ] } diff --git a/libraries/adb-credential-web/tsconfig.json b/libraries/adb-credential-web/tsconfig.json index 3dce3aea..a96f9b5d 100644 --- a/libraries/adb-credential-web/tsconfig.json +++ b/libraries/adb-credential-web/tsconfig.json @@ -2,6 +2,6 @@ "references": [ { "path": "./tsconfig.build.json" - }, + } ] } diff --git a/libraries/adb-daemon-webusb/package.json b/libraries/adb-daemon-webusb/package.json index ab79a742..18c25d23 100644 --- a/libraries/adb-daemon-webusb/package.json +++ b/libraries/adb-daemon-webusb/package.json @@ -30,7 +30,7 @@ "build:watch": "tsc -b tsconfig.build.json", "lint": "run-eslint && prettier src/**/*.ts --write --tab-width 4", "prepublishOnly": "npm run build", - "test": "cross-env NODE_OPTIONS=\"--experimental-vm-modules --no-warnings\" TS_JEST_DISABLE_VER_CHECKER=true jest --coverage" + "test": "run-test" }, "dependencies": { "@types/w3c-web-usb": "^1.0.10", @@ -39,14 +39,11 @@ "@yume-chan/struct": "workspace:^0.0.24" }, "devDependencies": { - "@jest/globals": "^30.0.0-alpha.4", "@types/node": "^20.14.9", "@yume-chan/eslint-config": "workspace:^1.0.0", + "@yume-chan/test-runner": "workspace:^1.0.0", "@yume-chan/tsconfig": "workspace:^1.0.0", - "cross-env": "^7.0.3", - "jest": "^30.0.0-alpha.4", "prettier": "^3.3.3", - "ts-jest": "^29.2.2", "typescript": "^5.5.3" } } diff --git a/libraries/adb-daemon-webusb/src/manager.spec.ts b/libraries/adb-daemon-webusb/src/manager.spec.ts index 029a50c4..ebfe24fd 100644 --- a/libraries/adb-daemon-webusb/src/manager.spec.ts +++ b/libraries/adb-daemon-webusb/src/manager.spec.ts @@ -1,17 +1,22 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ /* eslint-disable @typescript-eslint/require-await */ -import { describe, expect, it, jest } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it, mock } from "node:test"; -import { ADB_DEFAULT_INTERFACE_FILTER, AdbDaemonWebUsbDevice } from "./device"; +import { + ADB_DEFAULT_INTERFACE_FILTER, + AdbDaemonWebUsbDevice, +} from "./device.js"; import { AdbDaemonWebUsbDeviceManager } from "./manager.js"; class MockUsb implements USB { - onconnect: (ev: USBConnectionEvent) => void = jest.fn(); - ondisconnect: (ev: USBConnectionEvent) => void = jest.fn(); + onconnect: (ev: USBConnectionEvent) => void = mock.fn(); + ondisconnect: (ev: USBConnectionEvent) => void = mock.fn(); - getDevices: () => Promise = jest.fn(async () => []); - requestDevice: (options?: USBDeviceRequestOptions) => Promise = - jest.fn(async () => ({ serialNumber: "abcdefgh" }) as never); + getDevices = mock.fn(async () => []); + requestDevice = mock.fn( + async () => ({ serialNumber: "abcdefgh" }) as never, + ); addEventListener( type: "connect" | "disconnect", @@ -57,67 +62,87 @@ describe("AdbDaemonWebUsbDeviceManager", () => { it("should accept 0 args", async () => { const usb = new MockUsb(); const manager = new AdbDaemonWebUsbDeviceManager(usb); - await expect(manager.requestDevice()).resolves.toBeInstanceOf( - AdbDaemonWebUsbDevice, + assert.ok( + (await manager.requestDevice()) instanceof + AdbDaemonWebUsbDevice, ); - expect(usb.requestDevice).toHaveBeenCalledTimes(1); - expect(usb.requestDevice).toHaveBeenCalledWith({ - filters: [ADB_DEFAULT_INTERFACE_FILTER], - }); + assert.strictEqual(usb.requestDevice.mock.callCount(), 1); + assert.deepEqual(usb.requestDevice.mock.calls[0]?.arguments, [ + { + filters: [ADB_DEFAULT_INTERFACE_FILTER], + exclusionFilters: undefined, + }, + ]); }); it("should accept undefined filters", async () => { const usb = new MockUsb(); const manager = new AdbDaemonWebUsbDeviceManager(usb); - await expect( - manager.requestDevice({ filters: undefined }), - ).resolves.toBeInstanceOf(AdbDaemonWebUsbDevice); - expect(usb.requestDevice).toHaveBeenCalledTimes(1); - expect(usb.requestDevice).toHaveBeenCalledWith({ - filters: [ADB_DEFAULT_INTERFACE_FILTER], - }); + assert.ok( + (await manager.requestDevice({ filters: undefined })) instanceof + AdbDaemonWebUsbDevice, + ); + assert.strictEqual(usb.requestDevice.mock.callCount(), 1); + assert.deepEqual(usb.requestDevice.mock.calls[0]?.arguments, [ + { + filters: [ADB_DEFAULT_INTERFACE_FILTER], + exclusionFilters: undefined, + }, + ]); }); it("should accept empty filters array", async () => { const usb = new MockUsb(); const manager = new AdbDaemonWebUsbDeviceManager(usb); - await expect( - manager.requestDevice({ filters: [] }), - ).resolves.toBeInstanceOf(AdbDaemonWebUsbDevice); - expect(usb.requestDevice).toHaveBeenCalledTimes(1); - expect(usb.requestDevice).toHaveBeenCalledWith({ - filters: [ADB_DEFAULT_INTERFACE_FILTER], - }); + assert.ok( + (await manager.requestDevice({ filters: [] })) instanceof + AdbDaemonWebUsbDevice, + ); + assert.strictEqual(usb.requestDevice.mock.callCount(), 1); + assert.deepEqual(usb.requestDevice.mock.calls[0]?.arguments, [ + { + filters: [ADB_DEFAULT_INTERFACE_FILTER], + exclusionFilters: undefined, + }, + ]); }); it("should accept empty filter object", async () => { const usb = new MockUsb(); const manager = new AdbDaemonWebUsbDeviceManager(usb); - await expect( - manager.requestDevice({ filters: [{}] }), - ).resolves.toBeInstanceOf(AdbDaemonWebUsbDevice); - expect(usb.requestDevice).toHaveBeenCalledTimes(1); - expect(usb.requestDevice).toHaveBeenCalledWith({ - filters: [ADB_DEFAULT_INTERFACE_FILTER], - }); + assert.ok( + (await manager.requestDevice({ filters: [{}] })) instanceof + AdbDaemonWebUsbDevice, + ); + assert.strictEqual(usb.requestDevice.mock.callCount(), 1); + assert.deepEqual(usb.requestDevice.mock.calls[0]?.arguments, [ + { + filters: [ADB_DEFAULT_INTERFACE_FILTER], + exclusionFilters: undefined, + }, + ]); }); it("should merge missing fields with default values", async () => { const usb = new MockUsb(); const manager = new AdbDaemonWebUsbDeviceManager(usb); const filter: USBDeviceFilter = { vendorId: 0x1234 }; - await expect( - manager.requestDevice({ filters: [filter] }), - ).resolves.toBeInstanceOf(AdbDaemonWebUsbDevice); - expect(usb.requestDevice).toHaveBeenCalledTimes(1); - expect(usb.requestDevice).toHaveBeenCalledWith({ - filters: [ - { - ...ADB_DEFAULT_INTERFACE_FILTER, - ...filter, - }, - ], - }); + assert.ok( + (await manager.requestDevice({ filters: [filter] })) instanceof + AdbDaemonWebUsbDevice, + ); + assert.strictEqual(usb.requestDevice.mock.callCount(), 1); + assert.deepEqual(usb.requestDevice.mock.calls[0]?.arguments, [ + { + filters: [ + { + ...ADB_DEFAULT_INTERFACE_FILTER, + ...filter, + }, + ], + exclusionFilters: undefined, + }, + ]); }); it("should merge undefined fields with default values", async () => { @@ -127,18 +152,22 @@ describe("AdbDaemonWebUsbDeviceManager", () => { classCode: undefined, vendorId: 0x1234, }; - await expect( - manager.requestDevice({ filters: [filter] }), - ).resolves.toBeInstanceOf(AdbDaemonWebUsbDevice); - expect(usb.requestDevice).toHaveBeenCalledTimes(1); - expect(usb.requestDevice).toHaveBeenCalledWith({ - filters: [ - { - ...filter, - ...ADB_DEFAULT_INTERFACE_FILTER, - }, - ], - }); + assert.ok( + (await manager.requestDevice({ filters: [filter] })) instanceof + AdbDaemonWebUsbDevice, + ); + assert.strictEqual(usb.requestDevice.mock.callCount(), 1); + assert.deepEqual(usb.requestDevice.mock.calls[0]?.arguments, [ + { + filters: [ + { + ...filter, + ...ADB_DEFAULT_INTERFACE_FILTER, + }, + ], + exclusionFilters: undefined, + }, + ]); }); it("should accept multiple filters", async () => { @@ -146,22 +175,27 @@ describe("AdbDaemonWebUsbDeviceManager", () => { const manager = new AdbDaemonWebUsbDeviceManager(usb); const filter1: USBDeviceFilter = { vendorId: 0x1234 }; const filter2: USBDeviceFilter = { classCode: 0xaa }; - await expect( - manager.requestDevice({ filters: [filter1, filter2] }), - ).resolves.toBeInstanceOf(AdbDaemonWebUsbDevice); - expect(usb.requestDevice).toHaveBeenCalledTimes(1); - expect(usb.requestDevice).toHaveBeenCalledWith({ - filters: [ - { - ...ADB_DEFAULT_INTERFACE_FILTER, - ...filter1, - }, - { - ...ADB_DEFAULT_INTERFACE_FILTER, - ...filter2, - }, - ], - }); + assert.ok( + (await manager.requestDevice({ + filters: [filter1, filter2], + })) instanceof AdbDaemonWebUsbDevice, + ); + assert.strictEqual(usb.requestDevice.mock.callCount(), 1); + assert.deepEqual(usb.requestDevice.mock.calls[0]?.arguments, [ + { + filters: [ + { + ...ADB_DEFAULT_INTERFACE_FILTER, + ...filter1, + }, + { + ...ADB_DEFAULT_INTERFACE_FILTER, + ...filter2, + }, + ], + exclusionFilters: undefined, + }, + ]); }); }); }); diff --git a/libraries/adb-daemon-webusb/tsconfig.build.json b/libraries/adb-daemon-webusb/tsconfig.build.json index 914013fa..25aa347e 100644 --- a/libraries/adb-daemon-webusb/tsconfig.build.json +++ b/libraries/adb-daemon-webusb/tsconfig.build.json @@ -6,7 +6,7 @@ "DOM" ], "types": [ - "w3c-web-usb", + "w3c-web-usb" ] }, "references": [ @@ -18,6 +18,6 @@ }, { "path": "../struct/tsconfig.build.json" - }, + } ] } diff --git a/libraries/adb-daemon-webusb/tsconfig.json b/libraries/adb-daemon-webusb/tsconfig.json index 3dce3aea..d6787a22 100644 --- a/libraries/adb-daemon-webusb/tsconfig.json +++ b/libraries/adb-daemon-webusb/tsconfig.json @@ -3,5 +3,8 @@ { "path": "./tsconfig.build.json" }, + { + "path": "./tsconfig.test.json" + } ] } diff --git a/libraries/adb-scrcpy/jest.config.js b/libraries/adb-scrcpy/jest.config.js deleted file mode 100644 index ff68d1cb..00000000 --- a/libraries/adb-scrcpy/jest.config.js +++ /dev/null @@ -1,14 +0,0 @@ -/** @type {import('ts-jest').JestConfigWithTsJest} */ -export default { - preset: "ts-jest/presets/default-esm", - extensionsToTreatAsEsm: [".ts"], - transform: { - "^.+\\.tsx?$": [ - "ts-jest", - { tsconfig: "tsconfig.test.json", useESM: true }, - ], - }, - moduleNameMapper: { - "^(\\.{1,2}/.*)\\.js$": "$1", - }, -}; diff --git a/libraries/adb-scrcpy/package.json b/libraries/adb-scrcpy/package.json index 0e2038b2..18343f66 100644 --- a/libraries/adb-scrcpy/package.json +++ b/libraries/adb-scrcpy/package.json @@ -41,13 +41,9 @@ "@yume-chan/struct": "workspace:^0.0.24" }, "devDependencies": { - "@jest/globals": "^30.0.0-alpha.4", "@yume-chan/eslint-config": "workspace:^1.0.0", "@yume-chan/tsconfig": "workspace:^1.0.0", - "cross-env": "^7.0.3", - "jest": "^30.0.0-alpha.4", "prettier": "^3.3.3", - "ts-jest": "^29.2.2", "typescript": "^5.5.3" } } diff --git a/libraries/adb-scrcpy/tsconfig.build.json b/libraries/adb-scrcpy/tsconfig.build.json index 69904993..4528e59a 100644 --- a/libraries/adb-scrcpy/tsconfig.build.json +++ b/libraries/adb-scrcpy/tsconfig.build.json @@ -15,6 +15,6 @@ }, { "path": "../struct/tsconfig.build.json" - }, + } ] } diff --git a/libraries/adb-scrcpy/tsconfig.json b/libraries/adb-scrcpy/tsconfig.json index 85fc5a7a..d6787a22 100644 --- a/libraries/adb-scrcpy/tsconfig.json +++ b/libraries/adb-scrcpy/tsconfig.json @@ -1,10 +1,10 @@ { "references": [ - { - "path": "./tsconfig.test.json" - }, { "path": "./tsconfig.build.json" }, + { + "path": "./tsconfig.test.json" + } ] } diff --git a/libraries/adb-server-node-tcp/package.json b/libraries/adb-server-node-tcp/package.json index 41168e33..e5330d5c 100644 --- a/libraries/adb-server-node-tcp/package.json +++ b/libraries/adb-server-node-tcp/package.json @@ -41,7 +41,6 @@ "@types/node": "^20.14.9", "@yume-chan/eslint-config": "workspace:^1.0.0", "@yume-chan/tsconfig": "workspace:^1.0.0", - "jest": "^30.0.0-alpha.4", "prettier": "^3.3.3", "typescript": "^5.5.3" } diff --git a/libraries/adb-server-node-tcp/tsconfig.json b/libraries/adb-server-node-tcp/tsconfig.json index 3dce3aea..a96f9b5d 100644 --- a/libraries/adb-server-node-tcp/tsconfig.json +++ b/libraries/adb-server-node-tcp/tsconfig.json @@ -2,6 +2,6 @@ "references": [ { "path": "./tsconfig.build.json" - }, + } ] } diff --git a/libraries/adb/jest.config.js b/libraries/adb/jest.config.js deleted file mode 100644 index ff68d1cb..00000000 --- a/libraries/adb/jest.config.js +++ /dev/null @@ -1,14 +0,0 @@ -/** @type {import('ts-jest').JestConfigWithTsJest} */ -export default { - preset: "ts-jest/presets/default-esm", - extensionsToTreatAsEsm: [".ts"], - transform: { - "^.+\\.tsx?$": [ - "ts-jest", - { tsconfig: "tsconfig.test.json", useESM: true }, - ], - }, - moduleNameMapper: { - "^(\\.{1,2}/.*)\\.js$": "$1", - }, -}; diff --git a/libraries/adb/package.json b/libraries/adb/package.json index 48ae479c..8ed8cff6 100644 --- a/libraries/adb/package.json +++ b/libraries/adb/package.json @@ -30,7 +30,7 @@ "build:watch": "tsc -b tsconfig.build.json", "lint": "run-eslint && prettier src/**/*.ts --write --tab-width 4", "prepublishOnly": "npm run build", - "test": "cross-env NODE_OPTIONS=\"--experimental-vm-modules --no-warnings\" TS_JEST_DISABLE_VER_CHECKER=true jest --coverage" + "test": "run-test" }, "dependencies": { "@yume-chan/async": "^2.2.0", @@ -40,14 +40,11 @@ "@yume-chan/struct": "workspace:^0.0.24" }, "devDependencies": { - "@jest/globals": "^30.0.0-alpha.4", "@types/node": "^20.14.9", "@yume-chan/eslint-config": "workspace:^1.0.0", + "@yume-chan/test-runner": "workspace:^1.0.0", "@yume-chan/tsconfig": "workspace:^1.0.0", - "cross-env": "^7.0.3", - "jest": "^30.0.0-alpha.4", "prettier": "^3.3.3", - "ts-jest": "^29.2.2", "typescript": "^5.5.3" } } diff --git a/libraries/adb/src/banner.spec.ts b/libraries/adb/src/banner.spec.ts index 1edb7ff0..744a9155 100644 --- a/libraries/adb/src/banner.spec.ts +++ b/libraries/adb/src/banner.spec.ts @@ -1,4 +1,5 @@ -import { describe, expect, it } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it } from "node:test"; import { AdbBanner } from "./banner.js"; @@ -7,20 +8,20 @@ describe("AdbBanner", () => { const banner = AdbBanner.parse( "device::ro.product.name=NovaPro;ro.product.model=NovaPro;ro.product.device=NovaPro;\0", ); - expect(banner).toHaveProperty("product", "NovaPro"); - expect(banner).toHaveProperty("model", "NovaPro"); - expect(banner).toHaveProperty("device", "NovaPro"); - expect(banner).toHaveProperty("features", []); + assert.strictEqual(banner.product, "NovaPro"); + assert.strictEqual(banner.model, "NovaPro"); + assert.strictEqual(banner.device, "NovaPro"); + assert.deepStrictEqual(banner.features, []); }); it("should parse new banner", () => { const banner = AdbBanner.parse( "device::ro.product.name=mblu_10_CN;ro.product.model=mblu10;ro.product.device=mblu10;features=sendrecv_v2_brotli,remount_shell,sendrecv_v2,abb_exec,fixed_push_mkdir,fixed_push_symlink_timestamp,abb,shell_v2,cmd,ls_v2,apex,stat_v2", ); - expect(banner).toHaveProperty("product", "mblu_10_CN"); - expect(banner).toHaveProperty("model", "mblu10"); - expect(banner).toHaveProperty("device", "mblu10"); - expect(banner).toHaveProperty("features", [ + assert.strictEqual(banner.product, "mblu_10_CN"); + assert.strictEqual(banner.model, "mblu10"); + assert.strictEqual(banner.device, "mblu10"); + assert.deepStrictEqual(banner.features, [ "sendrecv_v2_brotli", "remount_shell", "sendrecv_v2", diff --git a/libraries/adb/src/commands/subprocess/protocols/none.spec.ts b/libraries/adb/src/commands/subprocess/protocols/none.spec.ts index e081f129..55b58678 100644 --- a/libraries/adb/src/commands/subprocess/protocols/none.spec.ts +++ b/libraries/adb/src/commands/subprocess/protocols/none.spec.ts @@ -1,6 +1,7 @@ -import { describe, expect, it, jest } from "@jest/globals"; import { PromiseResolver } from "@yume-chan/async"; import { ReadableStream, WritableStream } from "@yume-chan/stream-extra"; +import assert from "node:assert"; +import { describe, it, mock } from "node:test"; import type { AdbSocket } from "../../../adb.js"; @@ -12,7 +13,7 @@ describe("AdbSubprocessNoneProtocol", () => { const closed = new PromiseResolver(); const socket: AdbSocket = { service: "", - close: jest.fn(() => {}), + close: mock.fn(() => {}), closed: closed.promise, readable: new ReadableStream({ async start(controller) { @@ -28,11 +29,11 @@ describe("AdbSubprocessNoneProtocol", () => { const process = new AdbSubprocessNoneProtocol(socket); const reader = process.stdout.getReader(); - await expect(reader.read()).resolves.toEqual({ + assert.deepStrictEqual(await reader.read(), { done: false, value: new Uint8Array([1, 2, 3]), }); - await expect(reader.read()).resolves.toEqual({ + assert.deepStrictEqual(await reader.read(), { done: false, value: new Uint8Array([4, 5, 6]), }); @@ -42,7 +43,7 @@ describe("AdbSubprocessNoneProtocol", () => { const closed = new PromiseResolver(); const socket: AdbSocket = { service: "", - close: jest.fn(() => {}), + close: mock.fn(() => {}), closed: closed.promise, readable: new ReadableStream({ async start(controller) { @@ -58,19 +59,20 @@ describe("AdbSubprocessNoneProtocol", () => { const process = new AdbSubprocessNoneProtocol(socket); const reader = process.stdout.getReader(); - await expect(reader.read()).resolves.toEqual({ + assert.deepStrictEqual(await reader.read(), { done: false, value: new Uint8Array([1, 2, 3]), }); - await expect(reader.read()).resolves.toEqual({ + assert.deepStrictEqual(await reader.read(), { done: false, value: new Uint8Array([4, 5, 6]), }); closed.resolve(); - await expect(reader.read()).resolves.toEqual({ + assert.deepStrictEqual(await reader.read(), { done: true, + value: undefined, }); }); }); @@ -80,7 +82,7 @@ describe("AdbSubprocessNoneProtocol", () => { const closed = new PromiseResolver(); const socket: AdbSocket = { service: "", - close: jest.fn(() => {}), + close: mock.fn(() => {}), closed: closed.promise, readable: new ReadableStream({ async start(controller) { @@ -98,7 +100,10 @@ describe("AdbSubprocessNoneProtocol", () => { closed.resolve(); - await expect(reader.read()).resolves.toEqual({ done: true }); + assert.deepStrictEqual(await reader.read(), { + done: true, + value: undefined, + }); }); }); @@ -107,7 +112,7 @@ describe("AdbSubprocessNoneProtocol", () => { const closed = new PromiseResolver(); const socket: AdbSocket = { service: "", - close: jest.fn(() => {}), + close: mock.fn(() => {}), closed: closed.promise, readable: new ReadableStream(), writable: new WritableStream(), @@ -117,25 +122,25 @@ describe("AdbSubprocessNoneProtocol", () => { closed.resolve(); - await expect(process.exit).resolves.toBe(0); + assert.strictEqual(await process.exit, 0); }); }); it("`resize` shouldn't throw any error", () => { const socket: AdbSocket = { service: "", - close: jest.fn(() => {}), + close: mock.fn(() => {}), closed: new PromiseResolver().promise, readable: new ReadableStream(), writable: new WritableStream(), }; const process = new AdbSubprocessNoneProtocol(socket); - expect(() => process.resize()).not.toThrow(); + assert.doesNotThrow(() => process.resize()); }); it("`kill` should close `socket`", async () => { - const close = jest.fn(() => {}); + const close = mock.fn(() => {}); const socket: AdbSocket = { service: "", close, @@ -146,6 +151,6 @@ describe("AdbSubprocessNoneProtocol", () => { const process = new AdbSubprocessNoneProtocol(socket); await process.kill(); - expect(close).toHaveBeenCalledTimes(1); + assert.deepEqual(close.mock.callCount(), 1); }); }); diff --git a/libraries/adb/src/commands/subprocess/protocols/shell.spec.ts b/libraries/adb/src/commands/subprocess/protocols/shell.spec.ts index 03cc57a2..d667a145 100644 --- a/libraries/adb/src/commands/subprocess/protocols/shell.spec.ts +++ b/libraries/adb/src/commands/subprocess/protocols/shell.spec.ts @@ -1,7 +1,8 @@ -import { describe, expect, it } from "@jest/globals"; import { PromiseResolver } from "@yume-chan/async"; import type { ReadableStreamDefaultController } from "@yume-chan/stream-extra"; import { ReadableStream, WritableStream } from "@yume-chan/stream-extra"; +import assert from "node:assert"; +import { describe, it } from "node:test"; import type { AdbSocket } from "../../../adb.js"; @@ -45,6 +46,10 @@ function createMockSocket( return [socket, closed]; } +async function assertResolves(promise: Promise, expected: T) { + return assert.deepStrictEqual(await promise, expected); +} + describe("AdbSubprocessShellProtocol", () => { describe("`stdout` and `stderr`", () => { it("should parse data from `socket", async () => { @@ -54,11 +59,11 @@ describe("AdbSubprocessShellProtocol", () => { const stdoutReader = process.stdout.getReader(); const stderrReader = process.stderr.getReader(); - await expect(stdoutReader.read()).resolves.toEqual({ + assertResolves(stdoutReader.read(), { done: false, value: new Uint8Array([1, 2, 3]), }); - await expect(stderrReader.read()).resolves.toEqual({ + assertResolves(stderrReader.read(), { done: false, value: new Uint8Array([4, 5, 6]), }); @@ -87,11 +92,11 @@ describe("AdbSubprocessShellProtocol", () => { await stdoutReader.cancel(); closed.resolve(); - await expect(stderrReader.read()).resolves.toEqual({ + assertResolves(stderrReader.read(), { done: false, value: new Uint8Array([4, 5, 6]), }); - await expect(stderrReader.read()).resolves.toEqual({ + assertResolves(stderrReader.read(), { done: false, value: new Uint8Array([10, 11, 12]), }); @@ -115,24 +120,26 @@ describe("AdbSubprocessShellProtocol", () => { const stdoutReader = process.stdout.getReader(); const stderrReader = process.stderr.getReader(); - await expect(stdoutReader.read()).resolves.toEqual({ + assertResolves(stdoutReader.read(), { done: false, value: new Uint8Array([1, 2, 3]), }); - await expect(stderrReader.read()).resolves.toEqual({ + assertResolves(stderrReader.read(), { done: false, value: new Uint8Array([4, 5, 6]), }); closed.resolve(); - await expect(stdoutReader.read()).resolves.toEqual({ + assertResolves(stdoutReader.read(), { done: true, + value: undefined, }); - await expect(stderrReader.read()).resolves.toEqual({ + assertResolves(stderrReader.read(), { done: true, + value: undefined, }); - await expect(process.exit).resolves.toBe(42); + assert.strictEqual(await process.exit, 42); }); }); @@ -146,11 +153,11 @@ describe("AdbSubprocessShellProtocol", () => { const stdoutReader = process.stdout.getReader(); const stderrReader = process.stderr.getReader(); - await expect(stdoutReader.read()).resolves.toEqual({ + assertResolves(stdoutReader.read(), { done: false, value: new Uint8Array([1, 2, 3]), }); - await expect(stderrReader.read()).resolves.toEqual({ + assertResolves(stderrReader.read(), { done: false, value: new Uint8Array([4, 5, 6]), }); @@ -158,13 +165,15 @@ describe("AdbSubprocessShellProtocol", () => { closed.resolve(); await Promise.all([ - expect(stdoutReader.read()).resolves.toEqual({ + assertResolves(stdoutReader.read(), { done: true, + value: undefined, }), - expect(stderrReader.read()).resolves.toEqual({ + assertResolves(stderrReader.read(), { done: true, + value: undefined, }), - expect(process.exit).rejects.toThrow(), + assert.rejects(process.exit), ]); }); }); @@ -181,11 +190,11 @@ describe("AdbSubprocessShellProtocol", () => { const stdoutReader = process.stdout.getReader(); const stderrReader = process.stderr.getReader(); - await expect(stdoutReader.read()).resolves.toEqual({ + await assertResolves(stdoutReader.read(), { done: false, value: new Uint8Array([1, 2, 3]), }); - await expect(stderrReader.read()).resolves.toEqual({ + await assertResolves(stderrReader.read(), { done: false, value: new Uint8Array([4, 5, 6]), }); @@ -193,9 +202,9 @@ describe("AdbSubprocessShellProtocol", () => { closed.resolve(); await Promise.all([ - expect(stdoutReader.read()).rejects.toThrow(), - expect(stderrReader.read()).rejects.toThrow(), - expect(process.exit).rejects.toThrow(), + assert.rejects(stdoutReader.read()), + assert.rejects(stderrReader.read()), + assert.rejects(process.exit), ]); }); }); diff --git a/libraries/adb/src/commands/subprocess/utils.spec.ts b/libraries/adb/src/commands/subprocess/utils.spec.ts index aeef77d6..8e57e8bb 100644 --- a/libraries/adb/src/commands/subprocess/utils.spec.ts +++ b/libraries/adb/src/commands/subprocess/utils.spec.ts @@ -1,44 +1,44 @@ -import { describe, expect, it } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it } from "node:test"; import { escapeArg } from "./utils.js"; describe("escapeArg", () => { it("should escape single quotes", () => { // https://android.googlesource.com/platform/packages/modules/adb/+/72c82a8d8ea0648ecea9dd47e0f4176bad792cfa/adb_utils_test.cpp#84 - expect(String.raw`''`).toBe(escapeArg("")); - - expect(String.raw`'abc'`).toBe(escapeArg("abc")); + assert.equal(escapeArg(""), String.raw`''`); + assert.equal(escapeArg("abc"), String.raw`'abc'`); function wrap(x: string) { return "'" + x + "'"; } const q = String.raw`'\''`; - expect(wrap(q)).toBe(escapeArg("'")); - expect(wrap(q + q)).toBe(escapeArg("''")); - expect(wrap(q + "abc" + q)).toBe(escapeArg("'abc'")); - expect(wrap(q + "abc")).toBe(escapeArg("'abc")); - expect(wrap("abc" + q)).toBe(escapeArg("abc'")); - expect(wrap("abc" + q + "def")).toBe(escapeArg("abc'def")); - expect(wrap("a" + q + "b" + q + "c")).toBe(escapeArg("a'b'c")); - expect(wrap("a" + q + "bcde" + q + "f")).toBe(escapeArg("a'bcde'f")); + assert.equal(escapeArg("'"), wrap(q)); + assert.equal(escapeArg("''"), wrap(q + q)); + assert.equal(escapeArg("'abc'"), wrap(q + "abc" + q)); + assert.equal(escapeArg("'abc"), wrap(q + "abc")); + assert.equal(escapeArg("abc'"), wrap("abc" + q)); + assert.equal(escapeArg("abc'def"), wrap("abc" + q + "def")); + assert.equal(escapeArg("a'b'c"), wrap("a" + q + "b" + q + "c")); + assert.equal(escapeArg("a'bcde'f"), wrap("a" + q + "bcde" + q + "f")); - expect(String.raw`' abc'`).toBe(escapeArg(" abc")); - expect(String.raw`'"abc'`).toBe(escapeArg('"abc')); - expect(String.raw`'\abc'`).toBe(escapeArg("\\abc")); - expect(String.raw`'(abc'`).toBe(escapeArg("(abc")); - expect(String.raw`')abc'`).toBe(escapeArg(")abc")); + assert.equal(escapeArg(" abc"), String.raw`' abc'`); + assert.equal(escapeArg('"abc'), String.raw`'"abc'`); + assert.equal(escapeArg("\\abc"), String.raw`'\abc'`); + assert.equal(escapeArg("(abc"), String.raw`'(abc'`); + assert.equal(escapeArg(")abc"), String.raw`')abc'`); - expect(String.raw`'abc abc'`).toBe(escapeArg("abc abc")); - expect(String.raw`'abc"abc'`).toBe(escapeArg('abc"abc')); - expect(String.raw`'abc\abc'`).toBe(escapeArg("abc\\abc")); - expect(String.raw`'abc(abc'`).toBe(escapeArg("abc(abc")); - expect(String.raw`'abc)abc'`).toBe(escapeArg("abc)abc")); + assert.equal(escapeArg("abc abc"), String.raw`'abc abc'`); + assert.equal(escapeArg('abc"abc'), String.raw`'abc"abc'`); + assert.equal(escapeArg("abc\\abc"), String.raw`'abc\abc'`); + assert.equal(escapeArg("abc(abc"), String.raw`'abc(abc'`); + assert.equal(escapeArg("abc)abc"), String.raw`'abc)abc'`); - expect(String.raw`'abc '`).toBe(escapeArg("abc ")); - expect(String.raw`'abc"'`).toBe(escapeArg('abc"')); - expect(String.raw`'abc\'`).toBe(escapeArg("abc\\")); - expect(String.raw`'abc('`).toBe(escapeArg("abc(")); - expect(String.raw`'abc)'`).toBe(escapeArg("abc)")); + assert.equal(escapeArg("abc "), String.raw`'abc '`); + assert.equal(escapeArg('abc"'), String.raw`'abc"'`); + assert.equal(escapeArg("abc\\"), String.raw`'abc\'`); + assert.equal(escapeArg("abc("), String.raw`'abc('`); + assert.equal(escapeArg("abc)"), String.raw`'abc)'`); }); }); diff --git a/libraries/adb/src/commands/sync/socket.spec.ts b/libraries/adb/src/commands/sync/socket.spec.ts index cc4775f3..4e343ffc 100644 --- a/libraries/adb/src/commands/sync/socket.spec.ts +++ b/libraries/adb/src/commands/sync/socket.spec.ts @@ -1,4 +1,6 @@ -import { describe, expect, it } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it } from "node:test"; + import { ReadableStream, WritableStream } from "@yume-chan/stream-extra"; import { AdbSyncSocket } from "./socket.js"; @@ -40,7 +42,7 @@ describe("AdbSyncSocket", () => { await Promise.resolve(); } - expect(result).toEqual([1, 2, 3]); + assert.deepStrictEqual(result, [1, 2, 3]); }); }); }); diff --git a/libraries/adb/src/daemon/auth.spec.ts b/libraries/adb/src/daemon/auth.spec.ts index f1e80bc9..7e41a0d7 100644 --- a/libraries/adb/src/daemon/auth.spec.ts +++ b/libraries/adb/src/daemon/auth.spec.ts @@ -1,4 +1,6 @@ -import { describe, expect, it } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it } from "node:test"; + import { EMPTY_UINT8_ARRAY, encodeUtf8 } from "@yume-chan/struct"; import { decodeBase64 } from "../utils/base64.js"; @@ -93,7 +95,7 @@ describe("auth", () => { results.push(result); } - expect(results).toStrictEqual([ + assert.deepStrictEqual(results, [ { command: AdbCommand.Auth, arg0: AdbAuthType.PublicKey, @@ -125,7 +127,7 @@ describe("auth", () => { results.push(result); } - expect(results).toStrictEqual([ + assert.deepStrictEqual(results, [ { command: AdbCommand.Auth, arg0: AdbAuthType.PublicKey, diff --git a/libraries/adb/src/daemon/crypto.spec.ts b/libraries/adb/src/daemon/crypto.spec.ts index 51a966d6..9aff743c 100644 --- a/libraries/adb/src/daemon/crypto.spec.ts +++ b/libraries/adb/src/daemon/crypto.spec.ts @@ -1,4 +1,5 @@ -import { describe, expect, it } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it } from "node:test"; import { decodeBase64 } from "../utils/base64.js"; @@ -7,25 +8,25 @@ import { adbGeneratePublicKey, modInverse } from "./crypto.js"; describe("modInverse", () => { it("should return correct value", () => { // https://github.com/openssl/openssl/blob/98161274636dca12e3bfafab7d2d2ac28f4d7c30/test/bntest.c#L3176 - expect(modInverse(5193817943, 3259122431)).toBe(2609653924); + assert.strictEqual(modInverse(5193817943, 3259122431), 2609653924); // https://cs.android.com/android/platform/superproject/main/+/main:external/cronet/third_party/boringssl/src/crypto/fipsmodule/bn/test/mod_inv_tests.txt - expect(modInverse(0, 1)).toBe(NaN); - expect(modInverse(1, 1)).toBe(NaN); - expect(modInverse(2, 1)).toBe(NaN); - expect(modInverse(3, 1)).toBe(NaN); - expect(modInverse(0x54, 0xe3)).toBe(0x64); - expect(modInverse(0x2b, 0x30)).toBe(0x13); - expect(modInverse(0x30, 0x37)).toBe(0x2f); - expect(modInverse(0x13, 0x4b)).toBe(0x4); - expect(modInverse(0xcd4, 0x6a21)).toBe(0x1c47); - expect(modInverse(0x8e7, 0x49c0)).toBe(0x2b97); - expect(modInverse(0xfcb, 0x3092)).toBe(0x29b9); - expect(modInverse(0x14bf, 0x41ae)).toBe(0xa83); - expect(modInverse(0x11b5d53e, 0x322e92a1)).toBe(0x18f15fe1); - expect(modInverse(0x8af6df6, 0x33d45eb7)).toBe(0x32f9453b); - expect(modInverse(0xc5f89dd5, 0xfc09c17c)).toBe(0xd696369); - expect(modInverse(0x60c2526, 0x74200493)).toBe(0x622839d8); + assert.strictEqual(modInverse(0, 1), NaN); + assert.strictEqual(modInverse(1, 1), NaN); + assert.strictEqual(modInverse(2, 1), NaN); + assert.strictEqual(modInverse(3, 1), NaN); + assert.strictEqual(modInverse(0x54, 0xe3), 0x64); + assert.strictEqual(modInverse(0x2b, 0x30), 0x13); + assert.strictEqual(modInverse(0x30, 0x37), 0x2f); + assert.strictEqual(modInverse(0x13, 0x4b), 0x4); + assert.strictEqual(modInverse(0xcd4, 0x6a21), 0x1c47); + assert.strictEqual(modInverse(0x8e7, 0x49c0), 0x2b97); + assert.strictEqual(modInverse(0xfcb, 0x3092), 0x29b9); + assert.strictEqual(modInverse(0x14bf, 0x41ae), 0xa83); + assert.strictEqual(modInverse(0x11b5d53e, 0x322e92a1), 0x18f15fe1); + assert.strictEqual(modInverse(0x8af6df6, 0x33d45eb7), 0x32f9453b); + assert.strictEqual(modInverse(0xc5f89dd5, 0xfc09c17c), 0xd696369); + assert.strictEqual(modInverse(0x60c2526, 0x74200493), 0x622839d8); }); }); @@ -72,26 +73,32 @@ const PUBLIC_KEY = decodeBase64( describe("adbGeneratePublicKey", () => { it("should return correct value", () => { const generated = adbGeneratePublicKey(PRIVATE_KEY); - expect(generated.subarray(0, 4)).toStrictEqual( + assert.deepStrictEqual( + generated.subarray(0, 4), PUBLIC_KEY.subarray(0, 4), ); - expect(generated.subarray(4, 8)).toStrictEqual( + assert.deepStrictEqual( + generated.subarray(4, 8), PUBLIC_KEY.subarray(4, 8), ); - expect(generated.subarray(8, 264)).toStrictEqual( + assert.deepStrictEqual( + generated.subarray(8, 264), PUBLIC_KEY.subarray(8, 264), ); - expect(generated.subarray(265, 520)).toStrictEqual( + assert.deepStrictEqual( + generated.subarray(265, 520), PUBLIC_KEY.subarray(265, 520), ); - expect(generated.subarray(520, 524)).toStrictEqual( + assert.deepStrictEqual( + generated.subarray(520, 524), PUBLIC_KEY.subarray(520, 524), ); }); it("should throw if output is too small", () => { - expect(() => - adbGeneratePublicKey(PRIVATE_KEY, new Uint8Array(1)), - ).toThrow("output buffer is too small"); + assert.throws( + () => adbGeneratePublicKey(PRIVATE_KEY, new Uint8Array(1)), + /output buffer is too small/, + ); }); }); diff --git a/libraries/adb/src/utils/base64.spec.ts b/libraries/adb/src/utils/base64.spec.ts index 461c80a2..718ffa22 100644 --- a/libraries/adb/src/utils/base64.spec.ts +++ b/libraries/adb/src/utils/base64.spec.ts @@ -1,4 +1,5 @@ -import { describe, expect, it } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it } from "node:test"; import { calculateBase64EncodedLength, @@ -9,13 +10,13 @@ import { describe("base64", () => { describe("calculateBase64EncodedLength", () => { it("should return correct length and padding", () => { - expect(calculateBase64EncodedLength(0)).toEqual([0, 0]); - expect(calculateBase64EncodedLength(1)).toEqual([4, 2]); - expect(calculateBase64EncodedLength(2)).toEqual([4, 1]); - expect(calculateBase64EncodedLength(3)).toEqual([4, 0]); - expect(calculateBase64EncodedLength(4)).toEqual([8, 2]); - expect(calculateBase64EncodedLength(5)).toEqual([8, 1]); - expect(calculateBase64EncodedLength(6)).toEqual([8, 0]); + assert.deepStrictEqual(calculateBase64EncodedLength(0), [0, 0]); + assert.deepStrictEqual(calculateBase64EncodedLength(1), [4, 2]); + assert.deepStrictEqual(calculateBase64EncodedLength(2), [4, 1]); + assert.deepStrictEqual(calculateBase64EncodedLength(3), [4, 0]); + assert.deepStrictEqual(calculateBase64EncodedLength(4), [8, 2]); + assert.deepStrictEqual(calculateBase64EncodedLength(5), [8, 1]); + assert.deepStrictEqual(calculateBase64EncodedLength(6), [8, 0]); }); }); @@ -32,7 +33,8 @@ describe("base64", () => { inputs.forEach((input) => { describe(`input length = ${input.length}`, () => { it("should return correct decoded buffer", () => { - expect(decodeBase64(nodeEncodeBase64(input))).toEqual( + assert.deepStrictEqual( + decodeBase64(nodeEncodeBase64(input)), input, ); }); @@ -77,7 +79,7 @@ describe("base64", () => { describe(`input length = ${input.length}`, () => { it("should return correct encoded buffer", () => { - expect(encodeBase64(input)).toEqual(correct); + assert.deepStrictEqual(encodeBase64(input), correct); }); it("should take `output`", () => { @@ -90,14 +92,16 @@ describe("base64", () => { input, output.subarray(2, 2 + correct.length + 2), ); - expect(outputLength).toEqual(correct.length); - expect(output).toEqual(expectedOutput); + assert.strictEqual(outputLength, correct.length); + assert.deepStrictEqual(output, expectedOutput); }); it("should throw if `output` is too small", () => { if (correct.length !== 0) { const output = new Uint8Array(correct.length - 1); - expect(() => encodeBase64(input, output)).toThrow(); + assert.throws(() => { + encodeBase64(input, output); + }); } }); @@ -184,8 +188,8 @@ describe("base64", () => { ), buffer.subarray(outputOffset), ); - expect(outputLength).toEqual(correct.length); - expect(buffer).toEqual(expectedBuffer); + assert.strictEqual(outputLength, correct.length); + assert.deepStrictEqual(buffer, expectedBuffer); } // Validate with the dumb version of `canEncodeInPlace` above. @@ -203,9 +207,9 @@ describe("base64", () => { it(`should throw with offset = ${ i - 1 }`, () => { - expect(() => - testInPlaceEncodeBase64(i - 1), - ).toThrow(); + assert.throws(() => { + testInPlaceEncodeBase64(i - 1); + }); }); } @@ -230,9 +234,9 @@ describe("base64", () => { last = i; it(`should throw with offset = ${i}`, () => { - expect(() => - testInPlaceEncodeBase64(i), - ).toThrow(); + assert.throws(() => { + testInPlaceEncodeBase64(i); + }); }); } } diff --git a/libraries/adb/tsconfig.json b/libraries/adb/tsconfig.json index 85fc5a7a..d6787a22 100644 --- a/libraries/adb/tsconfig.json +++ b/libraries/adb/tsconfig.json @@ -1,10 +1,10 @@ { "references": [ - { - "path": "./tsconfig.test.json" - }, { "path": "./tsconfig.build.json" }, + { + "path": "./tsconfig.test.json" + } ] } diff --git a/libraries/android-bin/jest.config.js b/libraries/android-bin/jest.config.js deleted file mode 100644 index ff68d1cb..00000000 --- a/libraries/android-bin/jest.config.js +++ /dev/null @@ -1,14 +0,0 @@ -/** @type {import('ts-jest').JestConfigWithTsJest} */ -export default { - preset: "ts-jest/presets/default-esm", - extensionsToTreatAsEsm: [".ts"], - transform: { - "^.+\\.tsx?$": [ - "ts-jest", - { tsconfig: "tsconfig.test.json", useESM: true }, - ], - }, - moduleNameMapper: { - "^(\\.{1,2}/.*)\\.js$": "$1", - }, -}; diff --git a/libraries/android-bin/package.json b/libraries/android-bin/package.json index 0d72344a..e4c333d4 100644 --- a/libraries/android-bin/package.json +++ b/libraries/android-bin/package.json @@ -28,9 +28,9 @@ "scripts": { "build": "tsc -b tsconfig.build.json", "build:watch": "tsc -b tsconfig.build.json", - "test": "cross-env NODE_OPTIONS=\"--experimental-vm-modules --no-warnings\" TS_JEST_DISABLE_VER_CHECKER=true jest --coverage", "lint": "run-eslint && prettier src/**/*.ts --write --tab-width 4", - "prepublishOnly": "npm run build" + "prepublishOnly": "npm run build", + "test": "run-test" }, "dependencies": { "@yume-chan/adb": "workspace:^0.0.24", @@ -38,13 +38,11 @@ "@yume-chan/struct": "workspace:^0.0.24" }, "devDependencies": { - "@jest/globals": "^30.0.0-alpha.4", + "@types/node": "^20.14.9", "@yume-chan/eslint-config": "workspace:^1.0.0", + "@yume-chan/test-runner": "workspace:^1.0.0", "@yume-chan/tsconfig": "workspace:^1.0.0", - "cross-env": "^7.0.3", - "jest": "^30.0.0-alpha.4", "prettier": "^3.3.3", - "ts-jest": "^29.2.2", "typescript": "^5.5.3" } } diff --git a/libraries/android-bin/src/intent.spec.ts b/libraries/android-bin/src/intent.spec.ts index a1788785..79d75cc9 100644 --- a/libraries/android-bin/src/intent.spec.ts +++ b/libraries/android-bin/src/intent.spec.ts @@ -1,47 +1,53 @@ -import { describe, expect, it } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it } from "node:test"; import { IntentBuilder } from "./intent.js"; describe("Intent", () => { describe("IntentBuilder", () => { it("should set intent action", () => { - expect( + assert.deepStrictEqual( new IntentBuilder().setAction("test_action").build(), - ).toEqual(["-a", "test_action"]); + ["-a", "test_action"], + ); }); it("should set intent categories", () => { - expect( + assert.deepStrictEqual( new IntentBuilder() .addCategory("category_1") .addCategory("category_2") .build(), - ).toEqual(["-c", "category_1", "-c", "category_2"]); + ["-c", "category_1", "-c", "category_2"], + ); }); it("should set intent package", () => { - expect(new IntentBuilder().setPackage("package_1").build()).toEqual( + assert.deepStrictEqual( + new IntentBuilder().setPackage("package_1").build(), ["-p", "package_1"], ); }); it("should set intent component", () => { - expect( + assert.deepStrictEqual( new IntentBuilder().setComponent("component_1").build(), - ).toEqual(["-n", "component_1"]); + ["-n", "component_1"], + ); }); it("should set intent data", () => { - expect(new IntentBuilder().setData("data_1").build()).toEqual([ - "-d", - "data_1", - ]); + assert.deepStrictEqual( + new IntentBuilder().setData("data_1").build(), + ["-d", "data_1"], + ); }); it("should pass intent extras", () => { - expect( + assert.deepStrictEqual( new IntentBuilder().addStringExtra("key1", "value1").build(), - ).toEqual(["--es", "key1", "value1"]); + ["--es", "key1", "value1"], + ); }); }); }); diff --git a/libraries/android-bin/src/overlay-display.spec.ts b/libraries/android-bin/src/overlay-display.spec.ts index 8d047e28..ad183b4d 100644 --- a/libraries/android-bin/src/overlay-display.spec.ts +++ b/libraries/android-bin/src/overlay-display.spec.ts @@ -1,4 +1,5 @@ -import { describe, expect, it } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it } from "node:test"; import { OverlayDisplay } from "./overlay-display.js"; @@ -7,112 +8,117 @@ describe("OverlayDisplay", () => { // values are from https://cs.android.com/android/platform/superproject/+/master:frameworks/base/packages/SettingsLib/res/values/arrays.xml;l=468;drc=60c1d392225bc6e1601693c7d5cfdf1d7f510015 it("should parse 0 device", () => { - expect( + assert.deepStrictEqual( OverlayDisplay.SETTING_FORMAT.parse({ value: "", position: 0, }), - ).toEqual([]); + [], + ); }); it("should parse 1 mode", () => { - expect( + assert.deepStrictEqual( OverlayDisplay.SETTING_FORMAT.parse({ value: "720x480/142", position: 0, }), - ).toEqual([ - { - flags: [], - modes: [ - { - density: 142, - height: 480, - width: 720, - }, - ], - }, - ]); + [ + { + flags: [], + modes: [ + { + density: 142, + height: 480, + width: 720, + }, + ], + }, + ], + ); }); it("should parse 2 modes", () => { - expect( + assert.deepStrictEqual( OverlayDisplay.SETTING_FORMAT.parse({ value: "1920x1080/320|3840x2160/640", position: 0, }), - ).toEqual([ - { - flags: [], - modes: [ - { - density: 320, - height: 1080, - width: 1920, - }, - { - density: 640, - height: 2160, - width: 3840, - }, - ], - }, - ]); + [ + { + flags: [], + modes: [ + { + density: 320, + height: 1080, + width: 1920, + }, + { + density: 640, + height: 2160, + width: 3840, + }, + ], + }, + ], + ); }); it("should parse 2 device", () => { - expect( + assert.deepStrictEqual( OverlayDisplay.SETTING_FORMAT.parse({ value: "1280x720/213;1920x1080/320", position: 0, }), - ).toEqual([ - { - flags: [], - modes: [ - { - density: 213, - height: 720, - width: 1280, - }, - ], - }, - { - flags: [], - modes: [ - { - density: 320, - height: 1080, - width: 1920, - }, - ], - }, - ]); + [ + { + flags: [], + modes: [ + { + density: 213, + height: 720, + width: 1280, + }, + ], + }, + { + flags: [], + modes: [ + { + density: 320, + height: 1080, + width: 1920, + }, + ], + }, + ], + ); }); it("should parse flags", () => { - expect( + assert.deepStrictEqual( OverlayDisplay.SETTING_FORMAT.parse({ value: "1920x1080/320|3840x2160/640,secure", position: 0, }), - ).toEqual([ - { - flags: ["secure"], - modes: [ - { - density: 320, - height: 1080, - width: 1920, - }, - { - density: 640, - height: 2160, - width: 3840, - }, - ], - }, - ]); + [ + { + flags: ["secure"], + modes: [ + { + density: 320, + height: 1080, + width: 1920, + }, + { + density: 640, + height: 2160, + width: 3840, + }, + ], + }, + ], + ); }); }); }); diff --git a/libraries/android-bin/src/string-format.spec.ts b/libraries/android-bin/src/string-format.spec.ts index 1268d941..073d4fe2 100644 --- a/libraries/android-bin/src/string-format.spec.ts +++ b/libraries/android-bin/src/string-format.spec.ts @@ -1,4 +1,5 @@ -import { describe, expect, it } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it } from "node:test"; import type { Reader } from "./string-format.js"; import { ParseError, p } from "./string-format.js"; @@ -7,19 +8,19 @@ describe("StringFormat", () => { describe("digits", () => { it("should match 0-9", () => { const reader: Reader = { value: "1234567890", position: 0 }; - expect(p.digits().parse(reader)).toBe(1234567890); + assert.equal(p.digits().parse(reader), 1234567890); }); const digitsError = new ParseError("0123456789".split("")); it("should throw if input is empty", () => { const reader: Reader = { value: "", position: 0 }; - expect(() => p.digits().parse(reader)).toThrow(digitsError); + assert.throws(() => p.digits().parse(reader), digitsError); }); it("should throw error if not 0-9", () => { const reader: Reader = { value: "a", position: 0 }; - expect(() => p.digits().parse(reader)).toThrow(digitsError); + assert.throws(() => p.digits().parse(reader), digitsError); }); }); }); diff --git a/libraries/android-bin/tsconfig.build.json b/libraries/android-bin/tsconfig.build.json index d2afc913..9f83c319 100644 --- a/libraries/android-bin/tsconfig.build.json +++ b/libraries/android-bin/tsconfig.build.json @@ -9,6 +9,6 @@ }, { "path": "../struct/tsconfig.build.json" - }, + } ] } diff --git a/libraries/android-bin/tsconfig.json b/libraries/android-bin/tsconfig.json index 85fc5a7a..d6787a22 100644 --- a/libraries/android-bin/tsconfig.json +++ b/libraries/android-bin/tsconfig.json @@ -1,10 +1,10 @@ { "references": [ - { - "path": "./tsconfig.test.json" - }, { "path": "./tsconfig.build.json" }, + { + "path": "./tsconfig.test.json" + } ] } diff --git a/libraries/android-bin/tsconfig.test.json b/libraries/android-bin/tsconfig.test.json index 57715e3a..70f0e028 100644 --- a/libraries/android-bin/tsconfig.test.json +++ b/libraries/android-bin/tsconfig.test.json @@ -1,7 +1,9 @@ { "extends": "./tsconfig.build.json", "compilerOptions": { - "types": [] + "types": [ + "node" + ] }, "exclude": [] } diff --git a/libraries/aoa/tsconfig.build.json b/libraries/aoa/tsconfig.build.json index 40ecf7fd..9adf7cf8 100644 --- a/libraries/aoa/tsconfig.build.json +++ b/libraries/aoa/tsconfig.build.json @@ -6,7 +6,7 @@ "DOM" ], "types": [ - "w3c-web-usb", + "w3c-web-usb" ] } } diff --git a/libraries/aoa/tsconfig.json b/libraries/aoa/tsconfig.json index 85fc5a7a..d6787a22 100644 --- a/libraries/aoa/tsconfig.json +++ b/libraries/aoa/tsconfig.json @@ -1,10 +1,10 @@ { "references": [ - { - "path": "./tsconfig.test.json" - }, { "path": "./tsconfig.build.json" }, + { + "path": "./tsconfig.test.json" + } ] } diff --git a/libraries/event/jest.config.js b/libraries/event/jest.config.js deleted file mode 100644 index ebdcaf63..00000000 --- a/libraries/event/jest.config.js +++ /dev/null @@ -1,13 +0,0 @@ -/** @type {import('ts-jest').JestConfigWithTsJest} */ -export default { - preset: "ts-jest/presets/default-esm", - transform: { - "\\.tsx?$": [ - "ts-jest", - { tsconfig: "tsconfig.test.json", useESM: true }, - ], - }, - moduleNameMapper: { - "^(\\.{1,2}/.*)\\.js$": "$1", - }, -}; diff --git a/libraries/event/package.json b/libraries/event/package.json index cdb2d417..8702c1ab 100644 --- a/libraries/event/package.json +++ b/libraries/event/package.json @@ -29,21 +29,19 @@ "scripts": { "build": "tsc -b tsconfig.build.json", "build:watch": "tsc -b tsconfig.build.json", - "test": "cross-env NODE_OPTIONS=\"--experimental-vm-modules --no-warnings\" TS_JEST_DISABLE_VER_CHECKER=true jest --coverage", "lint": "run-eslint && prettier src/**/*.ts --write --tab-width 4", - "prepublishOnly": "npm run build" + "prepublishOnly": "npm run build", + "test": "run-test" }, "dependencies": { "@yume-chan/async": "^2.2.0" }, "devDependencies": { - "@jest/globals": "^30.0.0-alpha.4", + "@types/node": "^20.14.9", "@yume-chan/eslint-config": "workspace:^1.0.0", + "@yume-chan/test-runner": "workspace:^1.0.0", "@yume-chan/tsconfig": "workspace:^1.0.0", - "cross-env": "^7.0.3", - "jest": "^30.0.0-alpha.4", "prettier": "^3.3.3", - "ts-jest": "^29.2.2", "typescript": "^5.5.3" } } diff --git a/libraries/event/src/disposable.spec.ts b/libraries/event/src/disposable.spec.ts index 96b23df3..ac9ab554 100644 --- a/libraries/event/src/disposable.spec.ts +++ b/libraries/event/src/disposable.spec.ts @@ -1,4 +1,5 @@ -import { describe, expect, it, jest } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it, mock } from "node:test"; import type { Disposable } from "./disposable.js"; import { AutoDisposable } from "./disposable.js"; @@ -7,7 +8,7 @@ describe("Event", () => { describe("AutoDisposable", () => { it("should dispose its dependencies", () => { const myDisposable = { - dispose: jest.fn(), + dispose: mock.fn(), }; class MyAutoDisposable extends AutoDisposable { constructor(disposable: Disposable) { @@ -18,7 +19,7 @@ describe("Event", () => { const myAutoDisposable = new MyAutoDisposable(myDisposable); myAutoDisposable.dispose(); - expect(myDisposable.dispose).toHaveBeenCalledTimes(1); + assert.strictEqual(myDisposable.dispose.mock.callCount(), 1); }); }); }); diff --git a/libraries/event/tsconfig.json b/libraries/event/tsconfig.json index 85fc5a7a..d6787a22 100644 --- a/libraries/event/tsconfig.json +++ b/libraries/event/tsconfig.json @@ -1,10 +1,10 @@ { "references": [ - { - "path": "./tsconfig.test.json" - }, { "path": "./tsconfig.build.json" }, + { + "path": "./tsconfig.test.json" + } ] } diff --git a/libraries/event/tsconfig.test.json b/libraries/event/tsconfig.test.json index a151e3c4..6a105912 100644 --- a/libraries/event/tsconfig.test.json +++ b/libraries/event/tsconfig.test.json @@ -1,7 +1,9 @@ { "extends": "./tsconfig.build.json", "compilerOptions": { - "types": [], + "types": [ + "node" + ], }, "exclude": [] } diff --git a/libraries/no-data-view/jest.config.js b/libraries/no-data-view/jest.config.js deleted file mode 100644 index ff68d1cb..00000000 --- a/libraries/no-data-view/jest.config.js +++ /dev/null @@ -1,14 +0,0 @@ -/** @type {import('ts-jest').JestConfigWithTsJest} */ -export default { - preset: "ts-jest/presets/default-esm", - extensionsToTreatAsEsm: [".ts"], - transform: { - "^.+\\.tsx?$": [ - "ts-jest", - { tsconfig: "tsconfig.test.json", useESM: true }, - ], - }, - moduleNameMapper: { - "^(\\.{1,2}/.*)\\.js$": "$1", - }, -}; diff --git a/libraries/no-data-view/package.json b/libraries/no-data-view/package.json index 668dfa7b..5818444a 100644 --- a/libraries/no-data-view/package.json +++ b/libraries/no-data-view/package.json @@ -26,20 +26,17 @@ "benchmark": "node benchmark.js", "build": "tsc -b tsconfig.build.json", "build:watch": "tsc -b tsconfig.build.json", - "test": "cross-env NODE_OPTIONS=\"--experimental-vm-modules --no-warnings\" TS_JEST_DISABLE_VER_CHECKER=true jest --coverage", "lint": "run-eslint && prettier src/**/*.ts --write --tab-width 4", - "prepublishOnly": "npm run build" + "prepublishOnly": "npm run build", + "test": "run-test" }, "devDependencies": { - "@jest/globals": "^30.0.0-alpha.4", "@types/node": "^20.14.9", "@yume-chan/eslint-config": "workspace:^1.0.0", + "@yume-chan/test-runner": "workspace:^1.0.0", "@yume-chan/tsconfig": "workspace:^1.0.0", - "cross-env": "^7.0.3", - "jest": "^30.0.0-alpha.4", "prettier": "^3.3.3", "tinybench": "^2.8.0", - "ts-jest": "^29.2.2", "typescript": "^5.5.3" } } diff --git a/libraries/no-data-view/src/int16.spec.ts b/libraries/no-data-view/src/int16.spec.ts index 47593a7a..c9caa226 100644 --- a/libraries/no-data-view/src/int16.spec.ts +++ b/libraries/no-data-view/src/int16.spec.ts @@ -1,4 +1,5 @@ -import { describe, expect, it } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it } from "node:test"; import { getInt16, @@ -13,28 +14,32 @@ describe("getInt16", () => { describe("little endian", () => { it("should work for minimal value", () => { const array = new Uint8Array([0, 128]); - expect(getInt16LittleEndian(array, 0)).toBe( + assert.strictEqual( + getInt16LittleEndian(array, 0), new DataView(array.buffer).getInt16(0, true), ); }); it("should work for maximal value", () => { const array = new Uint8Array([255, 127]); - expect(getInt16LittleEndian(array, 0)).toBe( + assert.strictEqual( + getInt16LittleEndian(array, 0), new DataView(array.buffer).getInt16(0, true), ); }); it("should work for middle value", () => { const array = new Uint8Array([0, 0]); - expect(getInt16LittleEndian(array, 0)).toBe( + assert.strictEqual( + getInt16LittleEndian(array, 0), new DataView(array.buffer).getInt16(0, true), ); }); it("should work for random value", () => { const array = new Uint8Array([1, 2]); - expect(getInt16LittleEndian(array, 0)).toBe( + assert.strictEqual( + getInt16LittleEndian(array, 0), new DataView(array.buffer).getUint16(0, true), ); }); @@ -43,28 +48,32 @@ describe("getInt16", () => { describe("big endian", () => { it("should work for minimal value", () => { const array = new Uint8Array([128, 0]); - expect(getInt16BigEndian(array, 0)).toBe( + assert.strictEqual( + getInt16BigEndian(array, 0), new DataView(array.buffer).getInt16(0, false), ); }); it("should work for maximal value", () => { const array = new Uint8Array([127, 255]); - expect(getInt16BigEndian(array, 0)).toBe( + assert.strictEqual( + getInt16BigEndian(array, 0), new DataView(array.buffer).getInt16(0, false), ); }); it("should work for middle value", () => { const array = new Uint8Array([0, 0]); - expect(getInt16BigEndian(array, 0)).toBe( + assert.strictEqual( + getInt16BigEndian(array, 0), new DataView(array.buffer).getInt16(0, false), ); }); it("should work for random value", () => { const array = new Uint8Array([1, 2]); - expect(getInt16BigEndian(array, 0)).toBe( + assert.strictEqual( + getInt16BigEndian(array, 0), new DataView(array.buffer).getUint16(0, false), ); }); @@ -72,10 +81,12 @@ describe("getInt16", () => { it("should work for selected endianness", () => { const array = new Uint8Array([1, 2]); - expect(getInt16(array, 0, false)).toBe( + assert.strictEqual( + getInt16(array, 0, false), new DataView(array.buffer).getInt16(0, false), ); - expect(getInt16(array, 0, true)).toBe( + assert.strictEqual( + getInt16(array, 0, true), new DataView(array.buffer).getInt16(0, true), ); }); @@ -88,7 +99,7 @@ describe("setInt16", () => { new DataView(expected.buffer).setInt16(0, -0x8000, true); const actual = new Uint8Array(2); setInt16LittleEndian(actual, 0, -0x8000); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); }); it("should work for maximal value", () => { @@ -96,7 +107,7 @@ describe("setInt16", () => { new DataView(expected.buffer).setInt16(0, 0x7fff, true); const actual = new Uint8Array(2); setInt16LittleEndian(actual, 0, 0x7fff); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); }); it("should work for middle value", () => { @@ -104,7 +115,7 @@ describe("setInt16", () => { new DataView(expected.buffer).setInt16(0, 0, true); const actual = new Uint8Array(2); setInt16LittleEndian(actual, 0, 0); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); }); }); @@ -114,7 +125,7 @@ describe("setInt16", () => { new DataView(expected.buffer).setInt16(0, -0x8000, false); const actual = new Uint8Array(2); setInt16BigEndian(actual, 0, -0x8000); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); }); it("should work for maximal value", () => { @@ -122,7 +133,7 @@ describe("setInt16", () => { new DataView(expected.buffer).setInt16(0, 0x7fff, false); const actual = new Uint8Array(2); setInt16BigEndian(actual, 0, 0x7fff); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); }); it("should work for middle value", () => { @@ -130,7 +141,7 @@ describe("setInt16", () => { new DataView(expected.buffer).setInt16(0, 0, false); const actual = new Uint8Array(2); setInt16BigEndian(actual, 0, 0); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); }); }); @@ -140,10 +151,10 @@ describe("setInt16", () => { new DataView(expected.buffer).setInt16(0, 0x7fff, false); setInt16(actual, 0, 0x7fff, false); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); new DataView(expected.buffer).setInt16(0, 0x7fff, true); setInt16(actual, 0, 0x7fff, true); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); }); }); diff --git a/libraries/no-data-view/src/int32.spec.ts b/libraries/no-data-view/src/int32.spec.ts index b2f36358..f8aa5290 100644 --- a/libraries/no-data-view/src/int32.spec.ts +++ b/libraries/no-data-view/src/int32.spec.ts @@ -1,4 +1,5 @@ -import { describe, expect, it } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it } from "node:test"; import { getInt32, @@ -13,28 +14,32 @@ describe("getInt32", () => { describe("little endian", () => { it("should work for minimal value", () => { const array = new Uint8Array([0, 0, 0, 128]); - expect(getInt32LittleEndian(array, 0)).toBe( + assert.strictEqual( + getInt32LittleEndian(array, 0), new DataView(array.buffer).getInt32(0, true), ); }); it("should work for maximal value", () => { const array = new Uint8Array([255, 255, 255, 127]); - expect(getInt32LittleEndian(array, 0)).toBe( + assert.strictEqual( + getInt32LittleEndian(array, 0), new DataView(array.buffer).getInt32(0, true), ); }); it("should work for middle value", () => { const array = new Uint8Array([0, 0, 0, 0]); - expect(getInt32LittleEndian(array, 0)).toBe( + assert.strictEqual( + getInt32LittleEndian(array, 0), new DataView(array.buffer).getInt32(0, true), ); }); it("should work for random value", () => { const array = new Uint8Array([1, 2, 3, 4]); - expect(getInt32LittleEndian(array, 0)).toBe( + assert.strictEqual( + getInt32LittleEndian(array, 0), new DataView(array.buffer).getInt32(0, true), ); }); @@ -43,28 +48,32 @@ describe("getInt32", () => { describe("big endian", () => { it("should work for minimal value", () => { const array = new Uint8Array([128, 0, 0, 0]); - expect(getInt32BigEndian(array, 0)).toBe( + assert.strictEqual( + getInt32BigEndian(array, 0), new DataView(array.buffer).getInt32(0, false), ); }); it("should work for maximal value", () => { const array = new Uint8Array([127, 255, 255, 255]); - expect(getInt32BigEndian(array, 0)).toBe( + assert.strictEqual( + getInt32BigEndian(array, 0), new DataView(array.buffer).getInt32(0, false), ); }); it("should work for middle value", () => { const array = new Uint8Array([0, 0, 0, 0]); - expect(getInt32BigEndian(array, 0)).toBe( + assert.strictEqual( + getInt32BigEndian(array, 0), new DataView(array.buffer).getInt32(0, false), ); }); it("should work for random value", () => { const array = new Uint8Array([1, 2, 3, 4]); - expect(getInt32BigEndian(array, 0)).toBe( + assert.strictEqual( + getInt32BigEndian(array, 0), new DataView(array.buffer).getInt32(0, false), ); }); @@ -72,10 +81,12 @@ describe("getInt32", () => { it("should work for selected endianness", () => { const array = new Uint8Array([1, 2, 3, 4]); - expect(getInt32(array, 0, false)).toBe( + assert.strictEqual( + getInt32(array, 0, false), new DataView(array.buffer).getInt32(0, false), ); - expect(getInt32(array, 0, true)).toBe( + assert.strictEqual( + getInt32(array, 0, true), new DataView(array.buffer).getInt32(0, true), ); }); @@ -88,7 +99,7 @@ describe("setInt32", () => { new DataView(expected.buffer).setInt32(0, -0x80000000, true); const actual = new Uint8Array(4); setInt32LittleEndian(actual, 0, -0x80000000); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); }); it("should work for maximal value", () => { @@ -96,7 +107,7 @@ describe("setInt32", () => { new DataView(expected.buffer).setInt32(0, 0x7fffffff, true); const actual = new Uint8Array(4); setInt32LittleEndian(actual, 0, 0x7fffffff); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); }); it("should work for middle value", () => { @@ -104,7 +115,7 @@ describe("setInt32", () => { new DataView(expected.buffer).setInt32(0, 0, true); const actual = new Uint8Array(4); setInt32LittleEndian(actual, 0, 0); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); }); }); @@ -114,7 +125,7 @@ describe("setInt32", () => { new DataView(expected.buffer).setInt32(0, -0x80000000, false); const actual = new Uint8Array(4); setInt32BigEndian(actual, 0, -0x80000000); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); }); it("should work for maximal value", () => { @@ -122,7 +133,7 @@ describe("setInt32", () => { new DataView(expected.buffer).setInt32(0, 0x7fffffff, false); const actual = new Uint8Array(4); setInt32BigEndian(actual, 0, 0x7fffffff); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); }); it("should work for middle value", () => { @@ -130,7 +141,7 @@ describe("setInt32", () => { new DataView(expected.buffer).setInt32(0, 0, false); const actual = new Uint8Array(4); setInt32BigEndian(actual, 0, 0); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); }); }); @@ -140,10 +151,10 @@ describe("setInt32", () => { new DataView(expected.buffer).setInt32(0, 0x7fffffff, false); setInt32(actual, 0, 0x7fffffff, false); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); new DataView(expected.buffer).setInt32(0, 0x7fffffff, true); setInt32(actual, 0, 0x7fffffff, true); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); }); }); diff --git a/libraries/no-data-view/src/int64.spec.ts b/libraries/no-data-view/src/int64.spec.ts index 6742cbb1..39e26ce7 100644 --- a/libraries/no-data-view/src/int64.spec.ts +++ b/libraries/no-data-view/src/int64.spec.ts @@ -1,4 +1,5 @@ -import { describe, expect, it } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it } from "node:test"; import { getInt64, @@ -13,7 +14,8 @@ describe("getInt64", () => { describe("little endian", () => { it("should work for minimal value", () => { const array = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0x80]); - expect(getInt64LittleEndian(array, 0)).toBe( + assert.strictEqual( + getInt64LittleEndian(array, 0), new DataView(array.buffer).getBigInt64(0, true), ); }); @@ -22,14 +24,16 @@ describe("getInt64", () => { const array = new Uint8Array([ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, ]); - expect(getInt64LittleEndian(array, 0)).toBe( + assert.strictEqual( + getInt64LittleEndian(array, 0), new DataView(array.buffer).getBigInt64(0, true), ); }); it("should work for middle value", () => { const array = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0]); - expect(getInt64LittleEndian(array, 0)).toBe( + assert.strictEqual( + getInt64LittleEndian(array, 0), new DataView(array.buffer).getBigInt64(0, true), ); }); @@ -38,7 +42,8 @@ describe("getInt64", () => { const array = new Uint8Array([ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, ]); - expect(getInt64LittleEndian(array, 0)).toBe( + assert.strictEqual( + getInt64LittleEndian(array, 0), new DataView(array.buffer).getBigInt64(0, true), ); }); @@ -47,7 +52,8 @@ describe("getInt64", () => { describe("big endian", () => { it("should work for minimal value", () => { const array = new Uint8Array([0x80, 0, 0, 0, 0, 0, 0, 0]); - expect(getInt64BigEndian(array, 0)).toBe( + assert.strictEqual( + getInt64BigEndian(array, 0), new DataView(array.buffer).getBigInt64(0, false), ); }); @@ -56,14 +62,16 @@ describe("getInt64", () => { const array = new Uint8Array([ 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, ]); - expect(getInt64BigEndian(array, 0)).toBe( + assert.strictEqual( + getInt64BigEndian(array, 0), new DataView(array.buffer).getBigInt64(0, false), ); }); it("should work for middle value", () => { const array = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0]); - expect(getInt64BigEndian(array, 0)).toBe( + assert.strictEqual( + getInt64BigEndian(array, 0), new DataView(array.buffer).getBigInt64(0, false), ); }); @@ -72,7 +80,8 @@ describe("getInt64", () => { const array = new Uint8Array([ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, ]); - expect(getInt64BigEndian(array, 0)).toBe( + assert.strictEqual( + getInt64BigEndian(array, 0), new DataView(array.buffer).getBigInt64(0, false), ); }); @@ -80,10 +89,12 @@ describe("getInt64", () => { it("should work for selected endianness", () => { const array = new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8]); - expect(getInt64(array, 0, false)).toBe( + assert.strictEqual( + getInt64(array, 0, false), new DataView(array.buffer).getBigInt64(0, false), ); - expect(getInt64(array, 0, true)).toBe( + assert.strictEqual( + getInt64(array, 0, true), new DataView(array.buffer).getBigInt64(0, true), ); }); @@ -100,7 +111,7 @@ describe("setInt64", () => { ); const actual = new Uint8Array(8); setInt64LittleEndian(actual, 0, -0x8000_0000_0000_0000n); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); }); it("should work for maximal value", () => { @@ -112,7 +123,7 @@ describe("setInt64", () => { ); const actual = new Uint8Array(8); setInt64LittleEndian(actual, 0, 0x7fff_ffff_ffff_ffffn); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); }); it("should work for middle value", () => { @@ -124,7 +135,7 @@ describe("setInt64", () => { ); const actual = new Uint8Array(8); setInt64LittleEndian(actual, 0, 0xedcb_a987_6543_2100n); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); }); it("should work for super-large value", () => { @@ -133,7 +144,7 @@ describe("setInt64", () => { new DataView(expected.buffer).setBigInt64(0, value, true); const actual = new Uint8Array(8); setInt64LittleEndian(actual, 0, value); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); }); }); @@ -147,7 +158,7 @@ describe("setInt64", () => { ); const actual = new Uint8Array(8); setInt64BigEndian(actual, 0, -0x8000_0000_0000_0000n); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); }); it("should work for maximal value", () => { @@ -159,7 +170,7 @@ describe("setInt64", () => { ); const actual = new Uint8Array(8); setInt64BigEndian(actual, 0, 0x7fff_ffff_ffff_ffffn); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); }); it("should work for middle value", () => { @@ -171,7 +182,7 @@ describe("setInt64", () => { ); const actual = new Uint8Array(8); setInt64BigEndian(actual, 0, 0xedcb_a987_6543_2100n); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); }); it("should work for super-large value", () => { @@ -180,7 +191,7 @@ describe("setInt64", () => { new DataView(expected.buffer).setBigInt64(0, value, false); const actual = new Uint8Array(8); setInt64BigEndian(actual, 0, value); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); }); }); @@ -194,7 +205,7 @@ describe("setInt64", () => { false, ); setInt64(actual, 0, 0x7fff_ffff_ffff_ffffn, false); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); new DataView(expected.buffer).setBigInt64( 0, @@ -202,6 +213,6 @@ describe("setInt64", () => { true, ); setInt64(actual, 0, 0x7fff_ffff_ffff_ffffn, true); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); }); }); diff --git a/libraries/no-data-view/src/int8.spec.ts b/libraries/no-data-view/src/int8.spec.ts index 92681047..ea425698 100644 --- a/libraries/no-data-view/src/int8.spec.ts +++ b/libraries/no-data-view/src/int8.spec.ts @@ -1,20 +1,30 @@ -import { describe, expect, it } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it } from "node:test"; import { getInt8 } from "./int8.js"; describe("getInt8", () => { it("should work for minimal value", () => { const array = new Uint8Array([0x80]); - expect(getInt8(array, 0)).toBe(new DataView(array.buffer).getInt8(0)); + assert.strictEqual( + getInt8(array, 0), + new DataView(array.buffer).getInt8(0), + ); }); it("should work for maximal value", () => { const array = new Uint8Array([0x7f]); - expect(getInt8(array, 0)).toBe(new DataView(array.buffer).getInt8(0)); + assert.strictEqual( + getInt8(array, 0), + new DataView(array.buffer).getInt8(0), + ); }); it("should work for middle value", () => { const array = new Uint8Array([0]); - expect(getInt8(array, 0)).toBe(new DataView(array.buffer).getInt8(0)); + assert.strictEqual( + getInt8(array, 0), + new DataView(array.buffer).getInt8(0), + ); }); }); diff --git a/libraries/no-data-view/src/uint16.spec.ts b/libraries/no-data-view/src/uint16.spec.ts index e6a16923..85ec6cd4 100644 --- a/libraries/no-data-view/src/uint16.spec.ts +++ b/libraries/no-data-view/src/uint16.spec.ts @@ -1,4 +1,5 @@ -import { describe, expect, it } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it } from "node:test"; import { getUint16, @@ -13,28 +14,32 @@ describe("getUint16", () => { describe("little endian", () => { it("should work for minimal value", () => { const array = new Uint8Array([0, 0]); - expect(getUint16LittleEndian(array, 0)).toBe( + assert.strictEqual( + getUint16LittleEndian(array, 0), new DataView(array.buffer).getUint16(0, true), ); }); it("should work for maximal value", () => { const array = new Uint8Array([255, 255]); - expect(getUint16LittleEndian(array, 0)).toBe( + assert.strictEqual( + getUint16LittleEndian(array, 0), new DataView(array.buffer).getUint16(0, true), ); }); it("should work for middle value", () => { const array = new Uint8Array([0, 128]); - expect(getUint16LittleEndian(array, 0)).toBe( + assert.strictEqual( + getUint16LittleEndian(array, 0), new DataView(array.buffer).getUint16(0, true), ); }); it("should work for random value", () => { const array = new Uint8Array([1, 2]); - expect(getUint16LittleEndian(array, 0)).toBe( + assert.strictEqual( + getUint16LittleEndian(array, 0), new DataView(array.buffer).getUint16(0, true), ); }); @@ -43,28 +48,32 @@ describe("getUint16", () => { describe("big endian", () => { it("should work for minimal value", () => { const array = new Uint8Array([0, 0]); - expect(getUint16BigEndian(array, 0)).toBe( + assert.strictEqual( + getUint16BigEndian(array, 0), new DataView(array.buffer).getUint16(0, false), ); }); it("should work for maximal value", () => { const array = new Uint8Array([255, 255]); - expect(getUint16BigEndian(array, 0)).toBe( + assert.strictEqual( + getUint16BigEndian(array, 0), new DataView(array.buffer).getUint16(0, false), ); }); it("should work for middle value", () => { const array = new Uint8Array([128, 255]); - expect(getUint16BigEndian(array, 0)).toBe( + assert.strictEqual( + getUint16BigEndian(array, 0), new DataView(array.buffer).getUint16(0, false), ); }); it("should work for random value", () => { const array = new Uint8Array([1, 2]); - expect(getUint16BigEndian(array, 0)).toBe( + assert.strictEqual( + getUint16BigEndian(array, 0), new DataView(array.buffer).getUint16(0, false), ); }); @@ -72,10 +81,12 @@ describe("getUint16", () => { it("should work for selected endianness", () => { const array = new Uint8Array([1, 2]); - expect(getUint16(array, 0, false)).toBe( + assert.strictEqual( + getUint16(array, 0, false), new DataView(array.buffer).getUint16(0, false), ); - expect(getUint16(array, 0, true)).toBe( + assert.strictEqual( + getUint16(array, 0, true), new DataView(array.buffer).getUint16(0, true), ); }); @@ -88,7 +99,7 @@ describe("setUint16", () => { new DataView(expected.buffer).setUint16(0, 0, true); const actual = new Uint8Array(2); setUint16LittleEndian(actual, 0, 0); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); }); it("should work for maximal value", () => { @@ -96,7 +107,7 @@ describe("setUint16", () => { new DataView(expected.buffer).setUint16(0, 0xffff, true); const actual = new Uint8Array(2); setUint16LittleEndian(actual, 0, 0xffff); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); }); it("should work for middle value", () => { @@ -104,7 +115,7 @@ describe("setUint16", () => { new DataView(expected.buffer).setUint16(0, 0x8000, true); const actual = new Uint8Array(2); setUint16LittleEndian(actual, 0, 0x8000); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); }); }); @@ -114,7 +125,7 @@ describe("setUint16", () => { new DataView(expected.buffer).setUint16(0, 0, false); const actual = new Uint8Array(2); setUint16BigEndian(actual, 0, 0); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); }); it("should work for maximal value", () => { @@ -122,7 +133,7 @@ describe("setUint16", () => { new DataView(expected.buffer).setUint16(0, 0xffff, false); const actual = new Uint8Array(2); setUint16BigEndian(actual, 0, 0xffff); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); }); it("should work for middle value", () => { @@ -130,7 +141,7 @@ describe("setUint16", () => { new DataView(expected.buffer).setUint16(0, 0x8000, false); const actual = new Uint8Array(2); setUint16BigEndian(actual, 0, 0x8000); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); }); }); @@ -140,10 +151,10 @@ describe("setUint16", () => { new DataView(expected.buffer).setUint16(0, 0xffff, false); setUint16(actual, 0, 0xffff, false); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); new DataView(expected.buffer).setUint16(0, 0xffff, true); setUint16(actual, 0, 0xffff, true); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); }); }); diff --git a/libraries/no-data-view/src/uint32.spec.ts b/libraries/no-data-view/src/uint32.spec.ts index 9604dbe2..0fb25d30 100644 --- a/libraries/no-data-view/src/uint32.spec.ts +++ b/libraries/no-data-view/src/uint32.spec.ts @@ -1,4 +1,5 @@ -import { describe, expect, it } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it } from "node:test"; import { getUint32, @@ -13,28 +14,32 @@ describe("getUint32", () => { describe("little endian", () => { it("should work for minimal value", () => { const array = new Uint8Array([0, 0, 0, 0]); - expect(getUint32LittleEndian(array, 0)).toBe( + assert.strictEqual( + getUint32LittleEndian(array, 0), new DataView(array.buffer).getUint32(0, true), ); }); it("should work for maximal value", () => { const array = new Uint8Array([255, 255, 255, 255]); - expect(getUint32LittleEndian(array, 0)).toBe( + assert.strictEqual( + getUint32LittleEndian(array, 0), new DataView(array.buffer).getUint32(0, true), ); }); it("should work for middle value", () => { const array = new Uint8Array([0, 0, 0, 128]); - expect(getUint32LittleEndian(array, 0)).toBe( + assert.strictEqual( + getUint32LittleEndian(array, 0), new DataView(array.buffer).getUint32(0, true), ); }); it("should work for random value", () => { const array = new Uint8Array([1, 2, 3, 4]); - expect(getUint32LittleEndian(array, 0)).toBe( + assert.strictEqual( + getUint32LittleEndian(array, 0), new DataView(array.buffer).getUint32(0, true), ); }); @@ -43,28 +48,32 @@ describe("getUint32", () => { describe("big endian", () => { it("should work for minimal value", () => { const array = new Uint8Array([0, 0, 0, 0]); - expect(getUint32BigEndian(array, 0)).toBe( + assert.strictEqual( + getUint32BigEndian(array, 0), new DataView(array.buffer).getUint32(0, false), ); }); it("should work for maximal value", () => { const array = new Uint8Array([255, 255, 255, 255]); - expect(getUint32BigEndian(array, 0)).toBe( + assert.strictEqual( + getUint32BigEndian(array, 0), new DataView(array.buffer).getUint32(0, false), ); }); it("should work for middle value", () => { const array = new Uint8Array([128, 0, 0, 0]); - expect(getUint32BigEndian(array, 0)).toBe( + assert.strictEqual( + getUint32BigEndian(array, 0), new DataView(array.buffer).getUint32(0, false), ); }); it("should work for random value", () => { const array = new Uint8Array([1, 2, 3, 4]); - expect(getUint32BigEndian(array, 0)).toBe( + assert.strictEqual( + getUint32BigEndian(array, 0), new DataView(array.buffer).getUint32(0, false), ); }); @@ -72,10 +81,12 @@ describe("getUint32", () => { it("should work for selected endianness", () => { const array = new Uint8Array([1, 2, 3, 4]); - expect(getUint32(array, 0, false)).toBe( + assert.strictEqual( + getUint32(array, 0, false), new DataView(array.buffer).getUint32(0, false), ); - expect(getUint32(array, 0, true)).toBe( + assert.strictEqual( + getUint32(array, 0, true), new DataView(array.buffer).getUint32(0, true), ); }); @@ -88,7 +99,7 @@ describe("setUint32", () => { new DataView(expected.buffer).setUint32(0, 0, true); const actual = new Uint8Array(4); setUint32LittleEndian(actual, 0, 0); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); }); it("should work for maximal value", () => { @@ -96,7 +107,7 @@ describe("setUint32", () => { new DataView(expected.buffer).setUint32(0, 0xffff_ffff, true); const actual = new Uint8Array(4); setUint32LittleEndian(actual, 0, 0xffff_ffff); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); }); it("should work for middle value", () => { @@ -104,7 +115,7 @@ describe("setUint32", () => { new DataView(expected.buffer).setUint32(0, 0x8000_0000, true); const actual = new Uint8Array(4); setUint32LittleEndian(actual, 0, 0x8000_0000); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); }); }); @@ -114,7 +125,7 @@ describe("setUint32", () => { new DataView(expected.buffer).setUint32(0, 0, false); const actual = new Uint8Array(4); setUint32BigEndian(actual, 0, 0); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); }); it("should work for maximal value", () => { @@ -122,7 +133,7 @@ describe("setUint32", () => { new DataView(expected.buffer).setUint32(0, 0xffff_ffff, false); const actual = new Uint8Array(4); setUint32BigEndian(actual, 0, 0xffff_ffff); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); }); it("should work for middle value", () => { @@ -130,7 +141,7 @@ describe("setUint32", () => { new DataView(expected.buffer).setUint32(0, 0x8000_0000, false); const actual = new Uint8Array(4); setUint32BigEndian(actual, 0, 0x8000_0000); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); }); }); @@ -140,10 +151,10 @@ describe("setUint32", () => { new DataView(expected.buffer).setUint32(0, 0xffff_ffff, false); setUint32(actual, 0, 0xffff_ffff, false); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); new DataView(expected.buffer).setUint32(0, 0xffff_ffff, true); setUint32(actual, 0, 0xffff_ffff, true); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); }); }); diff --git a/libraries/no-data-view/src/uint64.spec.ts b/libraries/no-data-view/src/uint64.spec.ts index 7566d7bf..539f100e 100644 --- a/libraries/no-data-view/src/uint64.spec.ts +++ b/libraries/no-data-view/src/uint64.spec.ts @@ -1,4 +1,5 @@ -import { describe, expect, it } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it } from "node:test"; import { getUint64, @@ -13,7 +14,8 @@ describe("getUint64", () => { describe("little endian", () => { it("should work for minimal value", () => { const array = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0]); - expect(getUint64LittleEndian(array, 0)).toBe( + assert.strictEqual( + getUint64LittleEndian(array, 0), new DataView(array.buffer).getBigUint64(0, true), ); }); @@ -22,14 +24,16 @@ describe("getUint64", () => { const array = new Uint8Array([ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, ]); - expect(getUint64LittleEndian(array, 0)).toBe( + assert.strictEqual( + getUint64LittleEndian(array, 0), new DataView(array.buffer).getBigUint64(0, true), ); }); it("should work for middle value", () => { const array = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0x80]); - expect(getUint64LittleEndian(array, 0)).toBe( + assert.strictEqual( + getUint64LittleEndian(array, 0), new DataView(array.buffer).getBigUint64(0, true), ); }); @@ -38,7 +42,8 @@ describe("getUint64", () => { const array = new Uint8Array([ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, ]); - expect(getUint64LittleEndian(array, 0)).toBe( + assert.strictEqual( + getUint64LittleEndian(array, 0), new DataView(array.buffer).getBigUint64(0, true), ); }); @@ -47,7 +52,8 @@ describe("getUint64", () => { describe("big endian", () => { it("should work for minimal value", () => { const array = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0]); - expect(getUint64BigEndian(array, 0)).toBe( + assert.strictEqual( + getUint64BigEndian(array, 0), new DataView(array.buffer).getBigUint64(0, false), ); }); @@ -56,14 +62,16 @@ describe("getUint64", () => { const array = new Uint8Array([ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, ]); - expect(getUint64BigEndian(array, 0)).toBe( + assert.strictEqual( + getUint64BigEndian(array, 0), new DataView(array.buffer).getBigUint64(0, false), ); }); it("should work for middle value", () => { const array = new Uint8Array([0x80, 0, 0, 0, 0, 0, 0, 0]); - expect(getUint64BigEndian(array, 0)).toBe( + assert.strictEqual( + getUint64BigEndian(array, 0), new DataView(array.buffer).getBigUint64(0, false), ); }); @@ -72,7 +80,8 @@ describe("getUint64", () => { const array = new Uint8Array([ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, ]); - expect(getUint64BigEndian(array, 0)).toBe( + assert.strictEqual( + getUint64BigEndian(array, 0), new DataView(array.buffer).getBigUint64(0, false), ); }); @@ -80,10 +89,12 @@ describe("getUint64", () => { it("should work for selected endianness", () => { const array = new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8]); - expect(getUint64(array, 0, false)).toBe( + assert.strictEqual( + getUint64(array, 0, false), new DataView(array.buffer).getBigUint64(0, false), ); - expect(getUint64(array, 0, true)).toBe( + assert.strictEqual( + getUint64(array, 0, true), new DataView(array.buffer).getBigUint64(0, true), ); }); @@ -96,7 +107,7 @@ describe("setUint64", () => { new DataView(expected.buffer).setBigUint64(0, 0n, true); const actual = new Uint8Array(8); setUint64LittleEndian(actual, 0, 0n); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); }); it("should work for maximal value", () => { @@ -108,7 +119,7 @@ describe("setUint64", () => { ); const actual = new Uint8Array(8); setUint64LittleEndian(actual, 0, 0xffff_ffff_ffff_ffffn); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); }); it("should work for middle value", () => { @@ -120,7 +131,7 @@ describe("setUint64", () => { ); const actual = new Uint8Array(8); setUint64LittleEndian(actual, 0, 0x8000_0000_0000_0000n); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); }); }); @@ -130,7 +141,7 @@ describe("setUint64", () => { new DataView(expected.buffer).setBigUint64(0, 0n, false); const actual = new Uint8Array(8); setUint64BigEndian(actual, 0, 0n); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); }); it("should work for maximal value", () => { @@ -142,7 +153,7 @@ describe("setUint64", () => { ); const actual = new Uint8Array(8); setUint64BigEndian(actual, 0, 0xffff_ffff_ffff_ffffn); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); }); it("should work for middle value", () => { @@ -154,7 +165,7 @@ describe("setUint64", () => { ); const actual = new Uint8Array(8); setUint64BigEndian(actual, 0, 0x8000_0000_0000_0000n); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); }); }); @@ -168,7 +179,7 @@ describe("setUint64", () => { false, ); setUint64(actual, 0, 0xffff_ffff_ffff_ffffn, false); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); new DataView(expected.buffer).setBigUint64( 0, @@ -176,6 +187,6 @@ describe("setUint64", () => { true, ); setUint64(actual, 0, 0xffff_ffff_ffff_ffffn, true); - expect(actual).toEqual(expected); + assert.deepStrictEqual(actual, expected); }); }); diff --git a/libraries/no-data-view/tsconfig.json b/libraries/no-data-view/tsconfig.json index 85fc5a7a..d6787a22 100644 --- a/libraries/no-data-view/tsconfig.json +++ b/libraries/no-data-view/tsconfig.json @@ -1,10 +1,10 @@ { "references": [ - { - "path": "./tsconfig.test.json" - }, { "path": "./tsconfig.build.json" }, + { + "path": "./tsconfig.test.json" + } ] } diff --git a/libraries/no-data-view/tsconfig.test.json b/libraries/no-data-view/tsconfig.test.json index e987f757..6a105912 100644 --- a/libraries/no-data-view/tsconfig.test.json +++ b/libraries/no-data-view/tsconfig.test.json @@ -2,6 +2,7 @@ "extends": "./tsconfig.build.json", "compilerOptions": { "types": [ + "node" ], }, "exclude": [] diff --git a/libraries/pcm-player/jest.config.js b/libraries/pcm-player/jest.config.js deleted file mode 100644 index ff68d1cb..00000000 --- a/libraries/pcm-player/jest.config.js +++ /dev/null @@ -1,14 +0,0 @@ -/** @type {import('ts-jest').JestConfigWithTsJest} */ -export default { - preset: "ts-jest/presets/default-esm", - extensionsToTreatAsEsm: [".ts"], - transform: { - "^.+\\.tsx?$": [ - "ts-jest", - { tsconfig: "tsconfig.test.json", useESM: true }, - ], - }, - moduleNameMapper: { - "^(\\.{1,2}/.*)\\.js$": "$1", - }, -}; diff --git a/libraries/pcm-player/package.json b/libraries/pcm-player/package.json index 65f1ad9f..8bbf5115 100644 --- a/libraries/pcm-player/package.json +++ b/libraries/pcm-player/package.json @@ -31,14 +31,10 @@ "prepublishOnly": "npm run build" }, "devDependencies": { - "@jest/globals": "^30.0.0-alpha.4", "@types/audioworklet": "^0.0.57", "@yume-chan/eslint-config": "workspace:^1.0.0", "@yume-chan/tsconfig": "workspace:^1.0.0", - "cross-env": "^7.0.3", - "jest": "^30.0.0-alpha.4", "prettier": "^3.3.3", - "ts-jest": "^29.2.2", "typescript": "^5.5.3" } } diff --git a/libraries/pcm-player/tsconfig.json b/libraries/pcm-player/tsconfig.json index 51ece434..bfbf749f 100644 --- a/libraries/pcm-player/tsconfig.json +++ b/libraries/pcm-player/tsconfig.json @@ -3,11 +3,11 @@ { "path": "./tsconfig.dom.json" }, - { - "path": "./tsconfig.worker.json" - }, { "path": "./tsconfig.test.json" }, + { + "path": "./tsconfig.worker.json" + } ] } diff --git a/libraries/scrcpy-decoder-tinyh264/jest.config.js b/libraries/scrcpy-decoder-tinyh264/jest.config.js deleted file mode 100644 index ff68d1cb..00000000 --- a/libraries/scrcpy-decoder-tinyh264/jest.config.js +++ /dev/null @@ -1,14 +0,0 @@ -/** @type {import('ts-jest').JestConfigWithTsJest} */ -export default { - preset: "ts-jest/presets/default-esm", - extensionsToTreatAsEsm: [".ts"], - transform: { - "^.+\\.tsx?$": [ - "ts-jest", - { tsconfig: "tsconfig.test.json", useESM: true }, - ], - }, - moduleNameMapper: { - "^(\\.{1,2}/.*)\\.js$": "$1", - }, -}; diff --git a/libraries/scrcpy-decoder-tinyh264/package.json b/libraries/scrcpy-decoder-tinyh264/package.json index cdde9f28..7b1ebcd9 100644 --- a/libraries/scrcpy-decoder-tinyh264/package.json +++ b/libraries/scrcpy-decoder-tinyh264/package.json @@ -30,7 +30,6 @@ "scripts": { "build": "tsc -b tsconfig.build.json", "build:watch": "tsc -b tsconfig.build.json", - "//test": "cross-env NODE_OPTIONS=--experimental-vm-modules jest --coverage", "lint": "run-eslint && prettier src/**/*.ts --write --tab-width 4", "prepublishOnly": "npm run build" }, @@ -44,13 +43,9 @@ "yuv-canvas": "^1.2.11" }, "devDependencies": { - "@jest/globals": "^30.0.0-alpha.4", "@yume-chan/eslint-config": "workspace:^1.0.0", "@yume-chan/tsconfig": "workspace:^1.0.0", - "cross-env": "^7.0.3", - "jest": "^30.0.0-alpha.4", "prettier": "^3.3.3", - "ts-jest": "^29.2.2", "typescript": "^5.5.3" } } diff --git a/libraries/scrcpy-decoder-tinyh264/tsconfig.build.json b/libraries/scrcpy-decoder-tinyh264/tsconfig.build.json index 01cb29c8..ff4d5014 100644 --- a/libraries/scrcpy-decoder-tinyh264/tsconfig.build.json +++ b/libraries/scrcpy-decoder-tinyh264/tsconfig.build.json @@ -4,7 +4,7 @@ "lib": [ "ESNext", "DOM" - ], + ] }, "references": [ { @@ -12,6 +12,6 @@ }, { "path": "../stream-extra/tsconfig.build.json" - }, + } ] } diff --git a/libraries/scrcpy-decoder-tinyh264/tsconfig.json b/libraries/scrcpy-decoder-tinyh264/tsconfig.json index 85fc5a7a..d6787a22 100644 --- a/libraries/scrcpy-decoder-tinyh264/tsconfig.json +++ b/libraries/scrcpy-decoder-tinyh264/tsconfig.json @@ -1,10 +1,10 @@ { "references": [ - { - "path": "./tsconfig.test.json" - }, { "path": "./tsconfig.build.json" }, + { + "path": "./tsconfig.test.json" + } ] } diff --git a/libraries/scrcpy-decoder-webcodecs/jest.config.js b/libraries/scrcpy-decoder-webcodecs/jest.config.js deleted file mode 100644 index ff68d1cb..00000000 --- a/libraries/scrcpy-decoder-webcodecs/jest.config.js +++ /dev/null @@ -1,14 +0,0 @@ -/** @type {import('ts-jest').JestConfigWithTsJest} */ -export default { - preset: "ts-jest/presets/default-esm", - extensionsToTreatAsEsm: [".ts"], - transform: { - "^.+\\.tsx?$": [ - "ts-jest", - { tsconfig: "tsconfig.test.json", useESM: true }, - ], - }, - moduleNameMapper: { - "^(\\.{1,2}/.*)\\.js$": "$1", - }, -}; diff --git a/libraries/scrcpy-decoder-webcodecs/package.json b/libraries/scrcpy-decoder-webcodecs/package.json index 6d3d21ec..0021c01f 100644 --- a/libraries/scrcpy-decoder-webcodecs/package.json +++ b/libraries/scrcpy-decoder-webcodecs/package.json @@ -41,13 +41,9 @@ "@yume-chan/stream-extra": "workspace:^0.0.24" }, "devDependencies": { - "@jest/globals": "^30.0.0-alpha.4", "@yume-chan/eslint-config": "workspace:^1.0.0", "@yume-chan/tsconfig": "workspace:^1.0.0", - "cross-env": "^7.0.3", - "jest": "^30.0.0-alpha.4", "prettier": "^3.3.3", - "ts-jest": "^29.2.2", "typescript": "^5.5.3" } } diff --git a/libraries/scrcpy-decoder-webcodecs/tsconfig.build.json b/libraries/scrcpy-decoder-webcodecs/tsconfig.build.json index 0b1b5a48..4bb2510f 100644 --- a/libraries/scrcpy-decoder-webcodecs/tsconfig.build.json +++ b/libraries/scrcpy-decoder-webcodecs/tsconfig.build.json @@ -9,11 +9,14 @@ }, "references": [ { - "path": "../scrcpy/tsconfig.build.json" + "path": "../no-data-view/tsconfig.build.json" }, { "path": "../scrcpy-decoder-tinyh264/tsconfig.build.json" }, + { + "path": "../scrcpy/tsconfig.build.json" + }, { "path": "../stream-extra/tsconfig.build.json" } diff --git a/libraries/scrcpy-decoder-webcodecs/tsconfig.json b/libraries/scrcpy-decoder-webcodecs/tsconfig.json index 04f9aba7..d6787a22 100644 --- a/libraries/scrcpy-decoder-webcodecs/tsconfig.json +++ b/libraries/scrcpy-decoder-webcodecs/tsconfig.json @@ -1,13 +1,10 @@ { "references": [ { - "path": "../no-data-view/tsconfig.build.json" + "path": "./tsconfig.build.json" }, { "path": "./tsconfig.test.json" - }, - { - "path": "./tsconfig.build.json" - }, + } ] } diff --git a/libraries/scrcpy/jest.config.js b/libraries/scrcpy/jest.config.js deleted file mode 100644 index ff68d1cb..00000000 --- a/libraries/scrcpy/jest.config.js +++ /dev/null @@ -1,14 +0,0 @@ -/** @type {import('ts-jest').JestConfigWithTsJest} */ -export default { - preset: "ts-jest/presets/default-esm", - extensionsToTreatAsEsm: [".ts"], - transform: { - "^.+\\.tsx?$": [ - "ts-jest", - { tsconfig: "tsconfig.test.json", useESM: true }, - ], - }, - moduleNameMapper: { - "^(\\.{1,2}/.*)\\.js$": "$1", - }, -}; diff --git a/libraries/scrcpy/package.json b/libraries/scrcpy/package.json index 23bc1293..d6d67ae9 100644 --- a/libraries/scrcpy/package.json +++ b/libraries/scrcpy/package.json @@ -29,9 +29,9 @@ "scripts": { "build": "tsc -b tsconfig.build.json", "build:watch": "tsc -b tsconfig.build.json", - "test": "cross-env NODE_OPTIONS=\"--experimental-vm-modules --no-warnings\" TS_JEST_DISABLE_VER_CHECKER=true jest --coverage", "lint": "run-eslint && prettier src/**/*.ts --write --tab-width 4", - "prepublishOnly": "npm run build" + "prepublishOnly": "npm run build", + "test": "run-test" }, "dependencies": { "@yume-chan/async": "^2.2.0", @@ -40,13 +40,11 @@ "@yume-chan/struct": "workspace:^0.0.24" }, "devDependencies": { - "@jest/globals": "^30.0.0-alpha.4", + "@types/node": "^20.14.9", "@yume-chan/eslint-config": "workspace:^1.0.0", + "@yume-chan/test-runner": "workspace:^1.0.0", "@yume-chan/tsconfig": "workspace:^1.0.0", - "cross-env": "^7.0.3", - "jest": "^30.0.0-alpha.4", "prettier": "^3.3.3", - "ts-jest": "^29.2.2", "typescript": "^5.5.3" } } diff --git a/libraries/scrcpy/src/codec/h265.spec.ts b/libraries/scrcpy/src/codec/h265.spec.ts index ecfada26..7c6d655e 100644 --- a/libraries/scrcpy/src/codec/h265.spec.ts +++ b/libraries/scrcpy/src/codec/h265.spec.ts @@ -4,7 +4,8 @@ // cspell: ignore dbbp // cspell: ignore texmc -import { describe, expect, it } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it } from "node:test"; import { h265ParseSequenceParameterSet } from "./h265.js"; @@ -22,7 +23,7 @@ describe("h265", () => { const sps = h265ParseSequenceParameterSet(buffer); - expect(sps).toEqual({ + assert.deepStrictEqual(sps, { sps_video_parameter_set_id: 0, sps_max_sub_layers_minus1: 0, sps_temporal_id_nesting_flag: true, diff --git a/libraries/scrcpy/src/codec/nalu.spec.ts b/libraries/scrcpy/src/codec/nalu.spec.ts index 2f49c095..e78abb56 100644 --- a/libraries/scrcpy/src/codec/nalu.spec.ts +++ b/libraries/scrcpy/src/codec/nalu.spec.ts @@ -1,4 +1,5 @@ -import { describe, expect, it } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it } from "node:test"; import { NaluSodbBitReader } from "./nalu.js"; @@ -9,25 +10,28 @@ describe("nalu", () => { const reader = new NaluSodbBitReader( new Uint8Array([0b10000000]), ); - expect(reader).toHaveProperty("ended", true); + assert.strictEqual(reader.ended, true); }); it("should throw error if stream is empty", () => { - expect( + assert.throws( () => new NaluSodbBitReader(new Uint8Array(0)), - ).toThrowErrorMatchingInlineSnapshot(`"Stop bit not found"`); + /Stop bit not found/, + ); }); it("should throw error if no end bit found (single byte)", () => { - expect( + assert.throws( () => new NaluSodbBitReader(new Uint8Array(1)), - ).toThrowErrorMatchingInlineSnapshot(`"Stop bit not found"`); + /Stop bit not found/, + ); }); it("should throw error if no end bit found (multiple bytes)", () => { - expect( + assert.throws( () => new NaluSodbBitReader(new Uint8Array(10)), - ).toThrowErrorMatchingInlineSnapshot(`"Stop bit not found"`); + /Stop bit not found/, + ); }); }); @@ -36,42 +40,42 @@ describe("nalu", () => { const reader = new NaluSodbBitReader( new Uint8Array([0b10110111]), ); - expect(reader.next()).toBe(1); - expect(reader.next()).toBe(0); - expect(reader.next()).toBe(1); - expect(reader.next()).toBe(1); - expect(reader.next()).toBe(0); - expect(reader.next()).toBe(1); - expect(reader.next()).toBe(1); + assert.strictEqual(reader.next(), 1); + assert.strictEqual(reader.next(), 0); + assert.strictEqual(reader.next(), 1); + assert.strictEqual(reader.next(), 1); + assert.strictEqual(reader.next(), 0); + assert.strictEqual(reader.next(), 1); + assert.strictEqual(reader.next(), 1); }); it("should read bits in Big Endian (multiple bytes)", () => { const reader = new NaluSodbBitReader( new Uint8Array([0b01001000, 0b10000100, 0b00010001]), ); - expect(reader.next()).toBe(0); - expect(reader.next()).toBe(1); - expect(reader.next()).toBe(0); - expect(reader.next()).toBe(0); - expect(reader.next()).toBe(1); - expect(reader.next()).toBe(0); - expect(reader.next()).toBe(0); - expect(reader.next()).toBe(0); - expect(reader.next()).toBe(1); - expect(reader.next()).toBe(0); - expect(reader.next()).toBe(0); - expect(reader.next()).toBe(0); - expect(reader.next()).toBe(0); - expect(reader.next()).toBe(1); - expect(reader.next()).toBe(0); - expect(reader.next()).toBe(0); - expect(reader.next()).toBe(0); - expect(reader.next()).toBe(0); - expect(reader.next()).toBe(0); - expect(reader.next()).toBe(1); - expect(reader.next()).toBe(0); - expect(reader.next()).toBe(0); - expect(reader.next()).toBe(0); + assert.strictEqual(reader.next(), 0); + assert.strictEqual(reader.next(), 1); + assert.strictEqual(reader.next(), 0); + assert.strictEqual(reader.next(), 0); + assert.strictEqual(reader.next(), 1); + assert.strictEqual(reader.next(), 0); + assert.strictEqual(reader.next(), 0); + assert.strictEqual(reader.next(), 0); + assert.strictEqual(reader.next(), 1); + assert.strictEqual(reader.next(), 0); + assert.strictEqual(reader.next(), 0); + assert.strictEqual(reader.next(), 0); + assert.strictEqual(reader.next(), 0); + assert.strictEqual(reader.next(), 1); + assert.strictEqual(reader.next(), 0); + assert.strictEqual(reader.next(), 0); + assert.strictEqual(reader.next(), 0); + assert.strictEqual(reader.next(), 0); + assert.strictEqual(reader.next(), 0); + assert.strictEqual(reader.next(), 1); + assert.strictEqual(reader.next(), 0); + assert.strictEqual(reader.next(), 0); + assert.strictEqual(reader.next(), 0); }); it("should throw error if read after end bit (single byte, middle)", () => { @@ -79,11 +83,9 @@ describe("nalu", () => { new Uint8Array([0b11111000]), ); for (let i = 0; i < 4; i += 1) { - expect(reader.next()).toBe(1); + assert.strictEqual(reader.next(), 1); } - expect(() => reader.next()).toThrowErrorMatchingInlineSnapshot( - `"Bit index out of bounds"`, - ); + assert.throws(() => reader.next(), /Bit index out of bounds/); }); it("should throw error if read after end bit (single byte, end)", () => { @@ -91,11 +93,9 @@ describe("nalu", () => { new Uint8Array([0b11111111]), ); for (let i = 0; i < 7; i += 1) { - expect(reader.next()).toBe(1); + assert.strictEqual(reader.next(), 1); } - expect(() => reader.next()).toThrowErrorMatchingInlineSnapshot( - `"Bit index out of bounds"`, - ); + assert.throws(() => reader.next(), /Bit index out of bounds/); }); it("should throw error if read after end bit (multiple bytes, start)", () => { @@ -103,11 +103,9 @@ describe("nalu", () => { new Uint8Array([0b11111111, 0b10000000]), ); for (let i = 0; i < 8; i += 1) { - expect(reader.next()).toBe(1); + assert.strictEqual(reader.next(), 1); } - expect(() => reader.next()).toThrowErrorMatchingInlineSnapshot( - `"Bit index out of bounds"`, - ); + assert.throws(() => reader.next(), /Bit index out of bounds/); }); it("should throw error if read after end bit (multiple bytes, middle)", () => { @@ -115,11 +113,9 @@ describe("nalu", () => { new Uint8Array([0b11111111, 0b11111000]), ); for (let i = 0; i < 12; i += 1) { - expect(reader.next()).toBe(1); + assert.strictEqual(reader.next(), 1); } - expect(() => reader.next()).toThrowErrorMatchingInlineSnapshot( - `"Bit index out of bounds"`, - ); + assert.throws(() => reader.next(), /Bit index out of bounds/); }); it("should skip emulation prevent byte", () => { @@ -127,13 +123,13 @@ describe("nalu", () => { new Uint8Array([0xff, 0x00, 0x00, 0x03, 0xff, 0x80]), ); for (let i = 0; i < 8; i += 1) { - expect(reader.next()).toBe(1); + assert.strictEqual(reader.next(), 1); } for (let i = 0; i < 16; i += 1) { - expect(reader.next()).toBe(0); + assert.strictEqual(reader.next(), 0); } for (let i = 0; i < 8; i += 1) { - expect(reader.next()).toBe(1); + assert.strictEqual(reader.next(), 1); } }); @@ -144,13 +140,13 @@ describe("nalu", () => { ]), ); for (let i = 0; i < 8; i += 1) { - expect(reader.next()).toBe(1); + assert.strictEqual(reader.next(), 1); } for (let i = 0; i < 32; i += 1) { - expect(reader.next()).toBe(0); + assert.strictEqual(reader.next(), 0); } for (let i = 0; i < 8; i += 1) { - expect(reader.next()).toBe(1); + assert.strictEqual(reader.next(), 1); } }); }); @@ -161,14 +157,13 @@ describe("nalu", () => { const reader = new NaluSodbBitReader(new Uint8Array([0b01000011])); reader.skip(1); - expect(reader.next()).toBe(1); - expect(reader.next()).toBe(0); + assert.strictEqual(reader.next(), 1); + + assert.strictEqual(reader.next(), 0); reader.skip(3); - expect(reader.next()).toBe(1); - expect(() => reader.next()).toThrowErrorMatchingInlineSnapshot( - `"Bit index out of bounds"`, - ); + assert.strictEqual(reader.next(), 1); + assert.throws(() => reader.next(), /Bit index out of bounds/); }); it("should skip <8 bits in multiple bytes", () => { @@ -177,15 +172,15 @@ describe("nalu", () => { ); reader.skip(5); - expect(reader.next()).toBe(1); - expect(reader.next()).toBe(0); + assert.strictEqual(reader.next(), 1); + + assert.strictEqual(reader.next(), 0); reader.skip(3); - expect(reader.next()).toBe(1); - expect(reader.next()).toBe(0); - expect(() => reader.next()).toThrowErrorMatchingInlineSnapshot( - `"Bit index out of bounds"`, - ); + assert.strictEqual(reader.next(), 1); + + assert.strictEqual(reader.next(), 0); + assert.throws(() => reader.next(), /Bit index out of bounds/); }); it("should skip >8 bits without emulation prevention byte", () => { @@ -193,8 +188,9 @@ describe("nalu", () => { new Uint8Array([0b00000000, 0b00100001]), ); reader.skip(10); - expect(reader.next()).toBe(1); - expect(reader.next()).toBe(0); + assert.strictEqual(reader.next(), 1); + + assert.strictEqual(reader.next(), 0); }); }); }); diff --git a/libraries/scrcpy/src/options/1_16/codec-options.spec.ts b/libraries/scrcpy/src/options/1_16/codec-options.spec.ts index 2b58ffcd..641d3b5a 100644 --- a/libraries/scrcpy/src/options/1_16/codec-options.spec.ts +++ b/libraries/scrcpy/src/options/1_16/codec-options.spec.ts @@ -1,9 +1,10 @@ -import { describe, expect, it } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it } from "node:test"; import { CodecOptions } from "./codec-options.js"; describe("CodecOptions", () => { it("should detect empty value", () => { - expect(new CodecOptions({}).toOptionValue()).toBeUndefined(); + assert.strictEqual(new CodecOptions({}).toOptionValue(), undefined); }); }); diff --git a/libraries/scrcpy/src/options/1_16/options.spec.ts b/libraries/scrcpy/src/options/1_16/options.spec.ts index a04cfbe8..3a4c7d8a 100644 --- a/libraries/scrcpy/src/options/1_16/options.spec.ts +++ b/libraries/scrcpy/src/options/1_16/options.spec.ts @@ -1,11 +1,12 @@ -import { describe, expect, it } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it } from "node:test"; import { ScrcpyOptions1_16 } from "./options.js"; describe("ScrcpyOptions1_16", () => { describe("serialize", () => { it("should return `-` for default values", () => { - expect(new ScrcpyOptions1_16({}).serialize()).toEqual([ + assert.deepStrictEqual(new ScrcpyOptions1_16({}).serialize(), [ "debug", "0", "8000000", @@ -27,7 +28,7 @@ describe("ScrcpyOptions1_16", () => { it("should set `display` to `-1`", () => { const options = new ScrcpyOptions1_16({}); options.setListDisplays(); - expect(options.value.displayId).toBe(-1); + assert.strictEqual(options.value.displayId, -1); }); }); }); diff --git a/libraries/scrcpy/src/options/1_16/scroll.spec.ts b/libraries/scrcpy/src/options/1_16/scroll.spec.ts index f6f196af..3fdd7482 100644 --- a/libraries/scrcpy/src/options/1_16/scroll.spec.ts +++ b/libraries/scrcpy/src/options/1_16/scroll.spec.ts @@ -1,4 +1,5 @@ -import { describe, expect, it } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it } from "node:test"; import { ScrcpyControlMessageType } from "../../control/index.js"; @@ -17,7 +18,7 @@ describe("ScrcpyScrollController1_16", () => { scrollY: 0.5, buttons: 0, }); - expect(message).toBeUndefined(); + assert.strictEqual(message, undefined); }); it("should return a message when scroll distance is greater than 1", () => { @@ -32,8 +33,8 @@ describe("ScrcpyScrollController1_16", () => { scrollY: 1.5, buttons: 0, }); - expect(message).toBeInstanceOf(Uint8Array); - expect(message).toHaveProperty("byteLength", 21); + assert.ok(message instanceof Uint8Array); + assert.strictEqual(message.byteLength, 21); }); it("should return a message when accumulated scroll distance is greater than 1", () => { @@ -58,8 +59,8 @@ describe("ScrcpyScrollController1_16", () => { scrollY: 0.5, buttons: 0, }); - expect(message).toBeInstanceOf(Uint8Array); - expect(message).toHaveProperty("byteLength", 21); + assert.ok(message instanceof Uint8Array); + assert.strictEqual(message.byteLength, 21); }); it("should return a message when accumulated scroll distance is less than -1", () => { @@ -84,7 +85,7 @@ describe("ScrcpyScrollController1_16", () => { scrollY: -0.5, buttons: 0, }); - expect(message).toBeInstanceOf(Uint8Array); - expect(message).toHaveProperty("byteLength", 21); + assert.ok(message instanceof Uint8Array); + assert.strictEqual(message.byteLength, 21); }); }); diff --git a/libraries/scrcpy/src/options/1_17.spec.ts b/libraries/scrcpy/src/options/1_17.spec.ts index 0f14624d..6ace3296 100644 --- a/libraries/scrcpy/src/options/1_17.spec.ts +++ b/libraries/scrcpy/src/options/1_17.spec.ts @@ -1,4 +1,5 @@ -import { describe, expect, it } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it } from "node:test"; import { ScrcpyOptions1_17 } from "./1_17.js"; @@ -8,14 +9,14 @@ describe("ScrcpyOptions1_17", () => { // `setListDisplays` is implemented in `ScrcpyOptions1_16`, // but it should modify `value` of `ScrcpyOptions1_17`. options.setListDisplays(); - expect(options.value.displayId).toBe(-1); + assert.strictEqual(options.value.displayId, -1); }); describe("setListEncoders", () => { it("should set `encoderName` to `_`", () => { const options = new ScrcpyOptions1_17({}); options.setListEncoders(); - expect(options.value.encoderName).toBe("_"); + assert.strictEqual(options.value.encoderName, "_"); }); }); }); diff --git a/libraries/scrcpy/src/options/1_18.spec.ts b/libraries/scrcpy/src/options/1_18.spec.ts index fd3c22ae..d4cad2f9 100644 --- a/libraries/scrcpy/src/options/1_18.spec.ts +++ b/libraries/scrcpy/src/options/1_18.spec.ts @@ -1,4 +1,5 @@ -import { describe, expect, it } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it } from "node:test"; import { ScrcpyOptions1_18 } from "./1_18.js"; @@ -8,6 +9,6 @@ describe("ScrcpyOptions1_18", () => { // `setListDisplays` is implemented in `ScrcpyOptions1_16`, // but it should modify `value` of `ScrcpyOptions1_18`. options.setListDisplays(); - expect(options.value.displayId).toBe(-1); + assert.strictEqual(options.value.displayId, -1); }); }); diff --git a/libraries/scrcpy/src/options/1_21.spec.ts b/libraries/scrcpy/src/options/1_21.spec.ts index 3c879af0..d6283166 100644 --- a/libraries/scrcpy/src/options/1_21.spec.ts +++ b/libraries/scrcpy/src/options/1_21.spec.ts @@ -1,4 +1,5 @@ -import { describe, expect, it } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it } from "node:test"; import { AndroidAvcProfile } from "../codec/index.js"; @@ -10,7 +11,7 @@ describe("ScrcpyOptions1_21", () => { describe("serialize", () => { it("should serialize empty value", () => { const options = new ScrcpyOptions1_21({}); - expect(options.serialize()).toEqual([]); + assert.deepEqual(options.serialize(), []); }); it("should omit primitive values same as default value", () => { @@ -18,14 +19,14 @@ describe("ScrcpyOptions1_21", () => { // Default value sendFrameMeta: true, }); - expect(options.serialize()).toEqual([]); + assert.deepEqual(options.serialize(), []); }); it("should omit `ScrcpyOptionValue`s same as default value", () => { const options = new ScrcpyOptions1_21({ codecOptions: new CodecOptions(), }); - expect(options.serialize()).toEqual([]); + assert.deepEqual(options.serialize(), []); }); it("should convert ScrcpyOptionValue to string", () => { @@ -34,7 +35,7 @@ describe("ScrcpyOptions1_21", () => { profile: AndroidAvcProfile.High, }), }); - expect(options.serialize()).toEqual(["codec_options=profile=8"]); + assert.deepEqual(options.serialize(), ["codec_options=profile=8"]); }); }); }); diff --git a/libraries/scrcpy/src/options/1_22/options.spec.ts b/libraries/scrcpy/src/options/1_22/options.spec.ts index 7e743bc0..57e944cf 100644 --- a/libraries/scrcpy/src/options/1_22/options.spec.ts +++ b/libraries/scrcpy/src/options/1_22/options.spec.ts @@ -1,4 +1,5 @@ -import { describe, expect, it } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it } from "node:test"; import { ScrcpyOptions1_21 } from "../1_21.js"; @@ -12,6 +13,6 @@ describe("ScrcpyOptions1_22", () => { const controller1_22 = new ScrcpyOptions1_22( {}, ).createScrollController(); - expect(controller1_22).not.toBe(controller1_21); + assert.notStrictEqual(controller1_22, controller1_21); }); }); diff --git a/libraries/scrcpy/src/options/1_22/scroll.spec.ts b/libraries/scrcpy/src/options/1_22/scroll.spec.ts index d6929f54..63545dc2 100644 --- a/libraries/scrcpy/src/options/1_22/scroll.spec.ts +++ b/libraries/scrcpy/src/options/1_22/scroll.spec.ts @@ -1,4 +1,5 @@ -import { describe, expect, it } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it } from "node:test"; import { ScrcpyControlMessageType } from "../../control/index.js"; @@ -17,7 +18,7 @@ describe("ScrcpyScrollController1_22", () => { scrollY: 1.5, buttons: 0, }); - expect(message).toBeInstanceOf(Uint8Array); - expect(message).toHaveProperty("byteLength", 25); + assert.ok(message instanceof Uint8Array); + assert.strictEqual(message.byteLength, 25); }); }); diff --git a/libraries/scrcpy/src/options/1_25/options.spec.ts b/libraries/scrcpy/src/options/1_25/options.spec.ts index 964adb15..c07d971b 100644 --- a/libraries/scrcpy/src/options/1_25/options.spec.ts +++ b/libraries/scrcpy/src/options/1_25/options.spec.ts @@ -1,4 +1,5 @@ -import { describe, expect, it } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it } from "node:test"; import { ScrcpyOptions1_24 } from "../1_24.js"; @@ -12,14 +13,14 @@ describe("ScrcpyOptions1_25", () => { const controller1_25 = new ScrcpyOptions1_25( {}, ).createScrollController(); - expect(controller1_25).not.toBe(controller1_24); + assert.notStrictEqual(controller1_25, controller1_24); }); describe("setListDisplays", () => { it("should set `display` to `-1`", () => { const options = new ScrcpyOptions1_25({}); options.setListDisplays(); - expect(options.value.displayId).toBe(-1); + assert.strictEqual(options.value.displayId, -1); }); }); }); diff --git a/libraries/scrcpy/src/options/1_25/scroll.spec.ts b/libraries/scrcpy/src/options/1_25/scroll.spec.ts index 58fe6cc4..6aaa4711 100644 --- a/libraries/scrcpy/src/options/1_25/scroll.spec.ts +++ b/libraries/scrcpy/src/options/1_25/scroll.spec.ts @@ -1,4 +1,5 @@ -import { describe, expect, it } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it } from "node:test"; import { ScrcpyControlMessageType } from "../../control/index.js"; @@ -11,22 +12,22 @@ describe("ScrcpyFloatToInt16NumberType", () => { it("should serialize", () => { const array = new Uint8Array(2); ScrcpySignedFloatNumberVariant.serialize(array, 0, -1, true); - expect(new DataView(array.buffer).getInt16(0, true)).toBe(-0x8000); + assert.strictEqual(new DataView(array.buffer).getInt16(0, true), -0x8000); ScrcpySignedFloatNumberVariant.serialize(array, 0, 0, true); - expect(new DataView(array.buffer).getInt16(0, true)).toBe(0); + assert.strictEqual(new DataView(array.buffer).getInt16(0, true), 0); ScrcpySignedFloatNumberVariant.serialize(array, 0, 1, true); - expect(new DataView(array.buffer).getInt16(0, true)).toBe(0x7fff); + assert.strictEqual(new DataView(array.buffer).getInt16(0, true), 0x7fff); }); it("should clamp input values", () => { const array = new Uint8Array(2); ScrcpySignedFloatNumberVariant.serialize(array, 0, -2, true); - expect(new DataView(array.buffer).getInt16(0, true)).toBe(-0x8000); + assert.strictEqual(new DataView(array.buffer).getInt16(0, true), -0x8000); ScrcpySignedFloatNumberVariant.serialize(array, 0, 2, true); - expect(new DataView(array.buffer).getInt16(0, true)).toBe(0x7fff); + assert.strictEqual(new DataView(array.buffer).getInt16(0, true), 0x7fff); }); it("should deserialize", () => { @@ -34,13 +35,22 @@ describe("ScrcpyFloatToInt16NumberType", () => { const view = new Uint8Array(dataView.buffer); dataView.setInt16(0, -0x8000, true); - expect(ScrcpySignedFloatNumberVariant.deserialize(view, true)).toBe(-1); + assert.strictEqual( + ScrcpySignedFloatNumberVariant.deserialize(view, true), + -1, + ); dataView.setInt16(0, 0, true); - expect(ScrcpySignedFloatNumberVariant.deserialize(view, true)).toBe(0); + assert.strictEqual( + ScrcpySignedFloatNumberVariant.deserialize(view, true), + 0, + ); dataView.setInt16(0, 0x7fff, true); - expect(ScrcpySignedFloatNumberVariant.deserialize(view, true)).toBe(1); + assert.strictEqual( + ScrcpySignedFloatNumberVariant.deserialize(view, true), + 1, + ); }); }); @@ -57,8 +67,8 @@ describe("ScrcpyScrollController1_25", () => { scrollY: 0.5, buttons: 0, }); - expect(message1).toBeInstanceOf(Uint8Array); - expect(message1).toHaveProperty("byteLength", 21); + assert.ok(message1 instanceof Uint8Array); + assert.strictEqual(message1.byteLength, 21); const message2 = controller.serializeScrollMessage({ type: ScrcpyControlMessageType.InjectScroll, @@ -70,7 +80,7 @@ describe("ScrcpyScrollController1_25", () => { scrollY: 1.5, buttons: 0, }); - expect(message2).toBeInstanceOf(Uint8Array); - expect(message2).toHaveProperty("byteLength", 21); + assert.ok(message2 instanceof Uint8Array); + assert.strictEqual(message2.byteLength, 21); }); }); diff --git a/libraries/scrcpy/src/options/2_0.spec.ts b/libraries/scrcpy/src/options/2_0.spec.ts index 811e7f3f..dcf58fd2 100644 --- a/libraries/scrcpy/src/options/2_0.spec.ts +++ b/libraries/scrcpy/src/options/2_0.spec.ts @@ -1,4 +1,5 @@ -import { describe, expect, it } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it } from "node:test"; import { ScrcpyOptions2_0 } from "./2_0.js"; @@ -7,7 +8,7 @@ describe("ScrcpyOptions2_0", () => { it("should set `listDisplays` to `true`", () => { const options = new ScrcpyOptions2_0({}); options.setListDisplays(); - expect(options.value.listDisplays).toBe(true); + assert.strictEqual(options.value.listDisplays, true); }); }); @@ -15,7 +16,7 @@ describe("ScrcpyOptions2_0", () => { it("should set `listEncoders` to `true`", () => { const options = new ScrcpyOptions2_0({}); options.setListEncoders(); - expect(options.value.listEncoders).toBe(true); + assert.strictEqual(options.value.listEncoders, true); }); }); }); diff --git a/libraries/scrcpy/src/options/2_1.spec.ts b/libraries/scrcpy/src/options/2_1.spec.ts index bbec1f9f..ecaa23b0 100644 --- a/libraries/scrcpy/src/options/2_1.spec.ts +++ b/libraries/scrcpy/src/options/2_1.spec.ts @@ -1,4 +1,5 @@ -import { describe, expect, it } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it } from "node:test"; import { ScrcpyOptions2_1 } from "./2_1.js"; @@ -7,7 +8,7 @@ describe("ScrcpyOptions2_1", () => { it("should set `listDisplays` to `true`", () => { const options = new ScrcpyOptions2_1({}); options.setListDisplays(); - expect(options.value.listDisplays).toBe(true); + assert.strictEqual(options.value.listDisplays, true); }); }); @@ -15,7 +16,7 @@ describe("ScrcpyOptions2_1", () => { it("should set `listEncoders` to `true`", () => { const options = new ScrcpyOptions2_1({}); options.setListEncoders(); - expect(options.value.listEncoders).toBe(true); + assert.strictEqual(options.value.listEncoders, true); }); }); }); diff --git a/libraries/scrcpy/tsconfig.build.json b/libraries/scrcpy/tsconfig.build.json index 87c8ef47..468186f0 100644 --- a/libraries/scrcpy/tsconfig.build.json +++ b/libraries/scrcpy/tsconfig.build.json @@ -6,6 +6,6 @@ }, { "path": "../struct/tsconfig.build.json" - }, + } ] } diff --git a/libraries/scrcpy/tsconfig.json b/libraries/scrcpy/tsconfig.json index 85fc5a7a..d6787a22 100644 --- a/libraries/scrcpy/tsconfig.json +++ b/libraries/scrcpy/tsconfig.json @@ -1,10 +1,10 @@ { "references": [ - { - "path": "./tsconfig.test.json" - }, { "path": "./tsconfig.build.json" }, + { + "path": "./tsconfig.test.json" + } ] } diff --git a/libraries/scrcpy/tsconfig.test.json b/libraries/scrcpy/tsconfig.test.json index e987f757..6a105912 100644 --- a/libraries/scrcpy/tsconfig.test.json +++ b/libraries/scrcpy/tsconfig.test.json @@ -2,6 +2,7 @@ "extends": "./tsconfig.build.json", "compilerOptions": { "types": [ + "node" ], }, "exclude": [] diff --git a/libraries/stream-extra/jest.config.js b/libraries/stream-extra/jest.config.js deleted file mode 100644 index ff68d1cb..00000000 --- a/libraries/stream-extra/jest.config.js +++ /dev/null @@ -1,14 +0,0 @@ -/** @type {import('ts-jest').JestConfigWithTsJest} */ -export default { - preset: "ts-jest/presets/default-esm", - extensionsToTreatAsEsm: [".ts"], - transform: { - "^.+\\.tsx?$": [ - "ts-jest", - { tsconfig: "tsconfig.test.json", useESM: true }, - ], - }, - moduleNameMapper: { - "^(\\.{1,2}/.*)\\.js$": "$1", - }, -}; diff --git a/libraries/stream-extra/package.json b/libraries/stream-extra/package.json index cb74b70d..02299e57 100644 --- a/libraries/stream-extra/package.json +++ b/libraries/stream-extra/package.json @@ -28,22 +28,20 @@ "scripts": { "build": "tsc -b tsconfig.build.json", "build:watch": "tsc -b tsconfig.build.json", - "test": "cross-env NODE_OPTIONS=\"--experimental-vm-modules --no-warnings\" TS_JEST_DISABLE_VER_CHECKER=true jest --coverage", "lint": "run-eslint && prettier src/**/*.ts --write --tab-width 4", - "prepublishOnly": "npm run build" + "prepublishOnly": "npm run build", + "test": "run-test" }, "dependencies": { "@yume-chan/async": "^2.2.0", "@yume-chan/struct": "workspace:^0.0.24" }, "devDependencies": { - "@jest/globals": "^30.0.0-alpha.4", + "@types/node": "^20.14.9", "@yume-chan/eslint-config": "workspace:^1.0.0", + "@yume-chan/test-runner": "workspace:^1.0.0", "@yume-chan/tsconfig": "workspace:^1.0.0", - "cross-env": "^7.0.3", - "jest": "^30.0.0-alpha.4", "prettier": "^3.3.3", - "ts-jest": "^29.2.2", "typescript": "^5.5.3" } } diff --git a/libraries/stream-extra/src/buffered.spec.ts b/libraries/stream-extra/src/buffered.spec.ts index 3d60531d..b4a91c9e 100644 --- a/libraries/stream-extra/src/buffered.spec.ts +++ b/libraries/stream-extra/src/buffered.spec.ts @@ -1,4 +1,5 @@ -import { describe, expect, it } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it } from "node:test"; import { BufferedReadableStream } from "./buffered.js"; import { ReadableStream } from "./stream.js"; @@ -43,7 +44,7 @@ async function runTest(inputSizes: number[], readSizes: number[]) { index = 0; for (const size of readSizes) { const buffer = await buffered.readExactly(size); - expect(buffer).toEqual(input.subarray(index, index + size)); + assert.deepStrictEqual(buffer, input.subarray(index, index + size)); index += size; } } @@ -53,14 +54,16 @@ describe("BufferedStream", () => { it("read 0 buffer", async () => { const source = new MockReadableStream([]); const buffered = new BufferedReadableStream(source); - await expect(buffered.readExactly(10)).rejects.toThrow(); + await assert.rejects(async () => { + await buffered.readExactly(10); + }); }); it("input 1 exact buffer", async () => { const input = randomUint8Array(10); const source = new MockReadableStream([input]); const buffered = new BufferedReadableStream(source); - await expect(buffered.readExactly(10)).resolves.toBe(input); + assert.deepStrictEqual(await buffered.readExactly(10), input); }); it("input 1 large buffer", () => { @@ -70,7 +73,9 @@ describe("BufferedStream", () => { it("read 1 small buffer", async () => { const source = new MockReadableStream([randomUint8Array(5)]); const buffered = new BufferedReadableStream(source); - await expect(buffered.readExactly(10)).rejects.toThrow(); + await assert.rejects(async () => { + await buffered.readExactly(10); + }); }); it("input 2 small buffers", () => { @@ -83,7 +88,9 @@ describe("BufferedStream", () => { randomUint8Array(5), ]); const buffered = new BufferedReadableStream(source); - await expect(buffered.readExactly(20)).rejects.toThrow(); + await assert.rejects(async () => { + await buffered.readExactly(20); + }); }); it("input 2 small + large buffers", () => { diff --git a/libraries/stream-extra/src/concat.spec.ts b/libraries/stream-extra/src/concat.spec.ts index 06c08391..0e6e9517 100644 --- a/libraries/stream-extra/src/concat.spec.ts +++ b/libraries/stream-extra/src/concat.spec.ts @@ -1,4 +1,5 @@ -import { describe, expect, it } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it } from "node:test"; import { ConcatBufferStream, ConcatStringStream } from "./concat.js"; import { ReadableStream } from "./stream.js"; @@ -6,10 +7,10 @@ import { ReadableStream } from "./stream.js"; describe("ConcatStringStream", () => { it("should have Promise interface", () => { const readable = new ConcatStringStream().readable; - expect(readable).toBeInstanceOf(ReadableStream); - expect(readable).toHaveProperty("then", expect.any(Function)); - expect(readable).toHaveProperty("catch", expect.any(Function)); - expect(readable).toHaveProperty("finally", expect.any(Function)); + assert.ok(readable instanceof ReadableStream); + assert.ok(typeof readable.then === "function"); + assert.ok(typeof readable.catch === "function"); + assert.ok(typeof readable.finally === "function"); }); it("should resolve to result", async () => { @@ -21,7 +22,7 @@ describe("ConcatStringStream", () => { }, }).pipeThrough(new ConcatStringStream()); - await expect(readable).resolves.toBe("foobar"); + assert.strictEqual(await readable, "foobar"); }); it("should read result", async () => { @@ -34,11 +35,11 @@ describe("ConcatStringStream", () => { }).pipeThrough(new ConcatStringStream()); const reader = readable.getReader(); - await expect(reader.read()).resolves.toEqual({ + assert.deepStrictEqual(await reader.read(), { done: false, value: "foobar", }); - await expect(reader.read()).resolves.toEqual({ + assert.deepStrictEqual(await reader.read(), { done: true, value: undefined, }); @@ -46,22 +47,20 @@ describe("ConcatStringStream", () => { it("should report error when aborted", async () => { const stream = new ConcatStringStream(); - const reason = "aborted"; + const reason = new Error("aborted"); await stream.writable.getWriter().abort(reason); - await expect(stream.readable).rejects.toBe(reason); - await expect(() => stream.readable.getReader().read()).rejects.toBe( - reason, - ); + await assert.rejects(() => stream.readable, reason); + await assert.rejects(() => stream.readable.getReader().read(), reason); }); }); describe("ConcatBufferStream", () => { it("should have Promise interface", () => { const readable = new ConcatBufferStream().readable; - expect(readable).toBeInstanceOf(ReadableStream); - expect(readable).toHaveProperty("then", expect.any(Function)); - expect(readable).toHaveProperty("catch", expect.any(Function)); - expect(readable).toHaveProperty("finally", expect.any(Function)); + assert.ok(readable instanceof ReadableStream); + assert.ok(typeof readable.then === "function"); + assert.ok(typeof readable.catch === "function"); + assert.ok(typeof readable.finally === "function"); }); it("should return empty buffer if no input", async () => { @@ -71,7 +70,7 @@ describe("ConcatBufferStream", () => { }, }).pipeThrough(new ConcatBufferStream()); - await expect(readable).resolves.toEqual(new Uint8Array()); + assert.deepStrictEqual(await readable, new Uint8Array()); }); it("should return one segment", async () => { @@ -82,7 +81,7 @@ describe("ConcatBufferStream", () => { }, }).pipeThrough(new ConcatBufferStream()); - await expect(readable).resolves.toEqual(new Uint8Array([1, 2, 3])); + assert.deepStrictEqual(await readable, new Uint8Array([1, 2, 3])); }); it("should resolve to result", async () => { @@ -94,7 +93,8 @@ describe("ConcatBufferStream", () => { }, }).pipeThrough(new ConcatBufferStream()); - await expect(readable).resolves.toEqual( + assert.deepStrictEqual( + await readable, new Uint8Array([1, 2, 3, 4, 5, 6]), ); }); @@ -109,11 +109,11 @@ describe("ConcatBufferStream", () => { }).pipeThrough(new ConcatBufferStream()); const reader = readable.getReader(); - await expect(reader.read()).resolves.toEqual({ + assert.deepStrictEqual(await reader.read(), { done: false, value: new Uint8Array([1, 2, 3, 4, 5, 6]), }); - await expect(reader.read()).resolves.toEqual({ + assert.deepStrictEqual(await reader.read(), { done: true, value: undefined, }); @@ -121,11 +121,9 @@ describe("ConcatBufferStream", () => { it("should report error when aborted", async () => { const stream = new ConcatBufferStream(); - const reason = "aborted"; + const reason = new Error("aborted"); await stream.writable.getWriter().abort(reason); - await expect(stream.readable).rejects.toBe(reason); - await expect(() => stream.readable.getReader().read()).rejects.toBe( - reason, - ); + await assert.rejects(() => stream.readable, reason); + await assert.rejects(() => stream.readable.getReader().read(), reason); }); }); diff --git a/libraries/stream-extra/src/distribution.spec.ts b/libraries/stream-extra/src/distribution.spec.ts index f7794ebc..04db11e2 100644 --- a/libraries/stream-extra/src/distribution.spec.ts +++ b/libraries/stream-extra/src/distribution.spec.ts @@ -1,4 +1,5 @@ -import { describe, expect, it, jest } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it, mock } from "node:test"; import { Consumable } from "./consumable.js"; import { DistributionStream } from "./distribution.js"; @@ -14,7 +15,7 @@ async function testInputOutput( inputLengths: number[], outputLengths: number[], ) { - const write = jest.fn((chunk: Uint8Array) => { + const write = mock.fn((chunk: Uint8Array) => { void chunk; }); await new Consumable.ReadableStream({ @@ -37,13 +38,12 @@ async function testInputOutput( }, }), ); - - expect(write).toHaveBeenCalledTimes(outputLengths.length); + assert.strictEqual(write.mock.callCount(), outputLengths.length); let offset = 0; for (let i = 0; i < outputLengths.length; i += 1) { const end = offset + outputLengths[i]!; - expect(write).toHaveBeenNthCalledWith( - i + 1, + assert.deepStrictEqual( + write.mock.calls[i]!.arguments[0], TestData.subarray(offset, end), ); offset = end; diff --git a/libraries/stream-extra/src/duplex.spec.ts b/libraries/stream-extra/src/duplex.spec.ts index 111405cd..3f845085 100644 --- a/libraries/stream-extra/src/duplex.spec.ts +++ b/libraries/stream-extra/src/duplex.spec.ts @@ -1,4 +1,4 @@ -import { describe, it } from "@jest/globals"; +import { describe, it } from "node:test"; import { DuplexStreamFactory } from "./duplex.js"; import { ReadableStream } from "./stream.js"; diff --git a/libraries/stream-extra/src/push-readable.spec.ts b/libraries/stream-extra/src/push-readable.spec.ts index 270b33da..d07897be 100644 --- a/libraries/stream-extra/src/push-readable.spec.ts +++ b/libraries/stream-extra/src/push-readable.spec.ts @@ -1,5 +1,6 @@ -import { describe, expect, it, jest } from "@jest/globals"; import { delay } from "@yume-chan/async"; +import * as assert from "node:assert"; +import { describe, it, mock } from "node:test"; import type { PushReadableStreamController } from "./push-readable.js"; import { PushReadableStream } from "./push-readable.js"; @@ -7,16 +8,16 @@ import { PushReadableStream } from "./push-readable.js"; describe("PushReadableStream", () => { describe(".cancel", () => { it("should abort the `AbortSignal`", async () => { - const abortHandler = jest.fn(); + const abortHandler = mock.fn(); const stream = new PushReadableStream((controller) => { controller.abortSignal.addEventListener("abort", abortHandler); }); await stream.cancel("reason"); - expect(abortHandler).toHaveBeenCalledTimes(1); + assert.strictEqual(abortHandler.mock.callCount(), 1); }); it("should ignore pending `enqueue`", async () => { - const log = jest.fn(); + const log = mock.fn(); const stream = new PushReadableStream( async (controller) => { await controller.enqueue(1); @@ -28,84 +29,86 @@ describe("PushReadableStream", () => { const reader = stream.getReader(); await delay(0); await reader.cancel("reason"); - expect(log.mock.calls).toMatchInlineSnapshot(` + await delay(0); + assert.deepStrictEqual( + log.mock.calls.map((call) => call.arguments), [ - [ - { - "operation": "enqueue", - "phase": "start", - "source": "producer", - "value": 1, - }, - ], - [ - { - "operation": "enqueue", - "phase": "complete", - "source": "producer", - "value": 1, - }, - ], - [ - { - "operation": "enqueue", - "phase": "start", - "source": "producer", - "value": 2, - }, - ], - [ - { - "operation": "enqueue", - "phase": "waiting", - "source": "producer", - "value": 2, - }, - ], - [ - { - "operation": "cancel", - "phase": "start", - "source": "consumer", - }, - ], - [ - { - "operation": "cancel", - "phase": "complete", - "source": "consumer", - }, - ], - [ - { - "operation": "enqueue", - "phase": "ignored", - "source": "producer", - "value": 2, - }, - ], - [ - { - "explicit": false, - "operation": "close", - "phase": "start", - "source": "producer", - }, - ], - [ - { - "explicit": false, - "operation": "close", - "phase": "ignored", - "source": "producer", - }, - ], - ] - `); + [ + { + operation: "enqueue", + phase: "start", + source: "producer", + value: 1, + }, + ], + [ + { + operation: "enqueue", + phase: "complete", + source: "producer", + value: 1, + }, + ], + [ + { + operation: "enqueue", + phase: "start", + source: "producer", + value: 2, + }, + ], + [ + { + operation: "enqueue", + phase: "waiting", + source: "producer", + value: 2, + }, + ], + [ + { + operation: "cancel", + phase: "start", + source: "consumer", + }, + ], + [ + { + operation: "cancel", + phase: "complete", + source: "consumer", + }, + ], + [ + { + operation: "enqueue", + phase: "ignored", + source: "producer", + value: 2, + }, + ], + [ + { + explicit: false, + operation: "close", + phase: "start", + source: "producer", + }, + ], + [ + { + explicit: false, + operation: "close", + phase: "ignored", + source: "producer", + }, + ], + ], + ); }); it("should ignore future `enqueue`", async () => { - const log = jest.fn(); + const log = mock.fn(); const stream = new PushReadableStream( async (controller) => { await controller.enqueue(1); @@ -116,104 +119,105 @@ describe("PushReadableStream", () => { log, ); const reader = stream.getReader(); - await delay(1); + await delay(0); await reader.cancel("reason"); // Add extra microtasks to allow all operations to complete - await delay(1); - expect(log.mock.calls).toMatchInlineSnapshot(` + await delay(0); + assert.deepStrictEqual( + log.mock.calls.map((call) => call.arguments), [ - [ - { - "operation": "enqueue", - "phase": "start", - "source": "producer", - "value": 1, - }, - ], - [ - { - "operation": "enqueue", - "phase": "complete", - "source": "producer", - "value": 1, - }, - ], - [ - { - "operation": "enqueue", - "phase": "start", - "source": "producer", - "value": 2, - }, - ], - [ - { - "operation": "enqueue", - "phase": "waiting", - "source": "producer", - "value": 2, - }, - ], - [ - { - "operation": "cancel", - "phase": "start", - "source": "consumer", - }, - ], - [ - { - "operation": "cancel", - "phase": "complete", - "source": "consumer", - }, - ], - [ - { - "operation": "enqueue", - "phase": "ignored", - "source": "producer", - "value": 2, - }, - ], - [ - { - "operation": "enqueue", - "phase": "start", - "source": "producer", - "value": 3, - }, - ], - [ - { - "operation": "enqueue", - "phase": "ignored", - "source": "producer", - "value": 3, - }, - ], - [ - { - "explicit": false, - "operation": "close", - "phase": "start", - "source": "producer", - }, - ], - [ - { - "explicit": false, - "operation": "close", - "phase": "ignored", - "source": "producer", - }, - ], - ] - `); + [ + { + operation: "enqueue", + phase: "start", + source: "producer", + value: 1, + }, + ], + [ + { + operation: "enqueue", + phase: "complete", + source: "producer", + value: 1, + }, + ], + [ + { + operation: "enqueue", + phase: "start", + source: "producer", + value: 2, + }, + ], + [ + { + operation: "enqueue", + phase: "waiting", + source: "producer", + value: 2, + }, + ], + [ + { + operation: "cancel", + phase: "start", + source: "consumer", + }, + ], + [ + { + operation: "cancel", + phase: "complete", + source: "consumer", + }, + ], + [ + { + operation: "enqueue", + phase: "ignored", + source: "producer", + value: 2, + }, + ], + [ + { + operation: "enqueue", + phase: "start", + source: "producer", + value: 3, + }, + ], + [ + { + operation: "enqueue", + phase: "ignored", + source: "producer", + value: 3, + }, + ], + [ + { + explicit: false, + operation: "close", + phase: "start", + source: "producer", + }, + ], + [ + { + explicit: false, + operation: "close", + phase: "ignored", + source: "producer", + }, + ], + ], + ); }); it("should allow explicit `close` call", async () => { - const log = jest.fn(); + const log = mock.fn(); const stream = new PushReadableStream( async (controller) => { await controller.enqueue(1); @@ -224,98 +228,100 @@ describe("PushReadableStream", () => { log, ); const reader = stream.getReader(); - await delay(1); + await delay(0); await reader.cancel("reason"); - expect(log.mock.calls).toMatchInlineSnapshot(` + await delay(0); + assert.deepStrictEqual( + log.mock.calls.map((call) => call.arguments), [ - [ - { - "operation": "enqueue", - "phase": "start", - "source": "producer", - "value": 1, - }, - ], - [ - { - "operation": "enqueue", - "phase": "complete", - "source": "producer", - "value": 1, - }, - ], - [ - { - "operation": "enqueue", - "phase": "start", - "source": "producer", - "value": 2, - }, - ], - [ - { - "operation": "enqueue", - "phase": "waiting", - "source": "producer", - "value": 2, - }, - ], - [ - { - "operation": "cancel", - "phase": "start", - "source": "consumer", - }, - ], - [ - { - "operation": "cancel", - "phase": "complete", - "source": "consumer", - }, - ], - [ - { - "operation": "enqueue", - "phase": "ignored", - "source": "producer", - "value": 2, - }, - ], - [ - { - "explicit": true, - "operation": "close", - "phase": "start", - "source": "producer", - }, - ], - [ - { - "explicit": true, - "operation": "close", - "phase": "ignored", - "source": "producer", - }, - ], - [ - { - "explicit": false, - "operation": "close", - "phase": "start", - "source": "producer", - }, - ], - [ - { - "explicit": false, - "operation": "close", - "phase": "ignored", - "source": "producer", - }, - ], - ] - `); + [ + { + operation: "enqueue", + phase: "start", + source: "producer", + value: 1, + }, + ], + [ + { + operation: "enqueue", + phase: "complete", + source: "producer", + value: 1, + }, + ], + [ + { + operation: "enqueue", + phase: "start", + source: "producer", + value: 2, + }, + ], + [ + { + operation: "enqueue", + phase: "waiting", + source: "producer", + value: 2, + }, + ], + [ + { + operation: "cancel", + phase: "start", + source: "consumer", + }, + ], + [ + { + operation: "cancel", + phase: "complete", + source: "consumer", + }, + ], + [ + { + operation: "enqueue", + phase: "ignored", + source: "producer", + value: 2, + }, + ], + [ + { + explicit: true, + operation: "close", + phase: "start", + source: "producer", + }, + ], + [ + { + explicit: true, + operation: "close", + phase: "ignored", + source: "producer", + }, + ], + [ + { + explicit: false, + operation: "close", + phase: "start", + source: "producer", + }, + ], + [ + { + explicit: false, + operation: "close", + phase: "ignored", + source: "producer", + }, + ], + ], + ); }); }); @@ -326,7 +332,7 @@ describe("PushReadableStream", () => { controller = controller_; }); controller.error(new Error("error")); - await expect(controller.enqueue(1)).rejects.toThrow(); + await assert.rejects(controller.enqueue(1)); }); it("should reject future `close`", () => { @@ -335,13 +341,13 @@ describe("PushReadableStream", () => { controller = controller_; }); controller.error(new Error("error")); - expect(() => controller.close()).toThrow(); + assert.throws(() => controller.close()); }); }); describe("0 high water mark", () => { it("should allow `read` before `enqueue`", async () => { - const log = jest.fn(); + const log = mock.fn(); let controller!: PushReadableStreamController; const stream = new PushReadableStream( (controller_) => { @@ -352,47 +358,51 @@ describe("PushReadableStream", () => { ); const reader = stream.getReader(); const promise = reader.read(); - await delay(1); + await delay(0); await controller.enqueue(1); - await expect(promise).resolves.toEqual({ done: false, value: 1 }); - expect(log.mock.calls).toMatchInlineSnapshot(` + assert.deepStrictEqual(await promise, { + done: false, + value: 1, + }); + assert.deepStrictEqual( + log.mock.calls.map((call) => call.arguments), [ - [ - { - "operation": "pull", - "phase": "start", - "source": "consumer", - }, - ], - [ - { - "operation": "pull", - "phase": "complete", - "source": "consumer", - }, - ], - [ - { - "operation": "enqueue", - "phase": "start", - "source": "producer", - "value": 1, - }, - ], - [ - { - "operation": "enqueue", - "phase": "complete", - "source": "producer", - "value": 1, - }, - ], - ] - `); + [ + { + operation: "pull", + phase: "start", + source: "consumer", + }, + ], + [ + { + operation: "pull", + phase: "complete", + source: "consumer", + }, + ], + [ + { + operation: "enqueue", + phase: "start", + source: "producer", + value: 1, + }, + ], + [ + { + operation: "enqueue", + phase: "complete", + source: "producer", + value: 1, + }, + ], + ], + ); }); it("should allow `enqueue` before `read`", async () => { - const log = jest.fn(); + const log = mock.fn(); const stream = new PushReadableStream( async (controller) => { await controller.enqueue(1); @@ -401,74 +411,76 @@ describe("PushReadableStream", () => { log, ); const reader = stream.getReader(); - await expect(reader.read()).resolves.toEqual({ + assert.deepStrictEqual(await reader.read(), { done: false, value: 1, }); - expect(log.mock.calls).toMatchInlineSnapshot(` + await delay(0); + assert.deepStrictEqual( + log.mock.calls.map((call) => call.arguments), [ - [ - { - "operation": "enqueue", - "phase": "start", - "source": "producer", - "value": 1, - }, - ], - [ - { - "operation": "enqueue", - "phase": "waiting", - "source": "producer", - "value": 1, - }, - ], - [ - { - "operation": "pull", - "phase": "start", - "source": "consumer", - }, - ], - [ - { - "operation": "pull", - "phase": "complete", - "source": "consumer", - }, - ], - [ - { - "operation": "enqueue", - "phase": "complete", - "source": "producer", - "value": 1, - }, - ], - [ - { - "explicit": false, - "operation": "close", - "phase": "start", - "source": "producer", - }, - ], - [ - { - "explicit": false, - "operation": "close", - "phase": "complete", - "source": "producer", - }, - ], - ] - `); + [ + { + operation: "enqueue", + phase: "start", + source: "producer", + value: 1, + }, + ], + [ + { + operation: "enqueue", + phase: "waiting", + source: "producer", + value: 1, + }, + ], + [ + { + operation: "pull", + phase: "start", + source: "consumer", + }, + ], + [ + { + operation: "pull", + phase: "complete", + source: "consumer", + }, + ], + [ + { + operation: "enqueue", + phase: "complete", + source: "producer", + value: 1, + }, + ], + [ + { + explicit: false, + operation: "close", + phase: "start", + source: "producer", + }, + ], + [ + { + explicit: false, + operation: "close", + phase: "complete", + source: "producer", + }, + ], + ], + ); }); }); describe("non 0 high water mark", () => { it("should allow `read` before `enqueue`", async () => { - const log = jest.fn(); + const log = mock.fn(); let controller!: PushReadableStreamController; const stream = new PushReadableStream( (controller_) => { @@ -479,61 +491,65 @@ describe("PushReadableStream", () => { ); const reader = stream.getReader(); const promise = reader.read(); - await delay(1); + await delay(0); await controller.enqueue(1); - await expect(promise).resolves.toEqual({ done: false, value: 1 }); - expect(log.mock.calls).toMatchInlineSnapshot(` + assert.deepStrictEqual(await promise, { + done: false, + value: 1, + }); + assert.deepStrictEqual( + log.mock.calls.map((call) => call.arguments), [ - [ - { - "operation": "pull", - "phase": "start", - "source": "consumer", - }, - ], - [ - { - "operation": "pull", - "phase": "complete", - "source": "consumer", - }, - ], - [ - { - "operation": "enqueue", - "phase": "start", - "source": "producer", - "value": 1, - }, - ], - [ - { - "operation": "pull", - "phase": "start", - "source": "consumer", - }, - ], - [ - { - "operation": "pull", - "phase": "complete", - "source": "consumer", - }, - ], - [ - { - "operation": "enqueue", - "phase": "complete", - "source": "producer", - "value": 1, - }, - ], - ] - `); + [ + { + operation: "pull", + phase: "start", + source: "consumer", + }, + ], + [ + { + operation: "pull", + phase: "complete", + source: "consumer", + }, + ], + [ + { + operation: "enqueue", + phase: "start", + source: "producer", + value: 1, + }, + ], + [ + { + operation: "pull", + phase: "start", + source: "consumer", + }, + ], + [ + { + operation: "pull", + phase: "complete", + source: "consumer", + }, + ], + [ + { + operation: "enqueue", + phase: "complete", + source: "producer", + value: 1, + }, + ], + ], + ); }); it("should allow `enqueue` before `read`", async () => { - const log = jest.fn(); + const log = mock.fn(); const stream = new PushReadableStream( async (controller) => { await controller.enqueue(1); @@ -542,60 +558,62 @@ describe("PushReadableStream", () => { log, ); const reader = stream.getReader(); - await expect(reader.read()).resolves.toEqual({ + assert.deepStrictEqual(await reader.read(), { done: false, value: 1, }); - expect(log.mock.calls).toMatchInlineSnapshot(` + await delay(0); + assert.deepStrictEqual( + log.mock.calls.map((call) => call.arguments), [ - [ - { - "operation": "enqueue", - "phase": "start", - "source": "producer", - "value": 1, - }, - ], - [ - { - "operation": "enqueue", - "phase": "complete", - "source": "producer", - "value": 1, - }, - ], - [ - { - "operation": "pull", - "phase": "start", - "source": "consumer", - }, - ], - [ - { - "operation": "pull", - "phase": "complete", - "source": "consumer", - }, - ], - [ - { - "explicit": false, - "operation": "close", - "phase": "start", - "source": "producer", - }, - ], - [ - { - "explicit": false, - "operation": "close", - "phase": "complete", - "source": "producer", - }, - ], - ] - `); + [ + { + operation: "enqueue", + phase: "start", + source: "producer", + value: 1, + }, + ], + [ + { + operation: "enqueue", + phase: "complete", + source: "producer", + value: 1, + }, + ], + [ + { + operation: "pull", + phase: "start", + source: "consumer", + }, + ], + [ + { + operation: "pull", + phase: "complete", + source: "consumer", + }, + ], + [ + { + explicit: false, + operation: "close", + phase: "start", + source: "producer", + }, + ], + [ + { + explicit: false, + operation: "close", + phase: "complete", + source: "producer", + }, + ], + ], + ); }); }); @@ -608,11 +626,11 @@ describe("PushReadableStream", () => { it("reject Promise should error the stream", async () => { const stream = new PushReadableStream(async () => { - await delay(1); + await delay(0); throw new Error("error"); }); const reader = stream.getReader(); - await expect(reader.closed).rejects.toThrow("error"); + await assert.rejects(reader.closed, /error/); }); }); @@ -622,16 +640,16 @@ describe("PushReadableStream", () => { controller.close(); }); const reader = stream.getReader(); - await expect(reader.closed).resolves.toBeUndefined(); + assert.strictEqual(await reader.closed, undefined); }); - it("should work with async `source`", () => { + it("should work with async `source`", async () => { const stream = new PushReadableStream(async (controller) => { - await delay(1); + await delay(0); controller.close(); }); const reader = stream.getReader(); - return expect(reader.closed).resolves.toBeUndefined(); + assert.strictEqual(await reader.closed, undefined); }); }); }); diff --git a/libraries/stream-extra/src/wrap-writable.spec.ts b/libraries/stream-extra/src/wrap-writable.spec.ts index bef87abf..ab77212a 100644 --- a/libraries/stream-extra/src/wrap-writable.spec.ts +++ b/libraries/stream-extra/src/wrap-writable.spec.ts @@ -1,4 +1,5 @@ -import { describe, expect, it, jest } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it, mock } from "node:test"; import { WritableStream } from "./stream.js"; import { WrapWritableStream } from "./wrap-writable.js"; @@ -9,31 +10,31 @@ describe("WrapWritableStream", () => { const stream = new WritableStream(); const wrapper = new WrapWritableStream(stream); await wrapper.close(); - expect(wrapper.writable).toBe(stream); + assert.strictEqual(wrapper.writable, stream); }); it("should accept a start function", async () => { const stream = new WritableStream(); - const start = jest.fn<() => WritableStream>(() => stream); + const start = mock.fn(() => stream); const wrapper = new WrapWritableStream(start); - await stream.close(); - expect(start).toHaveBeenCalledTimes(1); - expect(wrapper.writable).toBe(stream); + await wrapper.close(); + assert.strictEqual(start.mock.callCount(), 1); + assert.strictEqual(wrapper.writable, stream); }); it("should accept a start object", async () => { const stream = new WritableStream(); - const start = jest.fn<() => WritableStream>(() => stream); + const start = mock.fn(() => stream); const wrapper = new WrapWritableStream({ start }); await wrapper.close(); - expect(start).toHaveBeenCalledTimes(1); - expect(wrapper.writable).toBe(stream); + assert.strictEqual(start.mock.callCount(), 1); + assert.strictEqual(wrapper.writable, stream); }); }); describe("write", () => { it("should write to inner stream", async () => { - const write = jest.fn<() => void>(); + const write = mock.fn<(chunk: unknown) => void>(); const stream = new WrapWritableStream( new WritableStream({ write, @@ -43,68 +44,68 @@ describe("WrapWritableStream", () => { const data = {}; await writer.write(data); await writer.close(); - expect(write).toHaveBeenCalledTimes(1); - expect(write).toHaveBeenCalledWith(data, expect.anything()); + assert.strictEqual(write.mock.callCount(), 1); + assert.deepStrictEqual(write.mock.calls[0]!.arguments[0], data); }); }); describe("close", () => { it("should close wrapper", async () => { - const close = jest.fn<() => void>(); + const close = mock.fn<() => void>(); const stream = new WrapWritableStream({ start() { return new WritableStream(); }, close, }); - await expect(stream.close()).resolves.toBe(undefined); - expect(close).toHaveBeenCalledTimes(1); + await assert.doesNotReject(stream.close()); + assert.strictEqual(close.mock.callCount(), 1); }); it("should close inner stream", async () => { - const close = jest.fn<() => void>(); + const close = mock.fn<() => void>(); const stream = new WrapWritableStream( new WritableStream({ close, }), ); - await expect(stream.close()).resolves.toBe(undefined); - expect(close).toHaveBeenCalledTimes(1); + await assert.doesNotReject(stream.close()); + assert.strictEqual(close.mock.callCount(), 1); }); it("should not close inner stream twice", async () => { const stream = new WrapWritableStream(new WritableStream()); - await expect(stream.close()).resolves.toBe(undefined); + await assert.doesNotReject(stream.close()); }); }); describe("abort", () => { it("should close wrapper", async () => { - const close = jest.fn<() => void>(); + const close = mock.fn<() => void>(); const stream = new WrapWritableStream({ start() { return new WritableStream(); }, close, }); - await expect(stream.abort()).resolves.toBe(undefined); - expect(close).toHaveBeenCalledTimes(1); + await assert.doesNotReject(stream.abort()); + assert.strictEqual(close.mock.callCount(), 1); }); it("should abort inner stream", async () => { - const abort = jest.fn<() => void>(); + const abort = mock.fn<() => void>(); const stream = new WrapWritableStream( new WritableStream({ abort, }), ); - await expect(stream.abort()).resolves.toBe(undefined); - expect(abort).toHaveBeenCalledTimes(1); + await assert.doesNotReject(stream.abort()); + assert.strictEqual(abort.mock.callCount(), 1); }); it("should not close inner stream twice", async () => { const stream = new WrapWritableStream(new WritableStream()); - await expect(stream.abort()).resolves.toBe(undefined); + await assert.doesNotReject(stream.abort()); }); }); }); diff --git a/libraries/stream-extra/tsconfig.json b/libraries/stream-extra/tsconfig.json index 85fc5a7a..d6787a22 100644 --- a/libraries/stream-extra/tsconfig.json +++ b/libraries/stream-extra/tsconfig.json @@ -1,10 +1,10 @@ { "references": [ - { - "path": "./tsconfig.test.json" - }, { "path": "./tsconfig.build.json" }, + { + "path": "./tsconfig.test.json" + } ] } diff --git a/libraries/stream-extra/tsconfig.test.json b/libraries/stream-extra/tsconfig.test.json index a151e3c4..6a105912 100644 --- a/libraries/stream-extra/tsconfig.test.json +++ b/libraries/stream-extra/tsconfig.test.json @@ -1,7 +1,9 @@ { "extends": "./tsconfig.build.json", "compilerOptions": { - "types": [], + "types": [ + "node" + ], }, "exclude": [] } diff --git a/libraries/struct/package.json b/libraries/struct/package.json index 2d4421fd..b6c5872c 100644 --- a/libraries/struct/package.json +++ b/libraries/struct/package.json @@ -30,21 +30,19 @@ "scripts": { "build": "tsc -b tsconfig.build.json", "build:watch": "tsc -b tsconfig.build.json", - "test": "cross-env NODE_OPTIONS=\"--experimental-vm-modules --no-warnings\" TS_JEST_DISABLE_VER_CHECKER=true jest --coverage", "lint": "run-eslint && prettier src/**/*.ts --write --tab-width 4", - "prepublishOnly": "npm run build" + "prepublishOnly": "npm run build", + "test": "run-test" }, "dependencies": { "@yume-chan/no-data-view": "workspace:^0.0.24" }, "devDependencies": { - "@jest/globals": "^30.0.0-alpha.4", + "@types/node": "^20.14.9", "@yume-chan/eslint-config": "workspace:^1.0.0", + "@yume-chan/test-runner": "workspace:^1.0.0", "@yume-chan/tsconfig": "workspace:^1.0.0", - "cross-env": "^7.0.3", - "jest": "^30.0.0-alpha.4", "prettier": "^3.3.3", - "ts-jest": "^29.2.2", "typescript": "^5.5.3" } } diff --git a/libraries/struct/src/basic/definition.spec.ts b/libraries/struct/src/basic/definition.spec.ts index 2afa92fe..d92065d5 100644 --- a/libraries/struct/src/basic/definition.spec.ts +++ b/libraries/struct/src/basic/definition.spec.ts @@ -1,4 +1,5 @@ -import { describe, expect, it } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it } from "node:test"; import type { ValueOrPromise } from "../utils.js"; @@ -50,7 +51,7 @@ describe("StructFieldDefinition", () => { } } - expect(new MockFieldDefinition(42)).toHaveProperty("options", 42); + assert.strictEqual(new MockFieldDefinition(42).options, 42); }); }); }); diff --git a/libraries/struct/src/basic/field-value.spec.ts b/libraries/struct/src/basic/field-value.spec.ts index 3930c8c1..f6f10edc 100644 --- a/libraries/struct/src/basic/field-value.spec.ts +++ b/libraries/struct/src/basic/field-value.spec.ts @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ -import { describe, expect, it } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it } from "node:test"; import type { ValueOrPromise } from "../utils.js"; @@ -31,10 +32,10 @@ describe("StructFieldValue", () => { struct as never, value as never, ); - expect(fieldValue).toHaveProperty("definition", definition); - expect(fieldValue).toHaveProperty("options", options); - expect(fieldValue).toHaveProperty("struct", struct); - expect(fieldValue.get()).toBe(value); + assert.strictEqual(fieldValue.definition, definition); + assert.strictEqual(fieldValue.options, options); + assert.strictEqual(fieldValue.struct, struct); + assert.strictEqual(fieldValue.get(), value); }); }); @@ -92,7 +93,7 @@ describe("StructFieldValue", () => { undefined as never, undefined as never, ); - expect(fieldValue.getSize()).toBe(42); + assert.strictEqual(fieldValue.getSize(), 42); }); }); @@ -113,10 +114,10 @@ describe("StructFieldValue", () => { undefined as never, ); fieldValue.set(1); - expect(fieldValue.get()).toBe(1); + assert.strictEqual(fieldValue.get(), 1); fieldValue.set(2); - expect(fieldValue.get()).toBe(2); + assert.strictEqual(fieldValue.get(), 2); }); }); }); diff --git a/libraries/struct/src/basic/options.spec.ts b/libraries/struct/src/basic/options.spec.ts index 0316ba6b..34a7fa74 100644 --- a/libraries/struct/src/basic/options.spec.ts +++ b/libraries/struct/src/basic/options.spec.ts @@ -1,11 +1,12 @@ -import { describe, expect, it } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it } from "node:test"; import { StructDefaultOptions } from "./options.js"; describe("StructDefaultOptions", () => { describe(".littleEndian", () => { it("should be `false`", () => { - expect(StructDefaultOptions).toHaveProperty("littleEndian", false); + assert.strictEqual(StructDefaultOptions.littleEndian, false); }); }); }); diff --git a/libraries/struct/src/basic/struct-value.spec.ts b/libraries/struct/src/basic/struct-value.spec.ts index 256f5cf4..18811cd5 100644 --- a/libraries/struct/src/basic/struct-value.spec.ts +++ b/libraries/struct/src/basic/struct-value.spec.ts @@ -1,4 +1,5 @@ -import { describe, expect, it, jest } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it, mock } from "node:test"; import type { StructFieldDefinition } from "./definition.js"; import type { StructFieldValue } from "./field-value.js"; @@ -10,12 +11,12 @@ describe("StructValue", () => { const foo = new StructValue({}); const bar = new StructValue({}); - expect(foo).toHaveProperty("fieldValues", {}); - expect(foo).toHaveProperty("value", {}); - expect(bar).toHaveProperty("fieldValues", {}); - expect(bar).toHaveProperty("value", {}); - expect(foo.fieldValues).not.toBe(bar.fieldValues); - expect(foo.value).not.toBe(bar.fieldValues); + assert.deepStrictEqual(foo.fieldValues, {}); + assert.deepEqual(foo.value, {}); + assert.deepStrictEqual(bar.fieldValues, {}); + assert.deepEqual(bar.value, {}); + assert.notStrictEqual(foo.fieldValues, bar.fieldValues); + assert.notStrictEqual(foo.value, bar.fieldValues); }); }); @@ -43,16 +44,16 @@ describe("StructValue", () => { >; object.set(bar, barValue); - expect(object.fieldValues[foo]).toBe(fooValue); - expect(object.fieldValues[bar]).toBe(barValue); + assert.strictEqual(object.fieldValues[foo], fooValue); + assert.strictEqual(object.fieldValues[bar], barValue); }); it("should define a property for `key`", () => { const object = new StructValue({}); const foo = "foo"; - const fooGetter = jest.fn(() => 42); - const fooSetter = jest.fn((value: number) => { + const fooGetter = mock.fn(() => 42); + const fooSetter = mock.fn((value: number) => { void value; }); const fooValue = { @@ -64,8 +65,8 @@ describe("StructValue", () => { object.set(foo, fooValue); const bar = "bar"; - const barGetter = jest.fn(() => true); - const barSetter = jest.fn((value: boolean) => { + const barGetter = mock.fn(() => true); + const barSetter = mock.fn((value: boolean) => { void value; }); const barValue = { @@ -76,13 +77,13 @@ describe("StructValue", () => { >; object.set(bar, barValue); - expect(object.value).toHaveProperty(foo, 42); - expect(fooGetter).toHaveBeenCalledTimes(1); - expect(barGetter).toHaveBeenCalledTimes(1); + assert.strictEqual(object.value[foo], 42); + assert.strictEqual(fooGetter.mock.callCount(), 1); + assert.strictEqual(barGetter.mock.callCount(), 1); object.value[foo] = 100; - expect(fooSetter).toHaveBeenCalledTimes(0); - expect(barSetter).toHaveBeenCalledTimes(0); + assert.strictEqual(fooSetter.mock.callCount(), 0); + assert.strictEqual(barSetter.mock.callCount(), 0); }); }); @@ -100,7 +101,7 @@ describe("StructValue", () => { >; object.set(foo, fooValue); - expect(object.get(foo)).toBe(fooValue); + assert.strictEqual(object.get(foo), fooValue); }); }); }); diff --git a/libraries/struct/src/index.spec.ts b/libraries/struct/src/index.spec.ts index b8599260..8aee6845 100644 --- a/libraries/struct/src/index.spec.ts +++ b/libraries/struct/src/index.spec.ts @@ -1,11 +1,12 @@ -import { describe, expect, it } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it } from "node:test"; import Struct from "./index.js"; describe("Struct", () => { describe("Index", () => { it("should export default Struct", () => { - expect(Struct).toBeDefined(); + assert.ok(Struct); }); }); }); diff --git a/libraries/struct/src/struct.spec.ts b/libraries/struct/src/struct.spec.ts index e5748a1a..19c2c027 100644 --- a/libraries/struct/src/struct.spec.ts +++ b/libraries/struct/src/struct.spec.ts @@ -1,4 +1,5 @@ -import { describe, expect, it, jest } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it, mock } from "node:test"; import type { AsyncExactReadable, @@ -26,15 +27,15 @@ class MockDeserializationStream implements ExactReadable { position = 0; - readExactly = jest.fn(() => this.buffer); + readExactly = mock.fn(() => this.buffer); } describe("Struct", () => { describe(".constructor", () => { it("should initialize fields", () => { const struct = new Struct(); - expect(struct).toHaveProperty("options", StructDefaultOptions); - expect(struct).toHaveProperty("size", 0); + assert.deepStrictEqual(struct.options, StructDefaultOptions); + assert.strictEqual(struct.size, 0); }); }); @@ -44,7 +45,7 @@ describe("Struct", () => { super(size); } - getSize = jest.fn(() => { + getSize = mock.fn(() => { return this.options; }); @@ -87,16 +88,16 @@ describe("Struct", () => { const fieldDefinition1 = new MockFieldDefinition(4); struct.field(field1, fieldDefinition1); - expect(struct).toHaveProperty("size", 4); - expect(fieldDefinition1.getSize).toHaveBeenCalledTimes(1); - expect(struct.fields).toEqual([[field1, fieldDefinition1]]); + assert.strictEqual(struct.size, 4); + assert.strictEqual(fieldDefinition1.getSize.mock.callCount(), 1); + assert.deepStrictEqual(struct.fields, [[field1, fieldDefinition1]]); const field2 = "bar"; const fieldDefinition2 = new MockFieldDefinition(8); struct.field(field2, fieldDefinition2); - expect(struct).toHaveProperty("size", 12); - expect(fieldDefinition2.getSize).toHaveBeenCalledTimes(1); - expect(struct.fields).toEqual([ + assert.strictEqual(struct.size, 12); + assert.strictEqual(fieldDefinition2.getSize.mock.callCount(), 1); + assert.deepStrictEqual(struct.fields, [ [field1, fieldDefinition1], [field2, fieldDefinition2], ]); @@ -106,9 +107,9 @@ describe("Struct", () => { const struct = new Struct(); const fieldName = "foo"; struct.field(fieldName, new MockFieldDefinition(4)); - expect(() => - struct.field(fieldName, new MockFieldDefinition(4)), - ).toThrow(); + assert.throws(() => { + struct.field(fieldName, new MockFieldDefinition(4)); + }); }); }); @@ -116,81 +117,81 @@ describe("Struct", () => { it("`int8` should append an `int8` field", () => { const struct = new Struct(); struct.int8("foo"); - expect(struct).toHaveProperty("size", 1); + assert.strictEqual(struct.size, 1); const definition = struct.fields[0]![1] as NumberFieldDefinition; - expect(definition).toBeInstanceOf(NumberFieldDefinition); - expect(definition.variant).toBe(NumberFieldVariant.Int8); + assert.ok(definition instanceof NumberFieldDefinition); + assert.strictEqual(definition.variant, NumberFieldVariant.Int8); }); it("`uint8` should append an `uint8` field", () => { const struct = new Struct(); struct.uint8("foo"); - expect(struct).toHaveProperty("size", 1); + assert.strictEqual(struct.size, 1); const definition = struct.fields[0]![1] as NumberFieldDefinition; - expect(definition).toBeInstanceOf(NumberFieldDefinition); - expect(definition.variant).toBe(NumberFieldVariant.Uint8); + assert.ok(definition instanceof NumberFieldDefinition); + assert.strictEqual(definition.variant, NumberFieldVariant.Uint8); }); it("`int16` should append an `int16` field", () => { const struct = new Struct(); struct.int16("foo"); - expect(struct).toHaveProperty("size", 2); + assert.strictEqual(struct.size, 2); const definition = struct.fields[0]![1] as NumberFieldDefinition; - expect(definition).toBeInstanceOf(NumberFieldDefinition); - expect(definition.variant).toBe(NumberFieldVariant.Int16); + assert.ok(definition instanceof NumberFieldDefinition); + assert.strictEqual(definition.variant, NumberFieldVariant.Int16); }); it("`uint16` should append an `uint16` field", () => { const struct = new Struct(); struct.uint16("foo"); - expect(struct).toHaveProperty("size", 2); + assert.strictEqual(struct.size, 2); const definition = struct.fields[0]![1] as NumberFieldDefinition; - expect(definition).toBeInstanceOf(NumberFieldDefinition); - expect(definition.variant).toBe(NumberFieldVariant.Uint16); + assert.ok(definition instanceof NumberFieldDefinition); + assert.strictEqual(definition.variant, NumberFieldVariant.Uint16); }); it("`int32` should append an `int32` field", () => { const struct = new Struct(); struct.int32("foo"); - expect(struct).toHaveProperty("size", 4); + assert.strictEqual(struct.size, 4); const definition = struct.fields[0]![1] as NumberFieldDefinition; - expect(definition).toBeInstanceOf(NumberFieldDefinition); - expect(definition.variant).toBe(NumberFieldVariant.Int32); + assert.ok(definition instanceof NumberFieldDefinition); + assert.strictEqual(definition.variant, NumberFieldVariant.Int32); }); it("`uint32` should append an `uint32` field", () => { const struct = new Struct(); struct.uint32("foo"); - expect(struct).toHaveProperty("size", 4); + assert.strictEqual(struct.size, 4); const definition = struct.fields[0]![1] as NumberFieldDefinition; - expect(definition).toBeInstanceOf(NumberFieldDefinition); - expect(definition.variant).toBe(NumberFieldVariant.Uint32); + assert.ok(definition instanceof NumberFieldDefinition); + assert.strictEqual(definition.variant, NumberFieldVariant.Uint32); }); it("`int64` should append an `int64` field", () => { const struct = new Struct(); struct.int64("foo"); - expect(struct).toHaveProperty("size", 8); + assert.strictEqual(struct.size, 8); const definition = struct.fields[0]![1] as BigIntFieldDefinition; - expect(definition).toBeInstanceOf(BigIntFieldDefinition); - expect(definition.variant).toBe(BigIntFieldVariant.Int64); + assert.ok(definition instanceof BigIntFieldDefinition); + assert.strictEqual(definition.variant, BigIntFieldVariant.Int64); }); it("`uint64` should append an `uint64` field", () => { const struct = new Struct(); struct.uint64("foo"); - expect(struct).toHaveProperty("size", 8); + assert.strictEqual(struct.size, 8); const definition = struct.fields[0]![1] as BigIntFieldDefinition; - expect(definition).toBeInstanceOf(BigIntFieldDefinition); - expect(definition.variant).toBe(BigIntFieldVariant.Uint64); + assert.ok(definition instanceof BigIntFieldDefinition); + assert.strictEqual(definition.variant, BigIntFieldVariant.Uint64); }); describe("#uint8ArrayLike", () => { @@ -198,71 +199,81 @@ describe("Struct", () => { it("`#uint8Array` with fixed length", () => { const struct = new Struct(); struct.uint8Array("foo", { length: 10 }); - expect(struct).toHaveProperty("size", 10); + assert.strictEqual(struct.size, 10); const definition = struct .fields[0]![1] as FixedLengthBufferLikeFieldDefinition; - expect(definition).toBeInstanceOf( - FixedLengthBufferLikeFieldDefinition, + assert.ok( + definition instanceof + FixedLengthBufferLikeFieldDefinition, ); - expect(definition.converter).toBeInstanceOf( - BufferFieldConverter, + assert.ok( + definition.converter instanceof BufferFieldConverter, ); - expect(definition.options.length).toBe(10); + assert.strictEqual(definition.options.length, 10); }); it("`#string` with fixed length", () => { const struct = new Struct(); struct.string("foo", { length: 10 }); - expect(struct).toHaveProperty("size", 10); + assert.strictEqual(struct.size, 10); const definition = struct .fields[0]![1] as FixedLengthBufferLikeFieldDefinition; - expect(definition).toBeInstanceOf( - FixedLengthBufferLikeFieldDefinition, + assert.ok( + definition instanceof + FixedLengthBufferLikeFieldDefinition, ); - expect(definition.converter).toBeInstanceOf( - BufferFieldConverter, + assert.ok( + definition.converter instanceof BufferFieldConverter, ); - expect(definition.options.length).toBe(10); + assert.strictEqual(definition.options.length, 10); }); }); describe("VariableLengthBufferLikeFieldDefinition", () => { it("`#uint8Array` with variable length", () => { const struct = new Struct().int8("barLength"); - expect(struct).toHaveProperty("size", 1); + assert.strictEqual(struct.size, 1); struct.uint8Array("bar", { lengthField: "barLength" }); - expect(struct).toHaveProperty("size", 1); + assert.strictEqual(struct.size, 1); const definition = struct .fields[1]![1] as VariableLengthBufferLikeFieldDefinition; - expect(definition).toBeInstanceOf( - VariableLengthBufferLikeFieldDefinition, + assert.ok( + definition instanceof + VariableLengthBufferLikeFieldDefinition, ); - expect(definition.converter).toBeInstanceOf( - BufferFieldConverter, + assert.ok( + definition.converter instanceof BufferFieldConverter, + ); + assert.strictEqual( + definition.options.lengthField, + "barLength", ); - expect(definition.options.lengthField).toBe("barLength"); }); it("`#string` with variable length", () => { const struct = new Struct().int8("barLength"); - expect(struct).toHaveProperty("size", 1); + assert.strictEqual(struct.size, 1); struct.string("bar", { lengthField: "barLength" }); - expect(struct).toHaveProperty("size", 1); + assert.strictEqual(struct.size, 1); const definition = struct .fields[1]![1] as VariableLengthBufferLikeFieldDefinition; - expect(definition).toBeInstanceOf( - VariableLengthBufferLikeFieldDefinition, + assert.ok( + definition instanceof + VariableLengthBufferLikeFieldDefinition, ); - expect(definition.converter).toBeInstanceOf( - BufferFieldConverter, + assert.ok( + definition.converter instanceof BufferFieldConverter, + ); + assert.strictEqual( + definition.options.lengthField, + "barLength", ); - expect(definition.options.lengthField).toBe("barLength"); }); }); }); @@ -277,32 +288,25 @@ describe("Struct", () => { .int64("int64"); const field0 = struct.fields[0]!; - expect(field0).toHaveProperty("0", "int8"); - expect(field0[1]).toHaveProperty( - "variant", + assert.strictEqual(field0[0], "int8"); + assert.strictEqual( + (field0[1] as NumberFieldDefinition).variant, NumberFieldVariant.Int8, ); const field1 = struct.fields[1]!; - expect(field1).toHaveProperty("0", "int16"); - expect(field1[1]).toHaveProperty( - "variant", + assert.strictEqual(field1[0], "int16"); + assert.strictEqual( + (field1[1] as NumberFieldDefinition).variant, NumberFieldVariant.Int16, ); const field2 = struct.fields[2]!; - expect(field2).toHaveProperty("0", "int32"); - expect(field2[1]).toHaveProperty( - "variant", + assert.strictEqual(field2[0], "int32"); + assert.strictEqual( + (field2[1] as NumberFieldDefinition).variant, NumberFieldVariant.Int32, ); - - const field3 = struct.fields[3]!; - expect(field3).toHaveProperty("0", "int64"); - expect(field3[1]).toHaveProperty( - "variant", - BigIntFieldVariant.Int64, - ); }); }); @@ -311,16 +315,27 @@ describe("Struct", () => { const struct = new Struct().int8("foo").int16("bar"); const stream = new MockDeserializationStream(); - stream.readExactly - .mockReturnValueOnce(new Uint8Array([2])) - .mockReturnValueOnce(new Uint8Array([0, 16])); + stream.readExactly.mock.mockImplementationOnce( + () => new Uint8Array([2]), + 0, + ); + stream.readExactly.mock.mockImplementationOnce( + () => new Uint8Array([0, 16]), + 1, + ); const result = struct.deserialize(stream); - expect(result).toEqual({ foo: 2, bar: 16 }); + assert.deepEqual(result, { foo: 2, bar: 16 }); - expect(stream.readExactly).toHaveBeenCalledTimes(2); - expect(stream.readExactly).toHaveBeenNthCalledWith(1, 1); - expect(stream.readExactly).toHaveBeenNthCalledWith(2, 2); + assert.strictEqual(stream.readExactly.mock.callCount(), 2); + assert.deepStrictEqual( + stream.readExactly.mock.calls[0]!.arguments, + [1], + ); + assert.deepStrictEqual( + stream.readExactly.mock.calls[1]!.arguments, + [2], + ); }); it("should deserialize with dynamic size fields", () => { @@ -329,18 +344,33 @@ describe("Struct", () => { .uint8Array("foo", { lengthField: "fooLength" }); const stream = new MockDeserializationStream(); - stream.readExactly - .mockReturnValueOnce(new Uint8Array([2])) - .mockReturnValueOnce(new Uint8Array([3, 4])); + stream.readExactly.mock.mockImplementationOnce( + () => new Uint8Array([2]), + 0, + ); + stream.readExactly.mock.mockImplementationOnce( + () => new Uint8Array([3, 4]), + 1, + ); const result = struct.deserialize(stream); - expect(result).toEqual({ - fooLength: 2, - foo: new Uint8Array([3, 4]), + assert.deepEqual(result, { + get fooLength() { + return 2; + }, + get foo() { + return new Uint8Array([3, 4]); + }, }); - expect(stream.readExactly).toHaveBeenCalledTimes(2); - expect(stream.readExactly).toHaveBeenNthCalledWith(1, 1); - expect(stream.readExactly).toHaveBeenNthCalledWith(2, 2); + assert.strictEqual(stream.readExactly.mock.callCount(), 2); + assert.deepStrictEqual( + stream.readExactly.mock.calls[0]!.arguments, + [1], + ); + assert.deepStrictEqual( + stream.readExactly.mock.calls[1]!.arguments, + [2], + ); }); }); @@ -351,32 +381,33 @@ describe("Struct", () => { const stream = new MockDeserializationStream(); const result = struct.deserialize(stream); - expect( + assert.deepStrictEqual( Object.entries( Object.getOwnPropertyDescriptors( Object.getPrototypeOf(result), ), ), - ).toEqual([ [ - "foo", - { - configurable: true, - enumerable: true, - writable: true, - value: 42, - }, + [ + "foo", + { + configurable: true, + enumerable: true, + writable: true, + value: 42, + }, + ], + [ + "bar", + { + configurable: true, + enumerable: true, + writable: true, + value: true, + }, + ], ], - [ - "bar", - { - configurable: true, - enumerable: true, - writable: true, - value: true, - }, - ], - ]); + ); }); it("should accept accessors", () => { @@ -395,85 +426,67 @@ describe("Struct", () => { const stream = new MockDeserializationStream(); const result = struct.deserialize(stream); - expect( - Object.entries( - Object.getOwnPropertyDescriptors( - Object.getPrototypeOf(result), - ), - ), - ).toEqual([ - [ - "foo", - { - configurable: true, - enumerable: true, - get: expect.any(Function), - }, - ], - [ - "bar", - { - configurable: true, - enumerable: true, - get: expect.any(Function), - set: expect.any(Function), - }, - ], - ]); + const properties = Object.getOwnPropertyDescriptors( + Object.getPrototypeOf(result), + ); + assert.strictEqual(properties.foo?.configurable, true); + assert.strictEqual(properties.foo?.enumerable, true); + assert.strictEqual(properties.bar?.configurable, true); + assert.strictEqual(properties.bar?.enumerable, true); }); }); describe("#postDeserialize", () => { it("can throw errors", () => { const struct = new Struct(); - const callback = jest.fn(() => { + const callback = mock.fn(() => { throw new Error("mock"); }); struct.postDeserialize(callback); const stream = new MockDeserializationStream(); - expect(() => struct.deserialize(stream)).toThrow("mock"); - expect(callback).toHaveBeenCalledTimes(1); + assert.throws(() => struct.deserialize(stream), /mock/); + assert.strictEqual(callback.mock.callCount(), 1); }); it("can replace return value", () => { const struct = new Struct(); - const callback = jest.fn(() => "mock"); + const callback = mock.fn(() => "mock"); struct.postDeserialize(callback); const stream = new MockDeserializationStream(); - expect(struct.deserialize(stream)).toBe("mock"); - expect(callback).toHaveBeenCalledTimes(1); - expect(callback).toHaveBeenCalledWith({}); + assert.strictEqual(struct.deserialize(stream), "mock"); + assert.strictEqual(callback.mock.callCount(), 1); + assert.deepEqual(callback.mock.calls[0]?.arguments, [{}]); }); it("can return nothing", () => { const struct = new Struct(); - const callback = jest.fn(); + const callback = mock.fn(); struct.postDeserialize(callback); const stream = new MockDeserializationStream(); const result = struct.deserialize(stream); - expect(callback).toHaveBeenCalledTimes(1); - expect(callback).toHaveBeenCalledWith(result); + assert.strictEqual(callback.mock.callCount(), 1); + assert.deepEqual(callback.mock.calls[0]?.arguments, [result]); }); it("should overwrite callback", () => { const struct = new Struct(); - const callback1 = jest.fn(); + const callback1 = mock.fn(); struct.postDeserialize(callback1); - const callback2 = jest.fn(); + const callback2 = mock.fn(); struct.postDeserialize(callback2); const stream = new MockDeserializationStream(); struct.deserialize(stream); - expect(callback1).toHaveBeenCalledTimes(0); - expect(callback2).toHaveBeenCalledTimes(1); - expect(callback2).toHaveBeenCalledWith({}); + assert.strictEqual(callback1.mock.callCount(), 0); + assert.strictEqual(callback2.mock.callCount(), 1); + assert.deepEqual(callback2.mock.calls[0]?.arguments, [{}]); }); }); @@ -485,7 +498,10 @@ describe("Struct", () => { struct.serialize({ foo: 0x42, bar: 0x1024 }), ); - expect(result).toEqual(new Uint8Array([0x42, 0x10, 0x24])); + assert.deepStrictEqual( + result, + new Uint8Array([0x42, 0x10, 0x24]), + ); }); it("should serialize with dynamic size fields", () => { @@ -499,7 +515,8 @@ describe("Struct", () => { }), ); - expect(result).toEqual( + assert.deepStrictEqual( + result, new Uint8Array([0x03, 0x03, 0x04, 0x05]), ); }); diff --git a/libraries/struct/src/sync-promise.spec.ts b/libraries/struct/src/sync-promise.spec.ts index 7954a4b6..b05662e0 100644 --- a/libraries/struct/src/sync-promise.spec.ts +++ b/libraries/struct/src/sync-promise.spec.ts @@ -1,4 +1,5 @@ -import { describe, expect, it, jest } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it, mock } from "node:test"; import { SyncPromise } from "./sync-promise.js"; @@ -10,117 +11,123 @@ describe("SyncPromise", () => { describe(".resolve", () => { it("should resolve with undefined", () => { const promise = SyncPromise.resolve(); - expect(promise.valueOrPromise()).toBe(undefined); + assert.strictEqual(promise.valueOrPromise(), undefined); }); it("should resolve with a value", () => { const promise = SyncPromise.resolve(42); - expect(promise.valueOrPromise()).toBe(42); + assert.strictEqual(promise.valueOrPromise(), 42); }); it("should resolve with a promise", async () => { const promise = SyncPromise.resolve(Promise.resolve(42)); - await expect(promise.valueOrPromise()).resolves.toBe(42); + const value = promise.valueOrPromise(); + assert.ok(value instanceof Promise); + assert.strictEqual(await value, 42); }); it("should resolve with a pending SyncPromise", async () => { const promise = SyncPromise.resolve( SyncPromise.resolve(Promise.resolve(42)), ); - await expect(promise.valueOrPromise()).resolves.toBe(42); + const value = promise.valueOrPromise(); + assert.ok(value instanceof Promise); + assert.strictEqual(await value, 42); }); it("should resolve with a resolved SyncPromise", () => { const promise = SyncPromise.resolve(SyncPromise.resolve(42)); - expect(promise.valueOrPromise()).toBe(42); + assert.strictEqual(promise.valueOrPromise(), 42); }); it("should resolve with a rejected SyncPromise", () => { const promise = SyncPromise.resolve( - SyncPromise.reject(new Error("error")), + SyncPromise.reject(new Error("SyncPromise error")), ); - expect(() => promise.valueOrPromise()).toThrow("error"); + assert.throws(() => promise.valueOrPromise(), /SyncPromise error/); }); }); describe(".reject", () => { it("should reject with the reason", () => { const promise = SyncPromise.reject(new Error("error")); - expect(() => promise.valueOrPromise()).toThrow("error"); + assert.throws(() => promise.valueOrPromise(), { message: "error" }); }); }); describe(".try", () => { it("should call executor", () => { - const executor = jest.fn(() => { + const executor = mock.fn(() => { return 42; }); void SyncPromise.try(executor); - expect(executor).toHaveBeenCalledTimes(1); + assert.strictEqual(executor.mock.callCount(), 1); }); it("should resolve with a value", () => { const promise = SyncPromise.try(() => 42); - expect(promise.valueOrPromise()).toBe(42); + assert.strictEqual(promise.valueOrPromise(), 42); }); it("should resolve with a promise", async () => { const promise = SyncPromise.try(() => Promise.resolve(42)); - await expect(promise.valueOrPromise()).resolves.toBe(42); + const value = promise.valueOrPromise(); + assert.ok(value instanceof Promise); + assert.strictEqual(await value, 42); }); it("should resolve with a pending SyncPromise", async () => { const promise = SyncPromise.try(() => SyncPromise.resolve(Promise.resolve(42)), ); - await expect(promise.valueOrPromise()).resolves.toBe(42); + const value = promise.valueOrPromise(); + assert.ok(value instanceof Promise); + assert.strictEqual(await value, 42); }); it("should resolve with a resolved SyncPromise", () => { const promise = SyncPromise.try(() => SyncPromise.resolve(42)); - expect(promise.valueOrPromise()).toBe(42); + assert.strictEqual(promise.valueOrPromise(), 42); }); it("should resolve with a rejected SyncPromise", () => { const promise = SyncPromise.try(() => SyncPromise.reject(new Error("error")), ); - expect(() => promise.valueOrPromise()).toThrow("error"); + assert.throws(() => promise.valueOrPromise(), { message: "error" }); }); it("should reject with the error thrown", () => { const promise = SyncPromise.try(() => { throw new Error("error"); }); - expect(() => promise.valueOrPromise()).toThrow("error"); + assert.throws(() => promise.valueOrPromise(), { message: "error" }); }); }); describe("#then", () => { it("chain a pending SyncPromise with value", async () => { const promise = SyncPromise.resolve(Promise.resolve(42)); - const handler = jest.fn(() => "foo"); + const handler = mock.fn(() => "foo"); const result = promise.then(handler); await delay(0); + assert.strictEqual(handler.mock.callCount(), 1); + assert.deepStrictEqual(handler.mock.calls[0]!.arguments, [42]); - expect(handler).toHaveBeenCalledTimes(1); - expect(handler).toHaveBeenCalledWith(42); - - await expect(result.valueOrPromise()).resolves.toBe("foo"); + assert.strictEqual(await result.valueOrPromise(), "foo"); }); it("chian a pending SyncPromise with a promise", async () => { const promise = SyncPromise.resolve(Promise.resolve(42)); - const handler = jest.fn(() => Promise.resolve("foo")); + const handler = mock.fn(() => Promise.resolve("foo")); const result = promise.then(handler); await delay(0); - expect(handler).toHaveBeenCalledTimes(1); - expect(handler).toHaveBeenCalledWith(42); - - await expect(result.valueOrPromise()).resolves.toBe("foo"); + assert.strictEqual(handler.mock.callCount(), 1); + assert.deepStrictEqual(handler.mock.calls[0]!.arguments, [42]); + assert.strictEqual(await result.valueOrPromise(), "foo"); }); }); }); diff --git a/libraries/struct/src/types/buffer/base.spec.ts b/libraries/struct/src/types/buffer/base.spec.ts index b39bf4fb..1f199696 100644 --- a/libraries/struct/src/types/buffer/base.spec.ts +++ b/libraries/struct/src/types/buffer/base.spec.ts @@ -1,4 +1,5 @@ -import { describe, expect, it, jest } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it, mock } from "node:test"; import type { ExactReadable } from "../../basic/index.js"; import { StructDefaultOptions, StructValue } from "../../basic/index.js"; @@ -16,65 +17,73 @@ class MockDeserializationStream implements ExactReadable { position = 0; - readExactly = jest.fn(() => this.array); + readExactly = mock.fn(() => this.array); } describe("Types", () => { describe("Buffer", () => { describe("Uint8ArrayBufferFieldSubType", () => { it("should have a static instance", () => { - expect(Uint8ArrayBufferFieldConverter.Instance).toBeInstanceOf( - Uint8ArrayBufferFieldConverter, + assert.ok( + Uint8ArrayBufferFieldConverter.Instance instanceof + Uint8ArrayBufferFieldConverter, ); }); it("`#toBuffer` should return the same `Uint8Array`", () => { const array = new Uint8Array(10); - expect( + assert.strictEqual( Uint8ArrayBufferFieldConverter.Instance.toBuffer(array), - ).toBe(array); + array, + ); }); it("`#fromBuffer` should return the same `Uint8Array`", () => { const buffer = new Uint8Array(10); - expect( + assert.strictEqual( Uint8ArrayBufferFieldConverter.Instance.toValue(buffer), - ).toBe(buffer); + buffer, + ); }); it("`#getSize` should return the `byteLength` of the `Uint8Array`", () => { const array = new Uint8Array(10); - expect( + assert.strictEqual( Uint8ArrayBufferFieldConverter.Instance.getSize(array), - ).toBe(10); + 10, + ); }); }); describe("StringBufferFieldSubType", () => { it("should have a static instance", () => { - expect(StringBufferFieldConverter.Instance).toBeInstanceOf( - StringBufferFieldConverter, + assert.ok( + StringBufferFieldConverter.Instance instanceof + StringBufferFieldConverter, ); }); it("`#toBuffer` should return the decoded string", () => { const text = "foo"; const array = new Uint8Array(Buffer.from(text, "utf-8")); - expect( + assert.deepStrictEqual( StringBufferFieldConverter.Instance.toBuffer(text), - ).toEqual(array); + array, + ); }); it("`#fromBuffer` should return the encoded ArrayBuffer", () => { const text = "foo"; const array = new Uint8Array(Buffer.from(text, "utf-8")); - expect(StringBufferFieldConverter.Instance.toValue(array)).toBe( + assert.strictEqual( + StringBufferFieldConverter.Instance.toValue(array), text, ); }); it("`#getSize` should return -1", () => { - expect(StringBufferFieldConverter.Instance.getSize()).toBe( + assert.strictEqual( + StringBufferFieldConverter.Instance.getSize(), undefined, ); }); @@ -106,11 +115,14 @@ describe("Types", () => { context, struct, ); - expect(context.readExactly).toHaveBeenCalledTimes(1); - expect(context.readExactly).toHaveBeenCalledWith(size); - expect(fieldValue).toHaveProperty("array", array); + assert.strictEqual(context.readExactly.mock.callCount(), 1); + assert.deepStrictEqual( + context.readExactly.mock.calls[0]?.arguments, + [size], + ); + assert.strictEqual(fieldValue["array"], array); - expect(fieldValue.get()).toBe(array); + assert.strictEqual(fieldValue.get(), array); }); it("should work when `#getSize` returns `0`", () => { @@ -130,13 +142,13 @@ describe("Types", () => { context, struct, ); - expect(context.readExactly).toHaveBeenCalledTimes(0); - expect(fieldValue["array"]).toBeInstanceOf(Uint8Array); - expect(fieldValue["array"]).toHaveProperty("byteLength", 0); + assert.strictEqual(context.readExactly.mock.callCount(), 0); + assert.ok(fieldValue["array"] instanceof Uint8Array); + assert.strictEqual(fieldValue["array"].byteLength, 0); const value = fieldValue.get(); - expect(value).toBeInstanceOf(Uint8Array); - expect(value).toHaveProperty("byteLength", 0); + assert.ok(value instanceof Uint8Array); + assert.strictEqual(value.byteLength, 0); }); }); @@ -162,8 +174,8 @@ describe("Types", () => { const newValue = new Uint8Array(20); fieldValue.set(newValue); - expect(fieldValue.get()).toBe(newValue); - expect(fieldValue).toHaveProperty("array", undefined); + assert.deepStrictEqual(fieldValue.get(), newValue); + assert.strictEqual(fieldValue["array"], undefined); }); }); @@ -192,7 +204,7 @@ describe("Types", () => { const targetArray = new Uint8Array(size); fieldValue.serialize(targetArray, 0); - expect(targetArray).toEqual(sourceArray); + assert.deepStrictEqual(targetArray, sourceArray); }); it("should be able to serialize a modified value", () => { @@ -221,7 +233,7 @@ describe("Types", () => { const targetArray = new Uint8Array(size); fieldValue.serialize(targetArray, 0); - expect(targetArray).toEqual(sourceArray); + assert.deepStrictEqual(targetArray, sourceArray); }); }); }); diff --git a/libraries/struct/src/types/buffer/fixed-length.spec.ts b/libraries/struct/src/types/buffer/fixed-length.spec.ts index 7c26c354..e92e306a 100644 --- a/libraries/struct/src/types/buffer/fixed-length.spec.ts +++ b/libraries/struct/src/types/buffer/fixed-length.spec.ts @@ -1,4 +1,5 @@ -import { describe, expect, it } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it } from "node:test"; import { Uint8ArrayBufferFieldConverter } from "./base.js"; import { FixedLengthBufferLikeFieldDefinition } from "./fixed-length.js"; @@ -11,7 +12,7 @@ describe("Types", () => { Uint8ArrayBufferFieldConverter.Instance, { length: 10 }, ); - expect(definition.getSize()).toBe(10); + assert.strictEqual(definition.getSize(), 10); }); }); }); diff --git a/libraries/struct/src/types/buffer/variable-length.spec.ts b/libraries/struct/src/types/buffer/variable-length.spec.ts index 99e591fa..54c9697e 100644 --- a/libraries/struct/src/types/buffer/variable-length.spec.ts +++ b/libraries/struct/src/types/buffer/variable-length.spec.ts @@ -2,7 +2,8 @@ /* eslint-disable @typescript-eslint/no-unsafe-argument */ /* eslint-disable @typescript-eslint/no-explicit-any */ -import { describe, expect, it, jest } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it, mock } from "node:test"; import { StructDefaultOptions, @@ -29,17 +30,17 @@ class MockLengthFieldValue extends StructFieldValue { override value: string | number = 0; - override get = jest.fn((): string | number => this.value); + override get = mock.fn((): string | number => this.value); size = 0; - override getSize = jest.fn((): number => this.size); + override getSize = mock.fn((): number => this.size); - override set = jest.fn((value: string | number) => { + override set = mock.fn((value: string | number) => { void value; }); - serialize = jest.fn((array: Uint8Array, offset: number): void => { + serialize = mock.fn((array: Uint8Array, offset: number): void => { void array; void offset; }); @@ -60,7 +61,7 @@ describe("Types", () => { size = 0; - override getSize = jest.fn(() => this.size); + override getSize = mock.fn(() => this.size); override serialize(array: Uint8Array, offset: number): void { void array; @@ -80,13 +81,19 @@ describe("Types", () => { ); mockOriginalFieldValue.size = 0; - expect(lengthFieldValue.getSize()).toBe(0); - expect(mockOriginalFieldValue.getSize).toHaveBeenCalledTimes(1); + assert.strictEqual(lengthFieldValue.getSize(), 0); + assert.strictEqual( + mockOriginalFieldValue.getSize.mock.callCount(), + 1, + ); - mockOriginalFieldValue.getSize.mockClear(); + mockOriginalFieldValue.getSize.mock.resetCalls(); mockOriginalFieldValue.size = 100; - expect(lengthFieldValue.getSize()).toBe(100); - expect(mockOriginalFieldValue.getSize).toHaveBeenCalledTimes(1); + assert.strictEqual(lengthFieldValue.getSize(), 100); + assert.strictEqual( + mockOriginalFieldValue.getSize.mock.callCount(), + 1, + ); }); }); @@ -102,16 +109,28 @@ describe("Types", () => { mockOriginalFieldValue.value = 0; mockBufferFieldValue.size = 0; - expect(lengthFieldValue.get()).toBe(0); - expect(mockBufferFieldValue.getSize).toHaveBeenCalledTimes(1); - expect(mockOriginalFieldValue.get).toHaveBeenCalledTimes(1); + assert.strictEqual(lengthFieldValue.get(), 0); + assert.strictEqual( + mockBufferFieldValue.getSize.mock.callCount(), + 1, + ); + assert.strictEqual( + mockOriginalFieldValue.get.mock.callCount(), + 1, + ); - mockBufferFieldValue.getSize.mockClear(); - mockOriginalFieldValue.get.mockClear(); + mockBufferFieldValue.getSize.mock.resetCalls(); + mockOriginalFieldValue.get.mock.resetCalls(); mockBufferFieldValue.size = 100; - expect(lengthFieldValue.get()).toBe(100); - expect(mockBufferFieldValue.getSize).toHaveBeenCalledTimes(1); - expect(mockOriginalFieldValue.get).toHaveBeenCalledTimes(1); + assert.strictEqual(lengthFieldValue.get(), 100); + assert.strictEqual( + mockBufferFieldValue.getSize.mock.callCount(), + 1, + ); + assert.strictEqual( + mockOriginalFieldValue.get.mock.callCount(), + 1, + ); }); it("should return size of its `bufferValue` as string", () => { @@ -125,16 +144,28 @@ describe("Types", () => { ); mockBufferFieldValue.size = 0; - expect(lengthFieldValue.get()).toBe("0"); - expect(mockBufferFieldValue.getSize).toHaveBeenCalledTimes(1); - expect(mockOriginalFieldValue.get).toHaveBeenCalledTimes(1); + assert.strictEqual(lengthFieldValue.get(), "0"); + assert.strictEqual( + mockBufferFieldValue.getSize.mock.callCount(), + 1, + ); + assert.strictEqual( + mockOriginalFieldValue.get.mock.callCount(), + 1, + ); - mockBufferFieldValue.getSize.mockClear(); - mockOriginalFieldValue.get.mockClear(); + mockBufferFieldValue.getSize.mock.resetCalls(); + mockOriginalFieldValue.get.mock.resetCalls(); mockBufferFieldValue.size = 100; - expect(lengthFieldValue.get()).toBe("100"); - expect(mockBufferFieldValue.getSize).toHaveBeenCalledTimes(1); - expect(mockOriginalFieldValue.get).toHaveBeenCalledTimes(1); + assert.strictEqual(lengthFieldValue.get(), "100"); + assert.strictEqual( + mockBufferFieldValue.getSize.mock.callCount(), + 1, + ); + assert.strictEqual( + mockOriginalFieldValue.get.mock.callCount(), + 1, + ); }); }); @@ -150,10 +181,10 @@ describe("Types", () => { mockOriginalFieldValue.value = 0; mockBufferFieldValue.size = 0; - expect(lengthFieldValue.get()).toBe(0); + assert.strictEqual(lengthFieldValue.get(), 0); (lengthFieldValue as StructFieldValue).set(100); - expect(lengthFieldValue.get()).toBe(0); + assert.strictEqual(lengthFieldValue.get(), 0); }); }); @@ -173,30 +204,50 @@ describe("Types", () => { mockOriginalFieldValue.value = 10; mockBufferFieldValue.size = 0; lengthFieldValue.serialize(array, offset); - expect(mockOriginalFieldValue.get).toHaveBeenCalledTimes(1); - expect(mockOriginalFieldValue.get).toHaveReturnedWith(10); - expect(mockOriginalFieldValue.set).toHaveBeenCalledTimes(1); - expect(mockOriginalFieldValue.set).toHaveBeenCalledWith(0); - expect(mockOriginalFieldValue.serialize).toHaveBeenCalledTimes( + assert.strictEqual( + mockOriginalFieldValue.get.mock.callCount(), 1, ); - expect(mockOriginalFieldValue.serialize).toHaveBeenCalledWith( - array, - offset, + assert.strictEqual( + mockOriginalFieldValue.get.mock.calls[0]?.result, + 10, + ); + assert.strictEqual( + mockOriginalFieldValue.set.mock.callCount(), + 1, + ); + assert.deepStrictEqual( + mockOriginalFieldValue.set.mock.calls[0]?.arguments, + [0], + ); + assert.strictEqual( + mockOriginalFieldValue.serialize.mock.callCount(), + 1, + ); + assert.deepStrictEqual( + mockOriginalFieldValue.serialize.mock.calls[0]?.arguments, + [array, offset], ); - mockOriginalFieldValue.set.mockClear(); - mockOriginalFieldValue.serialize.mockClear(); + mockOriginalFieldValue.set.mock.resetCalls(); + mockOriginalFieldValue.serialize.mock.resetCalls(); mockBufferFieldValue.size = 100; lengthFieldValue.serialize(array, offset); - expect(mockOriginalFieldValue.set).toHaveBeenCalledTimes(1); - expect(mockOriginalFieldValue.set).toHaveBeenCalledWith(100); - expect(mockOriginalFieldValue.serialize).toHaveBeenCalledTimes( + assert.strictEqual( + mockOriginalFieldValue.set.mock.callCount(), 1, ); - expect(mockOriginalFieldValue.serialize).toHaveBeenCalledWith( - array, - offset, + assert.deepStrictEqual( + mockOriginalFieldValue.set.mock.calls[0]?.arguments, + [100], + ); + assert.strictEqual( + mockOriginalFieldValue.serialize.mock.callCount(), + 1, + ); + assert.deepStrictEqual( + mockOriginalFieldValue.serialize.mock.calls[0]?.arguments, + [array, offset], ); }); @@ -215,30 +266,50 @@ describe("Types", () => { mockOriginalFieldValue.value = "10"; mockBufferFieldValue.size = 0; lengthFieldValue.serialize(array, offset); - expect(mockOriginalFieldValue.get).toHaveBeenCalledTimes(1); - expect(mockOriginalFieldValue.get).toHaveReturnedWith("10"); - expect(mockOriginalFieldValue.set).toHaveBeenCalledTimes(1); - expect(mockOriginalFieldValue.set).toHaveBeenCalledWith("0"); - expect(mockOriginalFieldValue.serialize).toHaveBeenCalledTimes( + assert.strictEqual( + mockOriginalFieldValue.get.mock.callCount(), 1, ); - expect(mockOriginalFieldValue.serialize).toHaveBeenCalledWith( - array, - offset, + assert.strictEqual( + mockOriginalFieldValue.get.mock.calls[0]?.result, + "10", + ); + assert.strictEqual( + mockOriginalFieldValue.set.mock.callCount(), + 1, + ); + assert.deepStrictEqual( + mockOriginalFieldValue.set.mock.calls[0]?.arguments, + ["0"], + ); + assert.strictEqual( + mockOriginalFieldValue.serialize.mock.callCount(), + 1, + ); + assert.deepStrictEqual( + mockOriginalFieldValue.serialize.mock.calls[0]?.arguments, + [array, offset], ); - mockOriginalFieldValue.set.mockClear(); - mockOriginalFieldValue.serialize.mockClear(); + mockOriginalFieldValue.set.mock.resetCalls(); + mockOriginalFieldValue.serialize.mock.resetCalls(); mockBufferFieldValue.size = 100; lengthFieldValue.serialize(array, offset); - expect(mockOriginalFieldValue.set).toHaveBeenCalledTimes(1); - expect(mockOriginalFieldValue.set).toHaveBeenCalledWith("100"); - expect(mockOriginalFieldValue.serialize).toHaveBeenCalledTimes( + assert.strictEqual( + mockOriginalFieldValue.set.mock.callCount(), 1, ); - expect(mockOriginalFieldValue.serialize).toHaveBeenCalledWith( - array, - offset, + assert.deepStrictEqual( + mockOriginalFieldValue.set.mock.calls[0]?.arguments, + ["100"], + ); + assert.strictEqual( + mockOriginalFieldValue.serialize.mock.callCount(), + 1, + ); + assert.deepStrictEqual( + mockOriginalFieldValue.serialize.mock.calls[0]?.arguments, + [array, offset], ); }); @@ -261,32 +332,50 @@ describe("Types", () => { mockOriginalFieldValue.value = "10"; mockBufferFieldValue.size = 0; lengthFieldValue.serialize(array, offset); - expect(mockOriginalFieldValue.get).toHaveBeenCalledTimes(1); - expect(mockOriginalFieldValue.get).toHaveReturnedWith("10"); - expect(mockOriginalFieldValue.set).toHaveBeenCalledTimes(1); - expect(mockOriginalFieldValue.set).toHaveBeenCalledWith("0"); - expect(mockOriginalFieldValue.serialize).toHaveBeenCalledTimes( + assert.strictEqual( + mockOriginalFieldValue.get.mock.callCount(), 1, ); - expect(mockOriginalFieldValue.serialize).toHaveBeenCalledWith( - array, - offset, + assert.strictEqual( + mockOriginalFieldValue.get.mock.calls[0]?.result, + "10", + ); + assert.strictEqual( + mockOriginalFieldValue.set.mock.callCount(), + 1, + ); + assert.deepStrictEqual( + mockOriginalFieldValue.set.mock.calls[0]?.arguments, + ["0"], + ); + assert.strictEqual( + mockOriginalFieldValue.serialize.mock.callCount(), + 1, + ); + assert.deepStrictEqual( + mockOriginalFieldValue.serialize.mock.calls[0]?.arguments, + [array, offset], ); - mockOriginalFieldValue.set.mockClear(); - mockOriginalFieldValue.serialize.mockClear(); + mockOriginalFieldValue.set.mock.resetCalls(); + mockOriginalFieldValue.serialize.mock.resetCalls(); mockBufferFieldValue.size = 100; lengthFieldValue.serialize(array, offset); - expect(mockOriginalFieldValue.set).toHaveBeenCalledTimes(1); - expect(mockOriginalFieldValue.set).toHaveBeenCalledWith( - (100).toString(radix), - ); - expect(mockOriginalFieldValue.serialize).toHaveBeenCalledTimes( + assert.strictEqual( + mockOriginalFieldValue.set.mock.callCount(), 1, ); - expect(mockOriginalFieldValue.serialize).toHaveBeenCalledWith( - array, - offset, + assert.deepStrictEqual( + mockOriginalFieldValue.set.mock.calls[0]?.arguments, + [(100).toString(radix)], + ); + assert.strictEqual( + mockOriginalFieldValue.serialize.mock.callCount(), + 1, + ); + assert.deepStrictEqual( + mockOriginalFieldValue.serialize.mock.calls[0]?.arguments, + [array, offset], ); }); }); @@ -317,18 +406,18 @@ describe("Types", () => { value, ); - expect(bufferFieldValue).toHaveProperty( - "definition", + assert.strictEqual( + bufferFieldValue.definition, bufferFieldDefinition, ); - expect(bufferFieldValue).toHaveProperty( - "options", + assert.strictEqual( + bufferFieldValue.options, StructDefaultOptions, ); - expect(bufferFieldValue).toHaveProperty("struct", struct); - expect(bufferFieldValue).toHaveProperty("value", value); - expect(bufferFieldValue).toHaveProperty("array", undefined); - expect(bufferFieldValue).toHaveProperty("length", undefined); + assert.strictEqual(bufferFieldValue.struct, struct); + assert.deepStrictEqual(bufferFieldValue["value"], value); + assert.strictEqual(bufferFieldValue["array"], undefined); + assert.strictEqual(bufferFieldValue["length"], undefined); }); it("should accept initial `array`", () => { @@ -355,18 +444,18 @@ describe("Types", () => { value, ); - expect(bufferFieldValue).toHaveProperty( - "definition", + assert.strictEqual( + bufferFieldValue.definition, bufferFieldDefinition, ); - expect(bufferFieldValue).toHaveProperty( - "options", + assert.strictEqual( + bufferFieldValue.options, StructDefaultOptions, ); - expect(bufferFieldValue).toHaveProperty("struct", struct); - expect(bufferFieldValue).toHaveProperty("value", value); - expect(bufferFieldValue).toHaveProperty("array", value); - expect(bufferFieldValue).toHaveProperty("length", value.length); + assert.strictEqual(bufferFieldValue.struct, struct); + assert.deepStrictEqual(bufferFieldValue["value"], value); + assert.deepStrictEqual(bufferFieldValue["array"], value); + assert.strictEqual(bufferFieldValue["length"], value.length); }); it("should replace `lengthField` on `struct`", () => { @@ -392,10 +481,12 @@ describe("Types", () => { value, ); - expect(bufferFieldValue["lengthFieldValue"]).toBeInstanceOf( - StructFieldValue, + assert.ok( + bufferFieldValue["lengthFieldValue"] instanceof + StructFieldValue, ); - expect(struct.fieldValues[lengthField]).toBe( + assert.strictEqual( + struct.fieldValues[lengthField], bufferFieldValue["lengthFieldValue"], ); }); @@ -403,11 +494,11 @@ describe("Types", () => { describe("#getSize", () => { class MockBufferFieldConverter extends BufferFieldConverter { - override toBuffer = jest.fn((value: Uint8Array): Uint8Array => { + override toBuffer = mock.fn((value: Uint8Array): Uint8Array => { return value; }); - override toValue = jest.fn( + override toValue = mock.fn( (arrayBuffer: Uint8Array): Uint8Array => { return arrayBuffer; }, @@ -415,7 +506,7 @@ describe("Types", () => { size: number | undefined = 0; - override getSize = jest.fn( + override getSize = mock.fn( (value: Uint8Array): number | undefined => { void value; return this.size; @@ -448,10 +539,19 @@ describe("Types", () => { value, ); - expect(bufferFieldValue.getSize()).toBe(100); - expect(bufferFieldConverter.toValue).toHaveBeenCalledTimes(0); - expect(bufferFieldConverter.toBuffer).toHaveBeenCalledTimes(0); - expect(bufferFieldConverter.getSize).toHaveBeenCalledTimes(0); + assert.strictEqual(bufferFieldValue.getSize(), 100); + assert.strictEqual( + bufferFieldConverter.toValue.mock.callCount(), + 0, + ); + assert.strictEqual( + bufferFieldConverter.toBuffer.mock.callCount(), + 0, + ); + assert.strictEqual( + bufferFieldConverter.getSize.mock.callCount(), + 0, + ); }); it("should call `getSize` of its `converter`", () => { @@ -479,12 +579,21 @@ describe("Types", () => { ); bufferFieldConverter.size = 100; - expect(bufferFieldValue.getSize()).toBe(100); - expect(bufferFieldConverter.toValue).toHaveBeenCalledTimes(0); - expect(bufferFieldConverter.toBuffer).toHaveBeenCalledTimes(0); - expect(bufferFieldConverter.getSize).toHaveBeenCalledTimes(1); - expect(bufferFieldValue).toHaveProperty("array", undefined); - expect(bufferFieldValue).toHaveProperty("length", 100); + assert.strictEqual(bufferFieldValue.getSize(), 100); + assert.strictEqual( + bufferFieldConverter.toValue.mock.callCount(), + 0, + ); + assert.strictEqual( + bufferFieldConverter.toBuffer.mock.callCount(), + 0, + ); + assert.strictEqual( + bufferFieldConverter.getSize.mock.callCount(), + 1, + ); + assert.strictEqual(bufferFieldValue["array"], undefined); + assert.strictEqual(bufferFieldValue["length"], 100); }); it("should call `toBuffer` of its `converter` if it does not support `getSize`", () => { @@ -512,12 +621,21 @@ describe("Types", () => { ); bufferFieldConverter.size = undefined; - expect(bufferFieldValue.getSize()).toBe(100); - expect(bufferFieldConverter.toValue).toHaveBeenCalledTimes(0); - expect(bufferFieldConverter.toBuffer).toHaveBeenCalledTimes(1); - expect(bufferFieldConverter.getSize).toHaveBeenCalledTimes(1); - expect(bufferFieldValue).toHaveProperty("array", value); - expect(bufferFieldValue).toHaveProperty("length", 100); + assert.strictEqual(bufferFieldValue.getSize(), 100); + assert.strictEqual( + bufferFieldConverter.toValue.mock.callCount(), + 0, + ); + assert.strictEqual( + bufferFieldConverter.toBuffer.mock.callCount(), + 1, + ); + assert.strictEqual( + bufferFieldConverter.getSize.mock.callCount(), + 1, + ); + assert.strictEqual(bufferFieldValue["array"], value); + assert.strictEqual(bufferFieldValue["length"], 100); }); }); @@ -548,8 +666,8 @@ describe("Types", () => { const newValue = new ArrayBuffer(100); bufferFieldValue.set(newValue); - expect(bufferFieldValue.get()).toBe(newValue); - expect(bufferFieldValue).toHaveProperty("array", undefined); + assert.strictEqual(bufferFieldValue.get(), newValue); + assert.strictEqual(bufferFieldValue["array"], undefined); }); it("should clear length", () => { @@ -578,7 +696,7 @@ describe("Types", () => { const newValue = new ArrayBuffer(100); bufferFieldValue.set(newValue); - expect(bufferFieldValue).toHaveProperty("length", undefined); + assert.strictEqual(bufferFieldValue["length"], undefined); }); }); }); @@ -590,7 +708,7 @@ describe("Types", () => { Uint8ArrayBufferFieldConverter.Instance, { lengthField: "foo" }, ); - expect(definition.getSize()).toBe(0); + assert.strictEqual(definition.getSize(), 0); }); }); @@ -608,13 +726,22 @@ describe("Types", () => { ); originalLengthFieldValue.value = 0; - expect(definition["getDeserializeSize"](struct)).toBe(0); - expect(originalLengthFieldValue.get).toHaveBeenCalledTimes(1); + assert.strictEqual(definition["getDeserializeSize"](struct), 0); + assert.strictEqual( + originalLengthFieldValue.get.mock.callCount(), + 1, + ); - originalLengthFieldValue.get.mockClear(); + originalLengthFieldValue.get.mock.resetCalls(); originalLengthFieldValue.value = 100; - expect(definition["getDeserializeSize"](struct)).toBe(100); - expect(originalLengthFieldValue.get).toHaveBeenCalledTimes(1); + assert.strictEqual( + definition["getDeserializeSize"](struct), + 100, + ); + assert.strictEqual( + originalLengthFieldValue.get.mock.callCount(), + 1, + ); }); it("should return value of its `lengthField` as number", () => { @@ -630,13 +757,22 @@ describe("Types", () => { ); originalLengthFieldValue.value = "0"; - expect(definition["getDeserializeSize"](struct)).toBe(0); - expect(originalLengthFieldValue.get).toHaveBeenCalledTimes(1); + assert.strictEqual(definition["getDeserializeSize"](struct), 0); + assert.strictEqual( + originalLengthFieldValue.get.mock.callCount(), + 1, + ); - originalLengthFieldValue.get.mockClear(); + originalLengthFieldValue.get.mock.resetCalls(); originalLengthFieldValue.value = "100"; - expect(definition["getDeserializeSize"](struct)).toBe(100); - expect(originalLengthFieldValue.get).toHaveBeenCalledTimes(1); + assert.strictEqual( + definition["getDeserializeSize"](struct), + 100, + ); + assert.strictEqual( + originalLengthFieldValue.get.mock.callCount(), + 1, + ); }); it("should return value of its `lengthField` as number with specified radix", () => { @@ -653,15 +789,22 @@ describe("Types", () => { ); originalLengthFieldValue.value = "0"; - expect(definition["getDeserializeSize"](struct)).toBe(0); - expect(originalLengthFieldValue.get).toHaveBeenCalledTimes(1); + assert.strictEqual(definition["getDeserializeSize"](struct), 0); + assert.strictEqual( + originalLengthFieldValue.get.mock.callCount(), + 1, + ); - originalLengthFieldValue.get.mockClear(); + originalLengthFieldValue.get.mock.resetCalls(); originalLengthFieldValue.value = "100"; - expect(definition["getDeserializeSize"](struct)).toBe( + assert.strictEqual( + definition["getDeserializeSize"](struct), Number.parseInt("100", radix), ); - expect(originalLengthFieldValue.get).toHaveBeenCalledTimes(1); + assert.strictEqual( + originalLengthFieldValue.get.mock.callCount(), + 1, + ); }); }); @@ -685,18 +828,15 @@ describe("Types", () => { value, ); - expect(bufferFieldValue).toHaveProperty( - "definition", - definition, - ); - expect(bufferFieldValue).toHaveProperty( - "options", + assert.strictEqual(bufferFieldValue.definition, definition); + assert.strictEqual( + bufferFieldValue.options, StructDefaultOptions, ); - expect(bufferFieldValue).toHaveProperty("struct", struct); - expect(bufferFieldValue).toHaveProperty("value", value); - expect(bufferFieldValue).toHaveProperty("array", undefined); - expect(bufferFieldValue).toHaveProperty("length", undefined); + assert.strictEqual(bufferFieldValue.struct, struct); + assert.strictEqual(bufferFieldValue["value"], value); + assert.strictEqual(bufferFieldValue["array"], undefined); + assert.strictEqual(bufferFieldValue["length"], undefined); }); it("should create a `VariableLengthBufferLikeStructFieldValue` with `arrayBuffer`", () => { @@ -719,18 +859,15 @@ describe("Types", () => { value, ); - expect(bufferFieldValue).toHaveProperty( - "definition", - definition, - ); - expect(bufferFieldValue).toHaveProperty( - "options", + assert.strictEqual(bufferFieldValue.definition, definition); + assert.strictEqual( + bufferFieldValue.options, StructDefaultOptions, ); - expect(bufferFieldValue).toHaveProperty("struct", struct); - expect(bufferFieldValue).toHaveProperty("value", value); - expect(bufferFieldValue).toHaveProperty("array", value); - expect(bufferFieldValue).toHaveProperty("length", 100); + assert.strictEqual(bufferFieldValue.struct, struct); + assert.strictEqual(bufferFieldValue["value"], value); + assert.strictEqual(bufferFieldValue["array"], value); + assert.strictEqual(bufferFieldValue["length"], 100); }); }); }); diff --git a/libraries/struct/src/types/number.spec.ts b/libraries/struct/src/types/number.spec.ts index 49f390bd..f735738e 100644 --- a/libraries/struct/src/types/number.spec.ts +++ b/libraries/struct/src/types/number.spec.ts @@ -1,4 +1,5 @@ -import { describe, expect, it, jest, test } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it, mock } from "node:test"; import type { ExactReadable } from "../basic/index.js"; import { StructDefaultOptions, StructValue } from "../basic/index.js"; @@ -11,7 +12,7 @@ function testEndian( max: number, littleEndian: boolean, ) { - test(`min = ${min}`, () => { + it(`min = ${min}`, () => { const buffer = new ArrayBuffer(type.size); const view = new DataView(buffer); ( @@ -22,10 +23,10 @@ function testEndian( ] as (offset: number, value: number, littleEndian: boolean) => void )(0, min, littleEndian); const output = type.deserialize(new Uint8Array(buffer), littleEndian); - expect(output).toBe(min); + assert.strictEqual(output, min); }); - test("1", () => { + it("1", () => { const buffer = new ArrayBuffer(type.size); const view = new DataView(buffer); const input = 1; @@ -37,10 +38,10 @@ function testEndian( ] as (offset: number, value: number, littleEndian: boolean) => void )(0, input, littleEndian); const output = type.deserialize(new Uint8Array(buffer), littleEndian); - expect(output).toBe(input); + assert.strictEqual(output, input); }); - test(`max = ${max}`, () => { + it(`max = ${max}`, () => { const buffer = new ArrayBuffer(type.size); const view = new DataView(buffer); ( @@ -51,7 +52,7 @@ function testEndian( ] as (offset: number, value: number, littleEndian: boolean) => void )(0, max, littleEndian); const output = type.deserialize(new Uint8Array(buffer), littleEndian); - expect(output).toBe(max); + assert.strictEqual(output, max); }); } @@ -93,8 +94,8 @@ describe("Types", () => { describe("Int8", () => { const key = "Int8"; - test("basic", () => { - expect(NumberFieldVariant[key]).toHaveProperty("size", 1); + it("basic", () => { + assert.strictEqual(NumberFieldVariant[key].size, 1); }); testDeserialize(NumberFieldVariant[key]); @@ -103,8 +104,8 @@ describe("Types", () => { describe("Uint8", () => { const key = "Uint8"; - test("basic", () => { - expect(NumberFieldVariant[key]).toHaveProperty("size", 1); + it("basic", () => { + assert.strictEqual(NumberFieldVariant[key].size, 1); }); testDeserialize(NumberFieldVariant[key]); @@ -113,8 +114,8 @@ describe("Types", () => { describe("Int16", () => { const key = "Int16"; - test("basic", () => { - expect(NumberFieldVariant[key]).toHaveProperty("size", 2); + it("basic", () => { + assert.strictEqual(NumberFieldVariant[key].size, 2); }); testDeserialize(NumberFieldVariant[key]); @@ -123,8 +124,8 @@ describe("Types", () => { describe("Uint16", () => { const key = "Uint16"; - test("basic", () => { - expect(NumberFieldVariant[key]).toHaveProperty("size", 2); + it("basic", () => { + assert.strictEqual(NumberFieldVariant[key].size, 2); }); testDeserialize(NumberFieldVariant[key]); @@ -133,8 +134,8 @@ describe("Types", () => { describe("Int32", () => { const key = "Int32"; - test("basic", () => { - expect(NumberFieldVariant[key]).toHaveProperty("size", 4); + it("basic", () => { + assert.strictEqual(NumberFieldVariant[key].size, 4); }); testDeserialize(NumberFieldVariant[key]); @@ -143,8 +144,8 @@ describe("Types", () => { describe("Uint32", () => { const key = "Uint32"; - test("basic", () => { - expect(NumberFieldVariant[key]).toHaveProperty("size", 4); + it("basic", () => { + assert.strictEqual(NumberFieldVariant[key].size, 4); }); testDeserialize(NumberFieldVariant[key]); @@ -154,42 +155,48 @@ describe("Types", () => { describe("NumberFieldDefinition", () => { describe("#getSize", () => { it("should return size of its type", () => { - expect( + assert.strictEqual( new NumberFieldDefinition( NumberFieldVariant.Int8, ).getSize(), - ).toBe(1); - expect( + 1, + ); + assert.strictEqual( new NumberFieldDefinition( NumberFieldVariant.Uint8, ).getSize(), - ).toBe(1); - expect( + 1, + ); + assert.strictEqual( new NumberFieldDefinition( NumberFieldVariant.Int16, ).getSize(), - ).toBe(2); - expect( + 2, + ); + assert.strictEqual( new NumberFieldDefinition( NumberFieldVariant.Uint16, ).getSize(), - ).toBe(2); - expect( + 2, + ); + assert.strictEqual( new NumberFieldDefinition( NumberFieldVariant.Int32, ).getSize(), - ).toBe(4); - expect( + 4, + ); + assert.strictEqual( new NumberFieldDefinition( NumberFieldVariant.Uint32, ).getSize(), - ).toBe(4); + 4, + ); }); }); describe("#deserialize", () => { it("should deserialize Uint8", () => { - const readExactly = jest.fn( + const readExactly = mock.fn( () => new Uint8Array([1, 2, 3, 4]), ); const stream: ExactReadable = { position: 0, readExactly }; @@ -204,15 +211,16 @@ describe("Types", () => { struct, ); - expect(value.get()).toBe(1); - expect(readExactly).toHaveBeenCalledTimes(1); - expect(readExactly).toHaveBeenCalledWith( - NumberFieldVariant.Uint8.size, + assert.strictEqual(value.get(), 1); + assert.strictEqual(readExactly.mock.callCount(), 1); + assert.deepStrictEqual( + readExactly.mock.calls[0]?.arguments, + [NumberFieldVariant.Uint8.size], ); }); it("should deserialize Uint16", () => { - const readExactly = jest.fn( + const readExactly = mock.fn( () => new Uint8Array([1, 2, 3, 4]), ); const stream: ExactReadable = { position: 0, readExactly }; @@ -227,15 +235,16 @@ describe("Types", () => { struct, ); - expect(value.get()).toBe((1 << 8) | 2); - expect(readExactly).toHaveBeenCalledTimes(1); - expect(readExactly).toHaveBeenCalledWith( - NumberFieldVariant.Uint16.size, + assert.strictEqual(value.get(), (1 << 8) | 2); + assert.strictEqual(readExactly.mock.callCount(), 1); + assert.deepStrictEqual( + readExactly.mock.calls[0]?.arguments, + [NumberFieldVariant.Uint16.size], ); }); it("should deserialize Uint16LE", () => { - const readExactly = jest.fn( + const readExactly = mock.fn( () => new Uint8Array([1, 2, 3, 4]), ); const stream: ExactReadable = { position: 0, readExactly }; @@ -250,10 +259,11 @@ describe("Types", () => { struct, ); - expect(value.get()).toBe((2 << 8) | 1); - expect(readExactly).toHaveBeenCalledTimes(1); - expect(readExactly).toHaveBeenCalledWith( - NumberFieldVariant.Uint16.size, + assert.strictEqual(value.get(), (2 << 8) | 1); + assert.strictEqual(readExactly.mock.callCount(), 1); + assert.deepStrictEqual( + readExactly.mock.calls[0]?.arguments, + [NumberFieldVariant.Uint16.size], ); }); }); @@ -264,41 +274,47 @@ describe("Types", () => { it("should return size of its definition", () => { const struct = new StructValue({}); - expect( + assert.strictEqual( new NumberFieldDefinition(NumberFieldVariant.Int8) .create(StructDefaultOptions, struct, 42) .getSize(), - ).toBe(1); + 1, + ); - expect( + assert.strictEqual( new NumberFieldDefinition(NumberFieldVariant.Uint8) .create(StructDefaultOptions, struct, 42) .getSize(), - ).toBe(1); + 1, + ); - expect( + assert.strictEqual( new NumberFieldDefinition(NumberFieldVariant.Int16) .create(StructDefaultOptions, struct, 42) .getSize(), - ).toBe(2); + 2, + ); - expect( + assert.strictEqual( new NumberFieldDefinition(NumberFieldVariant.Uint16) .create(StructDefaultOptions, struct, 42) .getSize(), - ).toBe(2); + 2, + ); - expect( + assert.strictEqual( new NumberFieldDefinition(NumberFieldVariant.Int32) .create(StructDefaultOptions, struct, 42) .getSize(), - ).toBe(4); + 4, + ); - expect( + assert.strictEqual( new NumberFieldDefinition(NumberFieldVariant.Uint32) .create(StructDefaultOptions, struct, 42) .getSize(), - ).toBe(4); + 4, + ); }); }); @@ -317,9 +333,10 @@ describe("Types", () => { const array = new Uint8Array(10); value.serialize(array, 2); - expect(Array.from(array)).toEqual([ - 0, 0, 42, 0, 0, 0, 0, 0, 0, 0, - ]); + assert.deepStrictEqual( + Array.from(array), + [0, 0, 42, 0, 0, 0, 0, 0, 0, 0], + ); }); }); }); diff --git a/libraries/struct/src/utils.spec.ts b/libraries/struct/src/utils.spec.ts index 8e82c3ac..4c96759b 100644 --- a/libraries/struct/src/utils.spec.ts +++ b/libraries/struct/src/utils.spec.ts @@ -1,9 +1,10 @@ -import { describe, expect, it } from "@jest/globals"; +import * as assert from "node:assert"; +import { describe, it } from "node:test"; import { placeholder } from "./utils.js"; describe("placeholder", () => { it("should return `undefined`", () => { - expect(placeholder()).toBe(undefined); + assert.ok(placeholder); }); }); diff --git a/libraries/struct/tsconfig.build.json b/libraries/struct/tsconfig.build.json index 2cb23249..72df0da2 100644 --- a/libraries/struct/tsconfig.build.json +++ b/libraries/struct/tsconfig.build.json @@ -1,3 +1,8 @@ { - "extends": "./node_modules/@yume-chan/tsconfig/tsconfig.base.json" + "extends": "./node_modules/@yume-chan/tsconfig/tsconfig.base.json", + "references": [ + { + "path": "../no-data-view/tsconfig.build.json" + } + ] } diff --git a/libraries/struct/tsconfig.json b/libraries/struct/tsconfig.json index 04f9aba7..d6787a22 100644 --- a/libraries/struct/tsconfig.json +++ b/libraries/struct/tsconfig.json @@ -1,13 +1,10 @@ { "references": [ { - "path": "../no-data-view/tsconfig.build.json" + "path": "./tsconfig.build.json" }, { "path": "./tsconfig.test.json" - }, - { - "path": "./tsconfig.build.json" - }, + } ] } diff --git a/libraries/struct/tsconfig.test.json b/libraries/struct/tsconfig.test.json index e987f757..6a105912 100644 --- a/libraries/struct/tsconfig.test.json +++ b/libraries/struct/tsconfig.test.json @@ -2,6 +2,7 @@ "extends": "./tsconfig.build.json", "compilerOptions": { "types": [ + "node" ], }, "exclude": [] diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 66f6324b..fb8082c1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -42,9 +42,6 @@ importers: '@yume-chan/tsconfig': specifier: workspace:^1.0.0 version: link:../../toolchain/tsconfig - jest: - specifier: ^30.0.0-alpha.4 - version: 30.0.0-alpha.5(@types/node@20.14.10) prettier: specifier: ^3.3.3 version: 3.3.3 @@ -70,30 +67,21 @@ importers: specifier: workspace:^0.0.24 version: link:../struct devDependencies: - '@jest/globals': - specifier: ^30.0.0-alpha.4 - version: 30.0.0-alpha.5 '@types/node': specifier: ^20.14.9 version: 20.14.10 '@yume-chan/eslint-config': specifier: workspace:^1.0.0 version: link:../../toolchain/eslint-config + '@yume-chan/test-runner': + specifier: workspace:^1.0.0 + version: link:../../toolchain/test-runner '@yume-chan/tsconfig': specifier: workspace:^1.0.0 version: link:../../toolchain/tsconfig - cross-env: - specifier: ^7.0.3 - version: 7.0.3 - jest: - specifier: ^30.0.0-alpha.4 - version: 30.0.0-alpha.5(@types/node@20.14.10) prettier: specifier: ^3.3.3 version: 3.3.3 - ts-jest: - specifier: ^29.2.2 - version: 29.2.2(@babel/core@7.24.8)(@jest/types@29.6.3)(jest@30.0.0-alpha.5)(typescript@5.5.3) typescript: specifier: ^5.5.3 version: 5.5.3 @@ -132,30 +120,21 @@ importers: specifier: workspace:^0.0.24 version: link:../struct devDependencies: - '@jest/globals': - specifier: ^30.0.0-alpha.4 - version: 30.0.0-alpha.5 '@types/node': specifier: ^20.14.9 version: 20.14.10 '@yume-chan/eslint-config': specifier: workspace:^1.0.0 version: link:../../toolchain/eslint-config + '@yume-chan/test-runner': + specifier: workspace:^1.0.0 + version: link:../../toolchain/test-runner '@yume-chan/tsconfig': specifier: workspace:^1.0.0 version: link:../../toolchain/tsconfig - cross-env: - specifier: ^7.0.3 - version: 7.0.3 - jest: - specifier: ^30.0.0-alpha.4 - version: 30.0.0-alpha.5(@types/node@20.14.10) prettier: specifier: ^3.3.3 version: 3.3.3 - ts-jest: - specifier: ^29.2.2 - version: 29.2.2(@babel/core@7.24.8)(@jest/types@29.6.3)(jest@30.0.0-alpha.5)(typescript@5.5.3) typescript: specifier: ^5.5.3 version: 5.5.3 @@ -181,27 +160,15 @@ importers: specifier: workspace:^0.0.24 version: link:../struct devDependencies: - '@jest/globals': - specifier: ^30.0.0-alpha.4 - version: 30.0.0-alpha.5 '@yume-chan/eslint-config': specifier: workspace:^1.0.0 version: link:../../toolchain/eslint-config '@yume-chan/tsconfig': specifier: workspace:^1.0.0 version: link:../../toolchain/tsconfig - cross-env: - specifier: ^7.0.3 - version: 7.0.3 - jest: - specifier: ^30.0.0-alpha.4 - version: 30.0.0-alpha.5(@types/node@20.14.10) prettier: specifier: ^3.3.3 version: 3.3.3 - ts-jest: - specifier: ^29.2.2 - version: 29.2.2(@babel/core@7.24.8)(@jest/types@29.6.3)(jest@30.0.0-alpha.5)(typescript@5.5.3) typescript: specifier: ^5.5.3 version: 5.5.3 @@ -227,9 +194,6 @@ importers: '@yume-chan/tsconfig': specifier: workspace:^1.0.0 version: link:../../toolchain/tsconfig - jest: - specifier: ^30.0.0-alpha.4 - version: 30.0.0-alpha.5(@types/node@20.14.10) prettier: specifier: ^3.3.3 version: 3.3.3 @@ -249,27 +213,21 @@ importers: specifier: workspace:^0.0.24 version: link:../struct devDependencies: - '@jest/globals': - specifier: ^30.0.0-alpha.4 - version: 30.0.0-alpha.5 + '@types/node': + specifier: ^20.14.9 + version: 20.14.10 '@yume-chan/eslint-config': specifier: workspace:^1.0.0 version: link:../../toolchain/eslint-config + '@yume-chan/test-runner': + specifier: workspace:^1.0.0 + version: link:../../toolchain/test-runner '@yume-chan/tsconfig': specifier: workspace:^1.0.0 version: link:../../toolchain/tsconfig - cross-env: - specifier: ^7.0.3 - version: 7.0.3 - jest: - specifier: ^30.0.0-alpha.4 - version: 30.0.0-alpha.5(@types/node@20.14.10) prettier: specifier: ^3.3.3 version: 3.3.3 - ts-jest: - specifier: ^29.2.2 - version: 29.2.2(@babel/core@7.24.8)(@jest/types@29.6.3)(jest@30.0.0-alpha.5)(typescript@5.5.3) typescript: specifier: ^5.5.3 version: 5.5.3 @@ -299,27 +257,21 @@ importers: specifier: ^2.2.0 version: 2.2.0 devDependencies: - '@jest/globals': - specifier: ^30.0.0-alpha.4 - version: 30.0.0-alpha.5 + '@types/node': + specifier: ^20.14.9 + version: 20.14.10 '@yume-chan/eslint-config': specifier: workspace:^1.0.0 version: link:../../toolchain/eslint-config + '@yume-chan/test-runner': + specifier: workspace:^1.0.0 + version: link:../../toolchain/test-runner '@yume-chan/tsconfig': specifier: workspace:^1.0.0 version: link:../../toolchain/tsconfig - cross-env: - specifier: ^7.0.3 - version: 7.0.3 - jest: - specifier: ^30.0.0-alpha.4 - version: 30.0.0-alpha.5(@types/node@20.14.10) prettier: specifier: ^3.3.3 version: 3.3.3 - ts-jest: - specifier: ^29.2.2 - version: 29.2.2(@babel/core@7.24.8)(@jest/types@29.6.3)(jest@30.0.0-alpha.5)(typescript@5.5.3) typescript: specifier: ^5.5.3 version: 5.5.3 @@ -336,42 +288,30 @@ importers: libraries/no-data-view: devDependencies: - '@jest/globals': - specifier: ^30.0.0-alpha.4 - version: 30.0.0-alpha.5 '@types/node': specifier: ^20.14.9 version: 20.14.10 '@yume-chan/eslint-config': specifier: workspace:^1.0.0 version: link:../../toolchain/eslint-config + '@yume-chan/test-runner': + specifier: workspace:^1.0.0 + version: link:../../toolchain/test-runner '@yume-chan/tsconfig': specifier: workspace:^1.0.0 version: link:../../toolchain/tsconfig - cross-env: - specifier: ^7.0.3 - version: 7.0.3 - jest: - specifier: ^30.0.0-alpha.4 - version: 30.0.0-alpha.5(@types/node@20.14.10) prettier: specifier: ^3.3.3 version: 3.3.3 tinybench: specifier: ^2.8.0 version: 2.8.0 - ts-jest: - specifier: ^29.2.2 - version: 29.2.2(@babel/core@7.24.8)(@jest/types@29.6.3)(jest@30.0.0-alpha.5)(typescript@5.5.3) typescript: specifier: ^5.5.3 version: 5.5.3 libraries/pcm-player: devDependencies: - '@jest/globals': - specifier: ^30.0.0-alpha.4 - version: 30.0.0-alpha.5 '@types/audioworklet': specifier: ^0.0.57 version: 0.0.57 @@ -381,18 +321,9 @@ importers: '@yume-chan/tsconfig': specifier: workspace:^1.0.0 version: link:../../toolchain/tsconfig - cross-env: - specifier: ^7.0.3 - version: 7.0.3 - jest: - specifier: ^30.0.0-alpha.4 - version: 30.0.0-alpha.5(@types/node@20.14.10) prettier: specifier: ^3.3.3 version: 3.3.3 - ts-jest: - specifier: ^29.2.2 - version: 29.2.2(@babel/core@7.24.8)(@jest/types@29.6.3)(jest@30.0.0-alpha.5)(typescript@5.5.3) typescript: specifier: ^5.5.3 version: 5.5.3 @@ -412,27 +343,21 @@ importers: specifier: workspace:^0.0.24 version: link:../struct devDependencies: - '@jest/globals': - specifier: ^30.0.0-alpha.4 - version: 30.0.0-alpha.5 + '@types/node': + specifier: ^20.14.9 + version: 20.14.10 '@yume-chan/eslint-config': specifier: workspace:^1.0.0 version: link:../../toolchain/eslint-config + '@yume-chan/test-runner': + specifier: workspace:^1.0.0 + version: link:../../toolchain/test-runner '@yume-chan/tsconfig': specifier: workspace:^1.0.0 version: link:../../toolchain/tsconfig - cross-env: - specifier: ^7.0.3 - version: 7.0.3 - jest: - specifier: ^30.0.0-alpha.4 - version: 30.0.0-alpha.5(@types/node@20.14.10) prettier: specifier: ^3.3.3 version: 3.3.3 - ts-jest: - specifier: ^29.2.2 - version: 29.2.2(@babel/core@7.24.8)(@jest/types@29.6.3)(jest@30.0.0-alpha.5)(typescript@5.5.3) typescript: specifier: ^5.5.3 version: 5.5.3 @@ -461,27 +386,15 @@ importers: specifier: ^1.2.11 version: 1.2.11 devDependencies: - '@jest/globals': - specifier: ^30.0.0-alpha.4 - version: 30.0.0-alpha.5 '@yume-chan/eslint-config': specifier: workspace:^1.0.0 version: link:../../toolchain/eslint-config '@yume-chan/tsconfig': specifier: workspace:^1.0.0 version: link:../../toolchain/tsconfig - cross-env: - specifier: ^7.0.3 - version: 7.0.3 - jest: - specifier: ^30.0.0-alpha.4 - version: 30.0.0-alpha.5(@types/node@20.14.10) prettier: specifier: ^3.3.3 version: 3.3.3 - ts-jest: - specifier: ^29.2.2 - version: 29.2.2(@babel/core@7.24.8)(@jest/types@29.6.3)(jest@30.0.0-alpha.5)(typescript@5.5.3) typescript: specifier: ^5.5.3 version: 5.5.3 @@ -504,27 +417,15 @@ importers: specifier: workspace:^0.0.24 version: link:../stream-extra devDependencies: - '@jest/globals': - specifier: ^30.0.0-alpha.4 - version: 30.0.0-alpha.5 '@yume-chan/eslint-config': specifier: workspace:^1.0.0 version: link:../../toolchain/eslint-config '@yume-chan/tsconfig': specifier: workspace:^1.0.0 version: link:../../toolchain/tsconfig - cross-env: - specifier: ^7.0.3 - version: 7.0.3 - jest: - specifier: ^30.0.0-alpha.4 - version: 30.0.0-alpha.5(@types/node@20.14.10) prettier: specifier: ^3.3.3 version: 3.3.3 - ts-jest: - specifier: ^29.2.2 - version: 29.2.2(@babel/core@7.24.8)(@jest/types@29.6.3)(jest@30.0.0-alpha.5)(typescript@5.5.3) typescript: specifier: ^5.5.3 version: 5.5.3 @@ -538,27 +439,21 @@ importers: specifier: workspace:^0.0.24 version: link:../struct devDependencies: - '@jest/globals': - specifier: ^30.0.0-alpha.4 - version: 30.0.0-alpha.5 + '@types/node': + specifier: ^20.14.9 + version: 20.14.10 '@yume-chan/eslint-config': specifier: workspace:^1.0.0 version: link:../../toolchain/eslint-config + '@yume-chan/test-runner': + specifier: workspace:^1.0.0 + version: link:../../toolchain/test-runner '@yume-chan/tsconfig': specifier: workspace:^1.0.0 version: link:../../toolchain/tsconfig - cross-env: - specifier: ^7.0.3 - version: 7.0.3 - jest: - specifier: ^30.0.0-alpha.4 - version: 30.0.0-alpha.5(@types/node@20.14.10) prettier: specifier: ^3.3.3 version: 3.3.3 - ts-jest: - specifier: ^29.2.2 - version: 29.2.2(@babel/core@7.24.8)(@jest/types@29.6.3)(jest@30.0.0-alpha.5)(typescript@5.5.3) typescript: specifier: ^5.5.3 version: 5.5.3 @@ -569,27 +464,21 @@ importers: specifier: workspace:^0.0.24 version: link:../no-data-view devDependencies: - '@jest/globals': - specifier: ^30.0.0-alpha.4 - version: 30.0.0-alpha.5 + '@types/node': + specifier: ^20.14.9 + version: 20.14.10 '@yume-chan/eslint-config': specifier: workspace:^1.0.0 version: link:../../toolchain/eslint-config + '@yume-chan/test-runner': + specifier: workspace:^1.0.0 + version: link:../../toolchain/test-runner '@yume-chan/tsconfig': specifier: workspace:^1.0.0 version: link:../../toolchain/tsconfig - cross-env: - specifier: ^7.0.3 - version: 7.0.3 - jest: - specifier: ^30.0.0-alpha.4 - version: 30.0.0-alpha.5(@types/node@20.14.10) prettier: specifier: ^3.3.3 version: 3.3.3 - ts-jest: - specifier: ^29.2.2 - version: 29.2.2(@babel/core@7.24.8)(@jest/types@29.6.3)(jest@30.0.0-alpha.5)(typescript@5.5.3) typescript: specifier: ^5.5.3 version: 5.5.3 @@ -619,6 +508,24 @@ importers: specifier: ^3.3.3 version: 3.3.3 + toolchain/package-lint: + dependencies: + '@types/node': + specifier: ^20.14.9 + version: 20.14.10 + json5: + specifier: ^2.2.3 + version: 2.2.3 + + toolchain/test-runner: + devDependencies: + '@types/node': + specifier: ^20.14.9 + version: 20.14.10 + typescript: + specifier: ^5.5.3 + version: 5.5.3 + toolchain/tsconfig: devDependencies: prettier: @@ -627,181 +534,10 @@ importers: packages: - '@ampproject/remapping@2.3.0': - resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} - engines: {node: '>=6.0.0'} - - '@babel/code-frame@7.24.7': - resolution: {integrity: sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==} - engines: {node: '>=6.9.0'} - - '@babel/compat-data@7.24.8': - resolution: {integrity: sha512-c4IM7OTg6k1Q+AJ153e2mc2QVTezTwnb4VzquwcyiEzGnW0Kedv4do/TrkU98qPeC5LNiMt/QXwIjzYXLBpyZg==} - engines: {node: '>=6.9.0'} - - '@babel/core@7.24.8': - resolution: {integrity: sha512-6AWcmZC/MZCO0yKys4uhg5NlxL0ESF3K6IAaoQ+xSXvPyPyxNWRafP+GDbI88Oh68O7QkJgmEtedWPM9U0pZNg==} - engines: {node: '>=6.9.0'} - - '@babel/generator@7.24.8': - resolution: {integrity: sha512-47DG+6F5SzOi0uEvK4wMShmn5yY0mVjVJoWTphdY2B4Rx9wHgjK7Yhtr0ru6nE+sn0v38mzrWOlah0p/YlHHOQ==} - engines: {node: '>=6.9.0'} - - '@babel/helper-compilation-targets@7.24.8': - resolution: {integrity: sha512-oU+UoqCHdp+nWVDkpldqIQL/i/bvAv53tRqLG/s+cOXxe66zOYLU7ar/Xs3LdmBihrUMEUhwu6dMZwbNOYDwvw==} - engines: {node: '>=6.9.0'} - - '@babel/helper-environment-visitor@7.24.7': - resolution: {integrity: sha512-DoiN84+4Gnd0ncbBOM9AZENV4a5ZiL39HYMyZJGZ/AZEykHYdJw0wW3kdcsh9/Kn+BRXHLkkklZ51ecPKmI1CQ==} - engines: {node: '>=6.9.0'} - - '@babel/helper-function-name@7.24.7': - resolution: {integrity: sha512-FyoJTsj/PEUWu1/TYRiXTIHc8lbw+TDYkZuoE43opPS5TrI7MyONBE1oNvfguEXAD9yhQRrVBnXdXzSLQl9XnA==} - engines: {node: '>=6.9.0'} - - '@babel/helper-hoist-variables@7.24.7': - resolution: {integrity: sha512-MJJwhkoGy5c4ehfoRyrJ/owKeMl19U54h27YYftT0o2teQ3FJ3nQUf/I3LlJsX4l3qlw7WRXUmiyajvHXoTubQ==} - engines: {node: '>=6.9.0'} - - '@babel/helper-module-imports@7.24.7': - resolution: {integrity: sha512-8AyH3C+74cgCVVXow/myrynrAGv+nTVg5vKu2nZph9x7RcRwzmh0VFallJuFTZ9mx6u4eSdXZfcOzSqTUm0HCA==} - engines: {node: '>=6.9.0'} - - '@babel/helper-module-transforms@7.24.8': - resolution: {integrity: sha512-m4vWKVqvkVAWLXfHCCfff2luJj86U+J0/x+0N3ArG/tP0Fq7zky2dYwMbtPmkc/oulkkbjdL3uWzuoBwQ8R00Q==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - - '@babel/helper-plugin-utils@7.24.7': - resolution: {integrity: sha512-Rq76wjt7yz9AAc1KnlRKNAi/dMSVWgDRx43FHoJEbcYU6xOWaE2dVPwcdTukJrjxS65GITyfbvEYHvkirZ6uEg==} - engines: {node: '>=6.9.0'} - - '@babel/helper-simple-access@7.24.7': - resolution: {integrity: sha512-zBAIvbCMh5Ts+b86r/CjU+4XGYIs+R1j951gxI3KmmxBMhCg4oQMsv6ZXQ64XOm/cvzfU1FmoCyt6+owc5QMYg==} - engines: {node: '>=6.9.0'} - - '@babel/helper-split-export-declaration@7.24.7': - resolution: {integrity: sha512-oy5V7pD+UvfkEATUKvIjvIAH/xCzfsFVw7ygW2SI6NClZzquT+mwdTfgfdbUiceh6iQO0CHtCPsyze/MZ2YbAA==} - engines: {node: '>=6.9.0'} - - '@babel/helper-string-parser@7.24.8': - resolution: {integrity: sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ==} - engines: {node: '>=6.9.0'} - - '@babel/helper-validator-identifier@7.24.7': - resolution: {integrity: sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==} - engines: {node: '>=6.9.0'} - - '@babel/helper-validator-option@7.24.8': - resolution: {integrity: sha512-xb8t9tD1MHLungh/AIoWYN+gVHaB9kwlu8gffXGSt3FFEIT7RjS+xWbc2vUD1UTZdIpKj/ab3rdqJ7ufngyi2Q==} - engines: {node: '>=6.9.0'} - - '@babel/helpers@7.24.8': - resolution: {integrity: sha512-gV2265Nkcz7weJJfvDoAEVzC1e2OTDpkGbEsebse8koXUJUXPsCMi7sRo/+SPMuMZ9MtUPnGwITTnQnU5YjyaQ==} - engines: {node: '>=6.9.0'} - - '@babel/highlight@7.24.7': - resolution: {integrity: sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==} - engines: {node: '>=6.9.0'} - - '@babel/parser@7.24.8': - resolution: {integrity: sha512-WzfbgXOkGzZiXXCqk43kKwZjzwx4oulxZi3nq2TYL9mOjQv6kYwul9mz6ID36njuL7Xkp6nJEfok848Zj10j/w==} - engines: {node: '>=6.0.0'} - hasBin: true - - '@babel/plugin-syntax-async-generators@7.8.4': - resolution: {integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-syntax-bigint@7.8.3': - resolution: {integrity: sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-syntax-class-properties@7.12.13': - resolution: {integrity: sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-syntax-import-meta@7.10.4': - resolution: {integrity: sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-syntax-json-strings@7.8.3': - resolution: {integrity: sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-syntax-jsx@7.24.7': - resolution: {integrity: sha512-6ddciUPe/mpMnOKv/U+RSd2vvVy+Yw/JfBB0ZHYjEZt9NLHmCUylNYlsbqCCS1Bffjlb0fCwC9Vqz+sBz6PsiQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-syntax-logical-assignment-operators@7.10.4': - resolution: {integrity: sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3': - resolution: {integrity: sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-syntax-numeric-separator@7.10.4': - resolution: {integrity: sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-syntax-object-rest-spread@7.8.3': - resolution: {integrity: sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-syntax-optional-catch-binding@7.8.3': - resolution: {integrity: sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-syntax-optional-chaining@7.8.3': - resolution: {integrity: sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-syntax-top-level-await@7.14.5': - resolution: {integrity: sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-syntax-typescript@7.24.7': - resolution: {integrity: sha512-c/+fVeJBB0FeKsFvwytYiUD+LBvhHjGSI0g446PRGdSVGZLRNArBUno2PETbAly3tpiNAQR5XaZ+JslxkotsbA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - '@babel/runtime@7.24.7': resolution: {integrity: sha512-UwgBRMjJP+xv857DCngvqXI3Iq6J4v0wXmwc6sapg+zyhbwmQX67LUEFrkK5tbyJ30jGuG3ZvWpBiB9LCy1kWw==} engines: {node: '>=6.9.0'} - '@babel/template@7.24.7': - resolution: {integrity: sha512-jYqfPrU9JTF0PmPy1tLYHW4Mp4KlgxJD9l2nP9fD6yT/ICi554DmrWBAEYpIelzjHf1msDP3PxJIRt/nFNfBig==} - engines: {node: '>=6.9.0'} - - '@babel/traverse@7.24.8': - resolution: {integrity: sha512-t0P1xxAPzEDcEPmjprAQq19NWum4K0EQPjMwZQZbHt+GiZqvjCHjj755Weq1YRPVzBI+3zSfvScfpnuIecVFJQ==} - engines: {node: '>=6.9.0'} - - '@babel/types@7.24.8': - resolution: {integrity: sha512-SkSBEHwwJRU52QEVZBmMBnE5Ux2/6WU1grdYyOhpbCNxbmJrDuDCphBzKZSO3taf0zztp+qkWlymE5tVL5l0TA==} - engines: {node: '>=6.9.0'} - - '@bcoe/v8-coverage@0.2.3': - resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} - '@changesets/apply-release-plan@7.0.4': resolution: {integrity: sha512-HLFwhKWayKinWAul0Vj+76jVx1Pc2v55MGPVjZ924Y/ROeSsBMFutv9heHmCUj48lJyRfOTJG5+ar+29FUky/A==} @@ -891,118 +627,6 @@ packages: resolution: {integrity: sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==} engines: {node: '>=18.18'} - '@isaacs/cliui@8.0.2': - resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} - engines: {node: '>=12'} - - '@istanbuljs/load-nyc-config@1.1.0': - resolution: {integrity: sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==} - engines: {node: '>=8'} - - '@istanbuljs/schema@0.1.3': - resolution: {integrity: sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==} - engines: {node: '>=8'} - - '@jest/console@30.0.0-alpha.5': - resolution: {integrity: sha512-60bIFNdU3otnWJljjfnbIntLJ9JUiULI3o+uslyao2j2yP7rYfKdg8sye7NfQ29Zb0IoluBefpEN7s2hVzyz3A==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - - '@jest/core@30.0.0-alpha.5': - resolution: {integrity: sha512-AozuDUK5nPLStNN5W6D4MArMIbA2zxV2NqK+wiJEXQQA2PapiWuOxpLo+mUKMwoA1VQ/afOre1neZ6NpkjPNaw==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true - - '@jest/environment@30.0.0-alpha.5': - resolution: {integrity: sha512-uWnbbtArBcrR6T2XKPlNp5eCxe/48U0imDJMr2t63FIqoIZJOvrVbRtKQEhjzt+c9YkzNoVBOvgu7aLdwVrZ8g==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - - '@jest/expect-utils@30.0.0-alpha.5': - resolution: {integrity: sha512-DwWb4vqgp+Wc/vyrPY3afa5J2PnrKpzW+ckrViWMhp5gu4hnktatBiad9/E8+buUEZWFZLamcqpqk6KtuPQBXw==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - - '@jest/expect@30.0.0-alpha.5': - resolution: {integrity: sha512-Gp4hyR6UUPyplIO9ipcXSSM19xMoWro3+W8VbPrqw9IuOpOs/rVfh3Tn62WP8ZfYYK7CAtUI+Fhx/jiqwTGPtw==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - - '@jest/fake-timers@30.0.0-alpha.5': - resolution: {integrity: sha512-DuQpJP7zz/vBd6/BweFit7+MJVgIEb4gHfoEd9TKIuvoQ4wcIm05LtMDIJYlPe+g/w/Ew01uMYNJ7acvbwxY0g==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - - '@jest/globals@30.0.0-alpha.5': - resolution: {integrity: sha512-4J+6X5IUmrzN3MNLK8BEJxOiA1iDCi7E3gmaIiTxc2w+E+wApxM7XZW7gvJFwqBJLCeo6uSPQ3vr2kcIABxzNQ==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - - '@jest/pattern@30.0.0-alpha.5': - resolution: {integrity: sha512-NkN0G84UurVpBkiKyar+S0smZgnDnUCSPzhqCSrTWMRaoWzBQJTAA0hZkz29nBMEYHtDAWNfimcBlfZMU+H+gQ==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - - '@jest/reporters@30.0.0-alpha.5': - resolution: {integrity: sha512-opFmlGKqNvzMc6nrtxPzm15uJaJx8WZE85fLFt5r/kxipIHGuZ2vPFXfjOJvJENgawYSNL+8Emv51Mm9ZhnJ3A==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true - - '@jest/schemas@29.6.3': - resolution: {integrity: sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - '@jest/schemas@30.0.0-alpha.5': - resolution: {integrity: sha512-um74b5FzrExOuilDqOEcBS0C3lAhR/2sjyNPjLypOkksjtmUZbn9oJTMJ3UmYW5CHoRKOXVnjU/CrOtbfFqrqg==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - - '@jest/snapshot-utils@30.0.0-alpha.5': - resolution: {integrity: sha512-dWf93VC3+f1ZI/pvvyng2m1ffk2giooPayKNVwGxKM8i2WnDcI+4CqZlCQ3mX7b7NYkF9L4xRNrJ3KWuvJR5aA==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - - '@jest/source-map@30.0.0-alpha.5': - resolution: {integrity: sha512-Um5aULXncGNoj3FTNobPoV0Cj8glvEczqSN3AkyvLgprEnjGNWyQi9NPPPcGWBwHmaJBWCUP8+xeTbGalAB9Og==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - - '@jest/test-result@30.0.0-alpha.5': - resolution: {integrity: sha512-aI9sw/JkUb1BnnH4JWX7vsFRP9pXrN8Yjm+ZLXdjtejY7z/oBPz6imx6+lRt/H4u/OhvqrnaA46cQmYNh2977w==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - - '@jest/test-sequencer@30.0.0-alpha.5': - resolution: {integrity: sha512-h8ZCs9XTPLJCxbc2o0EHCFsogx6j2RFJQsWuEoD7drnGw9cGYoopgZUjf64WaptGxh+WUwuqadfceKDQ//usMg==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - - '@jest/transform@30.0.0-alpha.5': - resolution: {integrity: sha512-ng0RZBbSVWzkcLscV/orutlgz6WnVA1yUNGruZ6p8QLow628Gndpmd4JrOGRm66v8DFhwtPUkxzucTJ+3VNpkA==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - - '@jest/types@29.6.3': - resolution: {integrity: sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - '@jest/types@30.0.0-alpha.5': - resolution: {integrity: sha512-Qu4PmAPX6sT2RrodqERoBkbrGz6suKDk/PdaL72q6G4ERg8OspP+ODit+JBJe20F+0QW4v6wsf2vD/L6lCzYcw==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - - '@jridgewell/gen-mapping@0.3.5': - resolution: {integrity: sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==} - engines: {node: '>=6.0.0'} - - '@jridgewell/resolve-uri@3.1.2': - resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} - engines: {node: '>=6.0.0'} - - '@jridgewell/set-array@1.2.1': - resolution: {integrity: sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==} - engines: {node: '>=6.0.0'} - - '@jridgewell/sourcemap-codec@1.4.15': - resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} - - '@jridgewell/trace-mapping@0.3.25': - resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} - '@manypkg/find-root@1.1.0': resolution: {integrity: sha512-mki5uBvhHzO8kYYix/WRy2WX8S3B5wdVSc9D6KcU5lQNglP2yt58/VfLuAK49glRXChosY8ap2oJ1qgma3GUVA==} @@ -1021,33 +645,13 @@ packages: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} engines: {node: '>= 8'} - '@pkgjs/parseargs@0.11.0': - resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} - engines: {node: '>=14'} - - '@pkgr/core@0.1.1': - resolution: {integrity: sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==} - engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} - '@rtsao/scc@1.1.0': resolution: {integrity: sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==} - '@sinclair/typebox@0.27.8': - resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} - - '@sinclair/typebox@0.32.34': - resolution: {integrity: sha512-a3Z3ytYl6R/+7ldxx04PO1semkwWlX/8pTqxsPw4quIcIXDFPZhOc1Wx8azWmkU26ccK3mHwcWenn0avNgAKQg==} - '@sindresorhus/is@5.6.0': resolution: {integrity: sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g==} engines: {node: '>=14.16'} - '@sinonjs/commons@3.0.1': - resolution: {integrity: sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==} - - '@sinonjs/fake-timers@11.2.2': - resolution: {integrity: sha512-G2piCSxQ7oWOxwGSAyFHfPIsyeJGXYtc6mFbnFA+kRXkiEnTl8c/8jul2S329iFBnDI9HGoeWWAZvuvOkZccgw==} - '@szmarczak/http-timer@5.0.1': resolution: {integrity: sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==} engines: {node: '>=14.16'} @@ -1058,30 +662,9 @@ packages: '@types/audioworklet@0.0.57': resolution: {integrity: sha512-Qnza35nR2dXWeQO/O79QVaicqVtzGdnuy89ZkBqCUMQtYrYj+71MA2MWo65rsT1P7sNKHWHeQQHg5ILFaJjMxw==} - '@types/babel__core@7.20.5': - resolution: {integrity: sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==} - - '@types/babel__generator@7.6.8': - resolution: {integrity: sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw==} - - '@types/babel__template@7.4.4': - resolution: {integrity: sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==} - - '@types/babel__traverse@7.20.6': - resolution: {integrity: sha512-r1bzfrm0tomOI8g1SzvCaQHo6Lcv6zu0EA+W2kHrt8dyrHQxGzBBL4kdkzIS+jBMV+EYcMAEAqXqYaLJq5rOZg==} - '@types/http-cache-semantics@4.0.4': resolution: {integrity: sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA==} - '@types/istanbul-lib-coverage@2.0.6': - resolution: {integrity: sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==} - - '@types/istanbul-lib-report@3.0.3': - resolution: {integrity: sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==} - - '@types/istanbul-reports@3.0.4': - resolution: {integrity: sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==} - '@types/node@12.20.55': resolution: {integrity: sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==} @@ -1091,18 +674,9 @@ packages: '@types/semver@7.5.8': resolution: {integrity: sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==} - '@types/stack-utils@2.0.3': - resolution: {integrity: sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==} - '@types/w3c-web-usb@1.0.10': resolution: {integrity: sha512-CHgUI5kTc/QLMP8hODUHhge0D4vx+9UiAwIGiT0sTy/B2XpdX1U5rJt6JSISgr6ikRT7vxV9EVAFeYZqUnl1gQ==} - '@types/yargs-parser@21.0.3': - resolution: {integrity: sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==} - - '@types/yargs@17.0.32': - resolution: {integrity: sha512-xQ67Yc/laOG5uMfX/093MRlGGCIBzZMarVa+gfNKJxWAIgykYpVGkBdbqEzGDDfCrVUj6Hiff4mTZ5BA6TmAog==} - '@typescript-eslint/eslint-plugin@7.16.0': resolution: {integrity: sha512-py1miT6iQpJcs1BiJjm54AMzeuMPBSPuKPlnT8HlfudbcS5rYeX5jajpLf3mrdRh9dA/Ec2FVUY0ifeVNDIhZw==} engines: {node: ^18.18.0 || >=20.0.0} @@ -1209,18 +783,10 @@ packages: resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} engines: {node: '>=6'} - ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} - ansi-regex@5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} - ansi-regex@6.0.1: - resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} - engines: {node: '>=12'} - ansi-styles@3.2.1: resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} engines: {node: '>=4'} @@ -1229,18 +795,6 @@ packages: resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} engines: {node: '>=8'} - ansi-styles@5.2.0: - resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==} - engines: {node: '>=10'} - - ansi-styles@6.2.1: - resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} - engines: {node: '>=12'} - - anymatch@3.1.3: - resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} - engines: {node: '>= 8'} - argparse@1.0.10: resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} @@ -1251,37 +805,9 @@ packages: resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} engines: {node: '>=8'} - async@3.2.5: - resolution: {integrity: sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==} - b4a@1.6.6: resolution: {integrity: sha512-5Tk1HLk6b6ctmjIkAcU/Ujv/1WqiDl0F0JdRCR80VsOcUlHcu7pWeWRlOqQLHfDEsVx9YH/aif5AG4ehoCtTmg==} - babel-jest@30.0.0-alpha.5: - resolution: {integrity: sha512-58KT2/OgHBdfOmM7FdDmWWVKrvrHborUpNys/tu0nnlTyfAqB/lRvqOGN4y8JFe6q9pdTf2AzxU5prFTDbxVMg==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - peerDependencies: - '@babel/core': ^7.11.0 - - babel-plugin-istanbul@6.1.1: - resolution: {integrity: sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==} - engines: {node: '>=8'} - - babel-plugin-jest-hoist@30.0.0-alpha.5: - resolution: {integrity: sha512-Vx32ynouoDRR85S3giKaEfYrZ3Nc73XfCITi4EftNQ16cY/jOPyldrJHIwye79WjTIUj/+bhVgBRZALDYx+Ncw==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - - babel-preset-current-node-syntax@1.0.1: - resolution: {integrity: sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==} - peerDependencies: - '@babel/core': ^7.0.0 - - babel-preset-jest@30.0.0-alpha.5: - resolution: {integrity: sha512-LmoEZClo/Bk87e7g7PTJq25Ote7Bjw/M0AgvPJHz7yc6OGN5cEasP5Ovew8A5RgAGvO39HfWE2R+p5fol8lAhQ==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - peerDependencies: - '@babel/core': ^7.11.0 - balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} @@ -1305,18 +831,6 @@ packages: resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} engines: {node: '>=8'} - browserslist@4.23.2: - resolution: {integrity: sha512-qkqSyistMYdxAcw+CzbZwlBy8AGmS/eEWs+sEV5TnLRGDOL+C5M2EnH6tlZyg0YoAxGJAFKh61En9BR941GnHA==} - engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} - hasBin: true - - bs-logger@0.2.6: - resolution: {integrity: sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==} - engines: {node: '>= 6'} - - bser@2.1.1: - resolution: {integrity: sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==} - buffer-crc32@0.2.13: resolution: {integrity: sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==} @@ -1338,17 +852,6 @@ packages: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} - camelcase@5.3.1: - resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} - engines: {node: '>=6'} - - camelcase@6.3.0: - resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} - engines: {node: '>=10'} - - caniuse-lite@1.0.30001642: - resolution: {integrity: sha512-3XQ0DoRgLijXJErLSl+bLnJ+Et4KqV1PY6JJBGAFlsNsz31zeAIncyeZfLCabHK/jtSh+671RM9YMldxjUPZtA==} - chalk@2.4.2: resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} engines: {node: '>=4'} @@ -1357,10 +860,6 @@ packages: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} - char-regex@1.0.2: - resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} - engines: {node: '>=10'} - chardet@0.7.0: resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} @@ -1368,24 +867,6 @@ packages: resolution: {integrity: sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==} engines: {node: '>=8'} - ci-info@4.0.0: - resolution: {integrity: sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==} - engines: {node: '>=8'} - - cjs-module-lexer@1.3.1: - resolution: {integrity: sha512-a3KdPAANPbNE4ZUv9h6LckSl9zLsYOP4MBmhIPkRaeyybt+r4UghLvq+xw/YwUcC1gqylCkL4rdVs3Lwupjm4Q==} - - cliui@8.0.1: - resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} - engines: {node: '>=12'} - - co@4.6.0: - resolution: {integrity: sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==} - engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'} - - collect-v8-coverage@1.0.2: - resolution: {integrity: sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==} - color-convert@1.9.3: resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} @@ -1413,14 +894,6 @@ packages: resolution: {integrity: sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==} engines: {node: '>= 0.6'} - convert-source-map@2.0.0: - resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} - - cross-env@7.0.3: - resolution: {integrity: sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==} - engines: {node: '>=10.14', npm: '>=6', yarn: '>=1'} - hasBin: true - cross-spawn@5.1.0: resolution: {integrity: sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==} @@ -1453,21 +926,9 @@ packages: resolution: {integrity: sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==} engines: {node: '>=10'} - dedent@1.5.3: - resolution: {integrity: sha512-NHQtfOOW68WD8lgypbLA5oT+Bt0xXJhiYvoR6SmmNXZfpzOGXwdKWmcwG8N7PwVVWV3eF/68nmD9BaJSsTBhyQ==} - peerDependencies: - babel-plugin-macros: ^3.1.0 - peerDependenciesMeta: - babel-plugin-macros: - optional: true - deep-is@0.1.4: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} - deepmerge@4.3.1: - resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} - engines: {node: '>=0.10.0'} - defer-to-connect@2.0.1: resolution: {integrity: sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==} engines: {node: '>=10'} @@ -1476,14 +937,6 @@ packages: resolution: {integrity: sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==} engines: {node: '>=8'} - detect-newline@3.1.0: - resolution: {integrity: sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==} - engines: {node: '>=8'} - - diff-sequences@30.0.0-alpha.5: - resolution: {integrity: sha512-zztnoTBNChfe30emTHZw382eoMZlTWS/t4R88HU2UCmiw38dlgTwglI+xqaUhZiEg/CnA20ZRVBaBIio3TazIw==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - dir-glob@3.0.1: resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} engines: {node: '>=8'} @@ -1492,46 +945,14 @@ packages: resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} engines: {node: '>=6.0.0'} - eastasianwidth@0.2.0: - resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} - - ejs@3.1.10: - resolution: {integrity: sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==} - engines: {node: '>=0.10.0'} - hasBin: true - - electron-to-chromium@1.4.827: - resolution: {integrity: sha512-VY+J0e4SFcNfQy19MEoMdaIcZLmDCprqvBtkii1WTCTQHpRvf5N8+3kTYCgL/PcntvwQvmMJWTuDPsq+IlhWKQ==} - - emittery@0.13.1: - resolution: {integrity: sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==} - engines: {node: '>=12'} - - emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - - emoji-regex@9.2.2: - resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} - enquirer@2.4.1: resolution: {integrity: sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==} engines: {node: '>=8.6'} - error-ex@1.3.2: - resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} - - escalade@3.1.2: - resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} - engines: {node: '>=6'} - escape-string-regexp@1.0.5: resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} engines: {node: '>=0.8.0'} - escape-string-regexp@2.0.0: - resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} - engines: {node: '>=8'} - escape-string-regexp@4.0.0: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} @@ -1591,18 +1012,6 @@ packages: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} engines: {node: '>=0.10.0'} - execa@5.1.1: - resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} - engines: {node: '>=10'} - - exit@0.1.2: - resolution: {integrity: sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==} - engines: {node: '>= 0.8.0'} - - expect@30.0.0-alpha.5: - resolution: {integrity: sha512-8hBXtSCQuJnZFOUAAiih2GYDRg93h2Ui6XL9BPu6QgSvlSozTLCtCyDsNPq7aL0D43H5uYHwqXiVfWW6MIlJhw==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - ext-list@2.2.2: resolution: {integrity: sha512-u+SQgsubraE6zItfVA0tBuCBhfU9ogSRnsvygI7wht9TS510oLkBRXBsqopeUG/GBOIQyKZO9wjTqIu/sf5zFA==} engines: {node: '>=0.10.0'} @@ -1637,9 +1046,6 @@ packages: fastq@1.17.1: resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} - fb-watchman@2.0.2: - resolution: {integrity: sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==} - fd-slicer@1.1.0: resolution: {integrity: sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==} @@ -1655,9 +1061,6 @@ packages: resolution: {integrity: sha512-ihHtXRzXEziMrQ56VSgU7wkxh55iNchFkosu7Y9/S+tXHdKyrGjVK0ujbqNnsxzea+78MaLhN6PGmfYSAv1ACw==} engines: {node: '>=14.16'} - filelist@1.0.4: - resolution: {integrity: sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==} - filename-reserved-regex@3.0.0: resolution: {integrity: sha512-hn4cQfU6GOT/7cFHXBqeBg2TbrMBgdD0kcjLhvSQYYwm3s4B6cjvBfb7nBALJLAXqmU5xajSa7X2NnUud/VCdw==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -1688,10 +1091,6 @@ packages: flatted@3.3.1: resolution: {integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==} - foreground-child@3.2.1: - resolution: {integrity: sha512-PXUUyLqrR2XCWICfv6ukppP96sdFwWbNEnfEMt7jNsISjMsvaLNinAHNDYyvkyU+SZG2BTSbT5NjG+vZslfGTA==} - engines: {node: '>=14'} - form-data-encoder@2.1.4: resolution: {integrity: sha512-yDYSgNMraqvnxiEXO4hi88+YZxaHC6QKzb5N84iRCTDeRO7ZALpir/lVmf/uXUhnwUr2O4HU8s/n6x+yNjQkHw==} engines: {node: '>= 14.17'} @@ -1708,29 +1107,9 @@ packages: resolution: {integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==} engines: {node: '>=6 <7 || >=8'} - fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - - fsevents@2.3.3: - resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} - engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} - os: [darwin] - function-bind@1.1.2: resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} - gensync@1.0.0-beta.2: - resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} - engines: {node: '>=6.9.0'} - - get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} - - get-package-type@0.1.0: - resolution: {integrity: sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==} - engines: {node: '>=8.0.0'} - get-stream@6.0.1: resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} engines: {node: '>=10'} @@ -1750,19 +1129,6 @@ packages: resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} engines: {node: '>=10.13.0'} - glob@10.4.3: - resolution: {integrity: sha512-Q38SGlYRpVtDBPSWEylRyctn7uDeTp4NQERTLiCT1FqA9JXPYWqAVmQU6qh4r/zMM5ehxTcbaO8EjhWnvEhmyg==} - engines: {node: '>=18'} - hasBin: true - - glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - deprecated: Glob versions prior to v9 are no longer supported - - globals@11.12.0: - resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} - engines: {node: '>=4'} - globals@14.0.0: resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} engines: {node: '>=18'} @@ -1793,9 +1159,6 @@ packages: resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} engines: {node: '>= 0.4'} - html-escaper@2.0.2: - resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} - http-cache-semantics@4.1.1: resolution: {integrity: sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==} @@ -1806,10 +1169,6 @@ packages: human-id@1.0.2: resolution: {integrity: sha512-UNopramDEhHJD+VR+ehk8rOslwSfByxPIZyJRfV739NDhN5LF1fa1MqnzKm2lGTQRjNrjK19Q5fhkgIfjlVUKw==} - human-signals@2.1.0: - resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} - engines: {node: '>=10.17.0'} - iconv-lite@0.4.24: resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} engines: {node: '>=0.10.0'} @@ -1825,28 +1184,16 @@ packages: resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} engines: {node: '>=6'} - import-local@3.1.0: - resolution: {integrity: sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==} - engines: {node: '>=8'} - hasBin: true - imurmurhash@0.1.4: resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} engines: {node: '>=0.8.19'} - inflight@1.0.6: - resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} - deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. - inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} inspect-with-kind@1.0.5: resolution: {integrity: sha512-MAQUJuIo7Xqk8EVNP+6d3CKq9c80hi4tjIbIAT6lmGW9W6WzlHiu9PS8uSuUYU+Do+j1baiFp3H25XEVxDIG2g==} - is-arrayish@0.2.1: - resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} - is-core-module@2.14.0: resolution: {integrity: sha512-a5dFJih5ZLYlRtDc0dZWP7RiKr6xIKzmn/oAYCDvdLThadVgyJwlaoQPmRtMSpz+rk0OGAgIu+TcM9HUF0fk1A==} engines: {node: '>= 0.4'} @@ -1855,14 +1202,6 @@ packages: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} - is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} - - is-generator-fn@2.1.0: - resolution: {integrity: sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==} - engines: {node: '>=6'} - is-glob@4.0.3: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} @@ -1883,10 +1222,6 @@ packages: resolution: {integrity: sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==} engines: {node: '>=8'} - is-stream@2.0.1: - resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} - engines: {node: '>=8'} - is-stream@3.0.0: resolution: {integrity: sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -1902,175 +1237,6 @@ packages: isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} - istanbul-lib-coverage@3.2.2: - resolution: {integrity: sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==} - engines: {node: '>=8'} - - istanbul-lib-instrument@5.2.1: - resolution: {integrity: sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==} - engines: {node: '>=8'} - - istanbul-lib-instrument@6.0.3: - resolution: {integrity: sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==} - engines: {node: '>=10'} - - istanbul-lib-report@3.0.1: - resolution: {integrity: sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==} - engines: {node: '>=10'} - - istanbul-lib-source-maps@5.0.6: - resolution: {integrity: sha512-yg2d+Em4KizZC5niWhQaIomgf5WlL4vOOjZ5xGCmF8SnPE/mDWWXgvRExdcpCgh9lLRRa1/fSYp2ymmbJ1pI+A==} - engines: {node: '>=10'} - - istanbul-reports@3.1.7: - resolution: {integrity: sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==} - engines: {node: '>=8'} - - jackspeak@3.4.1: - resolution: {integrity: sha512-U23pQPDnmYybVkYjObcuYMk43VRlMLLqLI+RdZy8s8WV8WsxO9SnqSroKaluuvcNOdCAlauKszDwd+umbot5Mg==} - engines: {node: '>=18'} - - jake@10.9.1: - resolution: {integrity: sha512-61btcOHNnLnsOdtLgA5efqQWjnSi/vow5HbI7HMdKKWqvrKR1bLK3BPlJn9gcSaP2ewuamUSMB5XEy76KUIS2w==} - engines: {node: '>=10'} - hasBin: true - - jest-changed-files@30.0.0-alpha.5: - resolution: {integrity: sha512-B6GjanWozUsg3tho2CFo4JYZ3iqMOdXexOEre1CQHTUecwAH3uNm9aIy4E1QTX41xEGEbPdBq7b1SHZKe6yPkg==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - - jest-circus@30.0.0-alpha.5: - resolution: {integrity: sha512-ENNme2MvQc7WZ7EvcJclSV+MI7cLQzTXY/727Fwy3EojewKYXH8aPeZsnKssI2T3kdnjqTb/8uXryMX5IznuEg==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - - jest-cli@30.0.0-alpha.5: - resolution: {integrity: sha512-1POf1608rIeein/m7rarK5grGZGQEhAtRolcKM+qKtvYrJ8O7Cj6Siig0fAadqT0LCRHMgwaU2o6JPewORmMyw==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - hasBin: true - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true - - jest-config@30.0.0-alpha.5: - resolution: {integrity: sha512-nczn/2mp3+j4pO5wT/fT9l7PY1nFdQZkvskFxsjdlKHP0anDK0i3zZTzVpNpdOqA/lX5lncVedzj2yPzWtv1tQ==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - peerDependencies: - '@types/node': '*' - ts-node: '>=9.0.0' - peerDependenciesMeta: - '@types/node': - optional: true - ts-node: - optional: true - - jest-diff@30.0.0-alpha.5: - resolution: {integrity: sha512-IX4X/Ubh3LmlsL5iFUUpYNvGsO+Il1tgu7HFdlrRFEIr0WbpAittobjIQJpoE2PJZbJ8oenxilcVyFjx0tZXNg==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - - jest-docblock@30.0.0-alpha.5: - resolution: {integrity: sha512-P3BGGmZ7z0pyD1mgVRzsfMmjyj+zpn839p/y44tRS8k50Fg+NCL5qUoKHjDLAUnLHcwQxFfk8nrqraebphHfZA==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - - jest-each@30.0.0-alpha.5: - resolution: {integrity: sha512-7a+NZmWFU5oPYjon0uG76rDLMVK2TKrrMZOBtROE3nnnrXuwp5TMKqMV8xpX3I8q7qJA/IIoW7EzFnR/XhnzzQ==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - - jest-environment-node@30.0.0-alpha.5: - resolution: {integrity: sha512-UzHsz+aarw8e2+JVvpFA1Qi+2Az/nfCcvgir9nP/JvHRqM+I6wG8LLGhpihp1nraYtmhwu5+kxGbEjOe0UYMgg==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - - jest-get-type@30.0.0-alpha.5: - resolution: {integrity: sha512-ARPyHe90hG5fJH7nkxnmSCIUpeCIJcsGAUA2+a0MwptFfNJKBOYpkq/SnFaS7i994R50E4n9Beq8kUC2vVVVkw==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - - jest-haste-map@30.0.0-alpha.5: - resolution: {integrity: sha512-9wCSxvqItNAiXfzEf7zuYG0mcmDCFKnkrneH0M60aDfnsQ5B4dHjs4UHcjtUJiM1txWMCa2fjTvNUP4RhwaGnQ==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - - jest-leak-detector@30.0.0-alpha.5: - resolution: {integrity: sha512-GTvYhmVSWajONNYHy6XsEjXbz/d97kmyn9JLzT5Cdlzxftwx1j/1c6HrTIYTQPC1JnYoVty5GQRMZilXgSi5kA==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - - jest-matcher-utils@30.0.0-alpha.5: - resolution: {integrity: sha512-VYGnROjw1x18rplUzGhccox9AynqQDQgDyhCzAQXmilDlk+quGt6J+sURa7kGwcVcZO+nF/ICGHphrcAvavMqA==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - - jest-message-util@30.0.0-alpha.5: - resolution: {integrity: sha512-adNjtJLdcE0r1AlaV/9sSwBm6cT6c8/CdHE6IMTEIItvn/6+eSACom0ZaYVUkz8mCdE87DVp4E9JaI7CyfybNw==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - - jest-mock@30.0.0-alpha.5: - resolution: {integrity: sha512-n+KPnCMJOs+W4mhIQzaO0wVJiAbGDH/HMqa/Hq8V/QLNKNzCF9jqN+DHVn3OKmizyjX7fQmp/fg0SVHQTh/SCw==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - - jest-pnp-resolver@1.2.3: - resolution: {integrity: sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==} - engines: {node: '>=6'} - peerDependencies: - jest-resolve: '*' - peerDependenciesMeta: - jest-resolve: - optional: true - - jest-regex-util@30.0.0-alpha.5: - resolution: {integrity: sha512-b8LtZJTG17X/1Hm+s2A+YOh3pJbBoOV/K91N2Pl29MjcwsKwwlOUjkeY2GJwid+Z8kFZ7cbLYadDI7YCV+YEOA==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - - jest-resolve-dependencies@30.0.0-alpha.5: - resolution: {integrity: sha512-9urYvTflJ2+rnZHbI71gBUXpqIrB/G9OxUybzrw1IJML6jc88pbvE/b5xz1+G2TI4pygEbALRhHGAdw/k1e6+g==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - - jest-resolve@30.0.0-alpha.5: - resolution: {integrity: sha512-tuAhahDAPeMzYJDA0FoJV2kXdKWTueLTohy2vPJRp3Xk9eyHwVNxtsB5QwQv/4FWQ3xto9mfGW0F+8RzRAtFkQ==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - - jest-runner@30.0.0-alpha.5: - resolution: {integrity: sha512-w85S1WNna31g/vHpfS5vGDkSEjZGv8YIJUclieJpcbEHZSg5vSs9VlbnMo4N8f5oYYm0TzxBfkcL4JKyIojnWw==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - - jest-runtime@30.0.0-alpha.5: - resolution: {integrity: sha512-u49zkJUaWV11sFtIFCOpOPhT2WDEYBjWiQ2vkiIZ+CqkWjjAdojnEJKwU9lVabUNo4JlKOBhbYpXaJyFak0EaQ==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - - jest-snapshot@30.0.0-alpha.5: - resolution: {integrity: sha512-XMAnYEAgehvxNu+Hb+fJFf725XKp7WjbaWaPFpUJaxBXx/dGYCvyZxT+zONU6WbeYAguhQ33HeTxH3uAPAfhUw==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - - jest-util@29.7.0: - resolution: {integrity: sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - - jest-util@30.0.0-alpha.5: - resolution: {integrity: sha512-sWme530oJ6RXgXSgORZqV0YnPaG/Mb+VM8EJxr2AMOwc6YS63KDGI/NKT1M+rfFDD+U9VU3IBpnkEo5Ywi8LjQ==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - - jest-validate@30.0.0-alpha.5: - resolution: {integrity: sha512-Xy2X/q2SGx1YYHBZ7XE4k0cNHpvCsW45TI1QngVxzNpnbl+VUgIGb+YTc/EnKFckQj13w9ReMVQwqZViSjSB/g==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - - jest-watcher@30.0.0-alpha.5: - resolution: {integrity: sha512-TFzV/GtI3tA4ab0IP2HZyaZ7skMS1yu2HmLfznAjhFixZpdkA3zsRevH5nX0YZo+2zAO/jgrJoXdWH8OexjMug==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - - jest-worker@30.0.0-alpha.5: - resolution: {integrity: sha512-BNOP7TMpf4Fw+f7IiVxXS//NroCY/nAzR4yAr5ABkHZDTh3eWIBwGWNCBqK/IBZcaStQYqvgTwjVWgfPAUalPQ==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - - jest@30.0.0-alpha.5: - resolution: {integrity: sha512-9NLqkZFNNONpDxBV95Zm3NRGMssGYH1x7SD+4fnzy5Wf6RaFv1buG3Zwb8nkAeZPIhsTmNFKCMiFCGSrPDeiaQ==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - hasBin: true - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true - - js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - js-yaml@3.14.1: resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} hasBin: true @@ -2079,17 +1245,9 @@ packages: resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} hasBin: true - jsesc@2.5.2: - resolution: {integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==} - engines: {node: '>=4'} - hasBin: true - json-buffer@3.0.1: resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} - json-parse-even-better-errors@2.3.1: - resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} - json-schema-traverse@0.4.1: resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} @@ -2111,17 +1269,10 @@ packages: resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==} engines: {node: '>=0.10.0'} - leven@3.1.0: - resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==} - engines: {node: '>=6'} - levn@0.4.1: resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} engines: {node: '>= 0.8.0'} - lines-and-columns@1.2.4: - resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} - load-yaml-file@0.2.0: resolution: {integrity: sha512-OfCBkGEw4nN6JLtgRidPX6QxjBQGQf72q3si2uvqyFEMbycSFFHwAZeXx6cJgFM9wmLrf9zBwCP3Ivqa+LLZPw==} engines: {node: '>=6'} @@ -2134,9 +1285,6 @@ packages: resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} engines: {node: '>=10'} - lodash.memoize@4.1.2: - resolution: {integrity: sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==} - lodash.merge@4.6.2: resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} @@ -2147,33 +1295,17 @@ packages: resolution: {integrity: sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - lru-cache@10.3.1: - resolution: {integrity: sha512-9/8QXrtbGeMB6LxwQd4x1tIMnsmUxMvIH/qWGsccz6bt9Uln3S+sgAaqfQNhbGA8ufzs2fHuP/yqapGgP9Hh2g==} - engines: {node: '>=18'} - lru-cache@4.1.5: resolution: {integrity: sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==} - lru-cache@5.1.1: - resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} - make-dir@4.0.0: resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==} engines: {node: '>=10'} - make-error@1.3.6: - resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} - - makeerror@1.0.12: - resolution: {integrity: sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==} - merge-options@3.0.4: resolution: {integrity: sha512-2Sug1+knBjkaMsMgf1ctR1Ujx+Ayku4EdJN4Z+C2+JzoeF7A3OZ9KM2GY0CpQS51NR61LTurMJrRKPhSs3ZRTQ==} engines: {node: '>=10'} - merge-stream@2.0.0: - resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} - merge2@1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} @@ -2186,10 +1318,6 @@ packages: resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} engines: {node: '>= 0.6'} - mimic-fn@2.1.0: - resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} - engines: {node: '>=6'} - mimic-response@3.1.0: resolution: {integrity: sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==} engines: {node: '>=10'} @@ -2201,18 +1329,10 @@ packages: minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - minimatch@5.1.6: - resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==} - engines: {node: '>=10'} - minimatch@9.0.5: resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==} engines: {node: '>=16 || 14 >=14.17'} - minipass@7.1.2: - resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==} - engines: {node: '>=16 || 14 >=14.17'} - mri@1.2.0: resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==} engines: {node: '>=4'} @@ -2234,31 +1354,10 @@ packages: resolution: {integrity: sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - node-int64@0.4.0: - resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==} - - node-releases@2.0.14: - resolution: {integrity: sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==} - - normalize-path@3.0.0: - resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} - engines: {node: '>=0.10.0'} - normalize-url@8.0.1: resolution: {integrity: sha512-IO9QvjUMWxPQQhs60oOu10CRkWCiZzSUkzbXGGV9pviYl1fXYcvkzQ5jV9z8Y6un8ARoVRl4EtC6v6jNqbaJ/w==} engines: {node: '>=14.16'} - npm-run-path@4.0.1: - resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} - engines: {node: '>=8'} - - once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - - onetime@5.1.2: - resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} - engines: {node: '>=6'} - optionator@0.9.4: resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} engines: {node: '>= 0.8.0'} @@ -2310,25 +1409,14 @@ packages: resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} engines: {node: '>=6'} - package-json-from-dist@1.0.0: - resolution: {integrity: sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==} - parent-module@1.0.1: resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} engines: {node: '>=6'} - parse-json@5.2.0: - resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} - engines: {node: '>=8'} - path-exists@4.0.0: resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} engines: {node: '>=8'} - path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} - path-key@3.1.1: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} engines: {node: '>=8'} @@ -2336,10 +1424,6 @@ packages: path-parse@1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} - path-scurry@1.11.1: - resolution: {integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==} - engines: {node: '>=16 || 14 >=14.18'} - path-type@4.0.0: resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} engines: {node: '>=8'} @@ -2351,25 +1435,14 @@ packages: pend@1.2.0: resolution: {integrity: sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==} - picocolors@1.0.1: - resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} - picomatch@2.3.1: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} - picomatch@4.0.2: - resolution: {integrity: sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==} - engines: {node: '>=12'} - pify@4.0.1: resolution: {integrity: sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==} engines: {node: '>=6'} - pirates@4.0.6: - resolution: {integrity: sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==} - engines: {node: '>= 6'} - pkg-dir@4.2.0: resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} engines: {node: '>=8'} @@ -2392,10 +1465,6 @@ packages: engines: {node: '>=14'} hasBin: true - pretty-format@30.0.0-alpha.5: - resolution: {integrity: sha512-qRzqj0zWh2CRvL9UbWGksN9YSSuzzvNqexrDBwKiH48RVX00BQCxHwSfWF+sigp3IZGKxjG2nud42SQQU8q3Yg==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - pseudomap@1.0.2: resolution: {integrity: sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==} @@ -2403,9 +1472,6 @@ packages: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} - pure-rand@6.1.0: - resolution: {integrity: sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==} - queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} @@ -2416,9 +1482,6 @@ packages: resolution: {integrity: sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==} engines: {node: '>=10'} - react-is@18.3.1: - resolution: {integrity: sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==} - read-yaml-file@1.1.0: resolution: {integrity: sha512-VIMnQi/Z4HT2Fxuwg5KrY174U1VdUIASQVWXXyqtNRtxSr9IYkn1rsI6Tb6HsrHCmB7gVpNwX6JxPTHcH6IoTA==} engines: {node: '>=6'} @@ -2434,17 +1497,9 @@ packages: regenerator-runtime@0.14.1: resolution: {integrity: sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==} - require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - resolve-alpn@1.2.1: resolution: {integrity: sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==} - resolve-cwd@3.0.0: - resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} - engines: {node: '>=8'} - resolve-from@4.0.0: resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} engines: {node: '>=4'} @@ -2456,10 +1511,6 @@ packages: resolve-pkg-maps@1.0.0: resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} - resolve.exports@2.0.2: - resolution: {integrity: sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==} - engines: {node: '>=10'} - resolve@1.22.8: resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==} hasBin: true @@ -2485,10 +1536,6 @@ packages: resolution: {integrity: sha512-e1QtP3YL5tWww8uKaOCQ18UxIT2laNBXHjV/S2WYCiK4udiv8lkG89KRIoCjUagnAmCBurjF4zEVX2ByBbnCjQ==} hasBin: true - semver@6.3.1: - resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} - hasBin: true - semver@7.6.2: resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} engines: {node: '>=10'} @@ -2513,10 +1560,6 @@ packages: signal-exit@3.0.7: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - signal-exit@4.1.0: - resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} - engines: {node: '>=14'} - slash@3.0.0: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} engines: {node: '>=8'} @@ -2529,9 +1572,6 @@ packages: resolution: {integrity: sha512-vzn8aSqKgytVik0iwdBEi+zevbTYZogewTUM6dtpmGwEcdzbub/TX4bCzRhebDCRC3QzXgJsLRKB2V/Oof7HXg==} engines: {node: '>=0.10.0'} - source-map-support@0.5.13: - resolution: {integrity: sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==} - source-map-support@0.5.21: resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==} @@ -2548,25 +1588,9 @@ packages: stable-hash@0.0.4: resolution: {integrity: sha512-LjdcbuBeLcdETCrPn9i8AYAZ1eCtu4ECAWtP7UleOiZ9LzVxRzzUZEoZ8zB24nhkQnDWyET0I+3sWokSDS3E7g==} - stack-utils@2.0.6: - resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} - engines: {node: '>=10'} - streamx@2.18.0: resolution: {integrity: sha512-LLUC1TWdjVdn1weXGcSxyTR3T4+acB6tVGXT95y0nGbca4t4o/ng1wKAGTljm9VicuCVLvRlqFYXYy5GwgM7sQ==} - string-length@4.0.2: - resolution: {integrity: sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==} - engines: {node: '>=10'} - - string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} - - string-width@5.1.2: - resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==} - engines: {node: '>=12'} - string_decoder@1.3.0: resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} @@ -2574,25 +1598,13 @@ packages: resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} engines: {node: '>=8'} - strip-ansi@7.1.0: - resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} - engines: {node: '>=12'} - strip-bom@3.0.0: resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} engines: {node: '>=4'} - strip-bom@4.0.0: - resolution: {integrity: sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==} - engines: {node: '>=8'} - strip-dirs@3.0.0: resolution: {integrity: sha512-I0sdgcFTfKQlUPZyAqPJmSG3HLO9rWDFnxonnIbskYNM3DwFOeTNB5KzVq3dA1GdRAc/25b5Y7UO2TQfKWw4aQ==} - strip-final-newline@2.0.0: - resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} - engines: {node: '>=6'} - strip-json-comments@3.1.1: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} @@ -2613,18 +1625,10 @@ packages: resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} engines: {node: '>=8'} - supports-color@8.1.1: - resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==} - engines: {node: '>=10'} - supports-preserve-symlinks-flag@1.0.0: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} - synckit@0.9.0: - resolution: {integrity: sha512-7RnqIMq572L8PeEzKeBINYEJDDxpcH8JEgLwUqBd3TkofhFRbkq4QLR0u+36avGAhCRbk2nnmjcW9SE531hPDg==} - engines: {node: ^14.18.0 || >=16.0.0} - tar-stream@3.1.7: resolution: {integrity: sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ==} @@ -2632,10 +1636,6 @@ packages: resolution: {integrity: sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg==} engines: {node: '>=8'} - test-exclude@6.0.0: - resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==} - engines: {node: '>=8'} - text-decoder@1.1.0: resolution: {integrity: sha512-TmLJNj6UgX8xcUZo4UDStGQtDiTzF7BzWlzn9g7UWrjkpHr5uJTK1ld16wZ3LXb2vb6jH8qU89dW5whuMdXYdw==} @@ -2655,13 +1655,6 @@ packages: resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} engines: {node: '>=0.6.0'} - tmpl@1.0.5: - resolution: {integrity: sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==} - - to-fast-properties@2.0.0: - resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==} - engines: {node: '>=4'} - to-regex-range@5.0.1: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} @@ -2680,30 +1673,6 @@ packages: peerDependencies: typescript: '>=4.2.0' - ts-jest@29.2.2: - resolution: {integrity: sha512-sSW7OooaKT34AAngP6k1VS669a0HdLxkQZnlC7T76sckGCokXFnvJ3yRlQZGRTAoV5K19HfSgCiSwWOSIfcYlg==} - engines: {node: ^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0} - hasBin: true - peerDependencies: - '@babel/core': '>=7.0.0-beta.0 <8' - '@jest/transform': ^29.0.0 - '@jest/types': ^29.0.0 - babel-jest: ^29.0.0 - esbuild: '*' - jest: ^29.0.0 - typescript: '>=4.3 <6' - peerDependenciesMeta: - '@babel/core': - optional: true - '@jest/transform': - optional: true - '@jest/types': - optional: true - babel-jest: - optional: true - esbuild: - optional: true - tslib@2.6.3: resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==} @@ -2711,14 +1680,6 @@ packages: resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} engines: {node: '>= 0.8.0'} - type-detect@4.0.8: - resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} - engines: {node: '>=4'} - - type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} - engines: {node: '>=10'} - typescript-eslint@7.16.0: resolution: {integrity: sha512-kaVRivQjOzuoCXU6+hLnjo3/baxyzWVO5GrnExkFzETRYJKVHYkrJglOu2OCm8Hi9RPDWX1PTNNTpU5KRV0+RA==} engines: {node: ^18.18.0 || >=20.0.0} @@ -2744,25 +1705,12 @@ packages: resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} engines: {node: '>= 4.0.0'} - update-browserslist-db@1.1.0: - resolution: {integrity: sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ==} - hasBin: true - peerDependencies: - browserslist: '>= 4.21.0' - uri-js@4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - v8-to-istanbul@9.3.0: - resolution: {integrity: sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==} - engines: {node: '>=10.12.0'} - - walker@1.0.8: - resolution: {integrity: sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==} - web-streams-polyfill@3.3.3: resolution: {integrity: sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==} engines: {node: '>= 8'} @@ -2784,39 +1732,9 @@ packages: resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} engines: {node: '>=0.10.0'} - wrap-ansi@7.0.0: - resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} - engines: {node: '>=10'} - - wrap-ansi@8.1.0: - resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} - engines: {node: '>=12'} - - wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - - write-file-atomic@5.0.1: - resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - - y18n@5.0.8: - resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} - engines: {node: '>=10'} - yallist@2.1.2: resolution: {integrity: sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==} - yallist@3.1.1: - resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} - - yargs-parser@21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} - - yargs@17.7.2: - resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} - engines: {node: '>=12'} - yauzl@2.10.0: resolution: {integrity: sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==} @@ -2832,222 +1750,10 @@ packages: snapshots: - '@ampproject/remapping@2.3.0': - dependencies: - '@jridgewell/gen-mapping': 0.3.5 - '@jridgewell/trace-mapping': 0.3.25 - - '@babel/code-frame@7.24.7': - dependencies: - '@babel/highlight': 7.24.7 - picocolors: 1.0.1 - - '@babel/compat-data@7.24.8': {} - - '@babel/core@7.24.8': - dependencies: - '@ampproject/remapping': 2.3.0 - '@babel/code-frame': 7.24.7 - '@babel/generator': 7.24.8 - '@babel/helper-compilation-targets': 7.24.8 - '@babel/helper-module-transforms': 7.24.8(@babel/core@7.24.8) - '@babel/helpers': 7.24.8 - '@babel/parser': 7.24.8 - '@babel/template': 7.24.7 - '@babel/traverse': 7.24.8 - '@babel/types': 7.24.8 - convert-source-map: 2.0.0 - debug: 4.3.5 - gensync: 1.0.0-beta.2 - json5: 2.2.3 - semver: 6.3.1 - transitivePeerDependencies: - - supports-color - - '@babel/generator@7.24.8': - dependencies: - '@babel/types': 7.24.8 - '@jridgewell/gen-mapping': 0.3.5 - '@jridgewell/trace-mapping': 0.3.25 - jsesc: 2.5.2 - - '@babel/helper-compilation-targets@7.24.8': - dependencies: - '@babel/compat-data': 7.24.8 - '@babel/helper-validator-option': 7.24.8 - browserslist: 4.23.2 - lru-cache: 5.1.1 - semver: 6.3.1 - - '@babel/helper-environment-visitor@7.24.7': - dependencies: - '@babel/types': 7.24.8 - - '@babel/helper-function-name@7.24.7': - dependencies: - '@babel/template': 7.24.7 - '@babel/types': 7.24.8 - - '@babel/helper-hoist-variables@7.24.7': - dependencies: - '@babel/types': 7.24.8 - - '@babel/helper-module-imports@7.24.7': - dependencies: - '@babel/traverse': 7.24.8 - '@babel/types': 7.24.8 - transitivePeerDependencies: - - supports-color - - '@babel/helper-module-transforms@7.24.8(@babel/core@7.24.8)': - dependencies: - '@babel/core': 7.24.8 - '@babel/helper-environment-visitor': 7.24.7 - '@babel/helper-module-imports': 7.24.7 - '@babel/helper-simple-access': 7.24.7 - '@babel/helper-split-export-declaration': 7.24.7 - '@babel/helper-validator-identifier': 7.24.7 - transitivePeerDependencies: - - supports-color - - '@babel/helper-plugin-utils@7.24.7': {} - - '@babel/helper-simple-access@7.24.7': - dependencies: - '@babel/traverse': 7.24.8 - '@babel/types': 7.24.8 - transitivePeerDependencies: - - supports-color - - '@babel/helper-split-export-declaration@7.24.7': - dependencies: - '@babel/types': 7.24.8 - - '@babel/helper-string-parser@7.24.8': {} - - '@babel/helper-validator-identifier@7.24.7': {} - - '@babel/helper-validator-option@7.24.8': {} - - '@babel/helpers@7.24.8': - dependencies: - '@babel/template': 7.24.7 - '@babel/types': 7.24.8 - - '@babel/highlight@7.24.7': - dependencies: - '@babel/helper-validator-identifier': 7.24.7 - chalk: 2.4.2 - js-tokens: 4.0.0 - picocolors: 1.0.1 - - '@babel/parser@7.24.8': - dependencies: - '@babel/types': 7.24.8 - - '@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.24.8)': - dependencies: - '@babel/core': 7.24.8 - '@babel/helper-plugin-utils': 7.24.7 - - '@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.24.8)': - dependencies: - '@babel/core': 7.24.8 - '@babel/helper-plugin-utils': 7.24.7 - - '@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.24.8)': - dependencies: - '@babel/core': 7.24.8 - '@babel/helper-plugin-utils': 7.24.7 - - '@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.24.8)': - dependencies: - '@babel/core': 7.24.8 - '@babel/helper-plugin-utils': 7.24.7 - - '@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.24.8)': - dependencies: - '@babel/core': 7.24.8 - '@babel/helper-plugin-utils': 7.24.7 - - '@babel/plugin-syntax-jsx@7.24.7(@babel/core@7.24.8)': - dependencies: - '@babel/core': 7.24.8 - '@babel/helper-plugin-utils': 7.24.7 - - '@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.24.8)': - dependencies: - '@babel/core': 7.24.8 - '@babel/helper-plugin-utils': 7.24.7 - - '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.24.8)': - dependencies: - '@babel/core': 7.24.8 - '@babel/helper-plugin-utils': 7.24.7 - - '@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.24.8)': - dependencies: - '@babel/core': 7.24.8 - '@babel/helper-plugin-utils': 7.24.7 - - '@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.24.8)': - dependencies: - '@babel/core': 7.24.8 - '@babel/helper-plugin-utils': 7.24.7 - - '@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.24.8)': - dependencies: - '@babel/core': 7.24.8 - '@babel/helper-plugin-utils': 7.24.7 - - '@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.24.8)': - dependencies: - '@babel/core': 7.24.8 - '@babel/helper-plugin-utils': 7.24.7 - - '@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.24.8)': - dependencies: - '@babel/core': 7.24.8 - '@babel/helper-plugin-utils': 7.24.7 - - '@babel/plugin-syntax-typescript@7.24.7(@babel/core@7.24.8)': - dependencies: - '@babel/core': 7.24.8 - '@babel/helper-plugin-utils': 7.24.7 - '@babel/runtime@7.24.7': dependencies: regenerator-runtime: 0.14.1 - '@babel/template@7.24.7': - dependencies: - '@babel/code-frame': 7.24.7 - '@babel/parser': 7.24.8 - '@babel/types': 7.24.8 - - '@babel/traverse@7.24.8': - dependencies: - '@babel/code-frame': 7.24.7 - '@babel/generator': 7.24.8 - '@babel/helper-environment-visitor': 7.24.7 - '@babel/helper-function-name': 7.24.7 - '@babel/helper-hoist-variables': 7.24.7 - '@babel/helper-split-export-declaration': 7.24.7 - '@babel/parser': 7.24.8 - '@babel/types': 7.24.8 - debug: 4.3.5 - globals: 11.12.0 - transitivePeerDependencies: - - supports-color - - '@babel/types@7.24.8': - dependencies: - '@babel/helper-string-parser': 7.24.8 - '@babel/helper-validator-identifier': 7.24.7 - to-fast-properties: 2.0.0 - - '@bcoe/v8-coverage@0.2.3': {} - '@changesets/apply-release-plan@7.0.4': dependencies: '@babel/runtime': 7.24.7 @@ -3241,231 +1947,6 @@ snapshots: '@humanwhocodes/retry@0.3.0': {} - '@isaacs/cliui@8.0.2': - dependencies: - string-width: 5.1.2 - string-width-cjs: string-width@4.2.3 - strip-ansi: 7.1.0 - strip-ansi-cjs: strip-ansi@6.0.1 - wrap-ansi: 8.1.0 - wrap-ansi-cjs: wrap-ansi@7.0.0 - - '@istanbuljs/load-nyc-config@1.1.0': - dependencies: - camelcase: 5.3.1 - find-up: 4.1.0 - get-package-type: 0.1.0 - js-yaml: 3.14.1 - resolve-from: 5.0.0 - - '@istanbuljs/schema@0.1.3': {} - - '@jest/console@30.0.0-alpha.5': - dependencies: - '@jest/types': 30.0.0-alpha.5 - '@types/node': 20.14.10 - chalk: 4.1.2 - jest-message-util: 30.0.0-alpha.5 - jest-util: 30.0.0-alpha.5 - slash: 3.0.0 - - '@jest/core@30.0.0-alpha.5': - dependencies: - '@jest/console': 30.0.0-alpha.5 - '@jest/pattern': 30.0.0-alpha.5 - '@jest/reporters': 30.0.0-alpha.5 - '@jest/test-result': 30.0.0-alpha.5 - '@jest/transform': 30.0.0-alpha.5 - '@jest/types': 30.0.0-alpha.5 - '@types/node': 20.14.10 - ansi-escapes: 4.3.2 - chalk: 4.1.2 - ci-info: 4.0.0 - exit: 0.1.2 - graceful-fs: 4.2.11 - jest-changed-files: 30.0.0-alpha.5 - jest-config: 30.0.0-alpha.5(@types/node@20.14.10) - jest-haste-map: 30.0.0-alpha.5 - jest-message-util: 30.0.0-alpha.5 - jest-regex-util: 30.0.0-alpha.5 - jest-resolve: 30.0.0-alpha.5 - jest-resolve-dependencies: 30.0.0-alpha.5 - jest-runner: 30.0.0-alpha.5 - jest-runtime: 30.0.0-alpha.5 - jest-snapshot: 30.0.0-alpha.5 - jest-util: 30.0.0-alpha.5 - jest-validate: 30.0.0-alpha.5 - jest-watcher: 30.0.0-alpha.5 - micromatch: 4.0.7 - pretty-format: 30.0.0-alpha.5 - slash: 3.0.0 - strip-ansi: 6.0.1 - transitivePeerDependencies: - - babel-plugin-macros - - supports-color - - ts-node - - '@jest/environment@30.0.0-alpha.5': - dependencies: - '@jest/fake-timers': 30.0.0-alpha.5 - '@jest/types': 30.0.0-alpha.5 - '@types/node': 20.14.10 - jest-mock: 30.0.0-alpha.5 - - '@jest/expect-utils@30.0.0-alpha.5': - dependencies: - jest-get-type: 30.0.0-alpha.5 - - '@jest/expect@30.0.0-alpha.5': - dependencies: - expect: 30.0.0-alpha.5 - jest-snapshot: 30.0.0-alpha.5 - transitivePeerDependencies: - - supports-color - - '@jest/fake-timers@30.0.0-alpha.5': - dependencies: - '@jest/types': 30.0.0-alpha.5 - '@sinonjs/fake-timers': 11.2.2 - '@types/node': 20.14.10 - jest-message-util: 30.0.0-alpha.5 - jest-mock: 30.0.0-alpha.5 - jest-util: 30.0.0-alpha.5 - - '@jest/globals@30.0.0-alpha.5': - dependencies: - '@jest/environment': 30.0.0-alpha.5 - '@jest/expect': 30.0.0-alpha.5 - '@jest/types': 30.0.0-alpha.5 - jest-mock: 30.0.0-alpha.5 - transitivePeerDependencies: - - supports-color - - '@jest/pattern@30.0.0-alpha.5': - dependencies: - '@types/node': 20.14.10 - jest-regex-util: 30.0.0-alpha.5 - - '@jest/reporters@30.0.0-alpha.5': - dependencies: - '@bcoe/v8-coverage': 0.2.3 - '@jest/console': 30.0.0-alpha.5 - '@jest/test-result': 30.0.0-alpha.5 - '@jest/transform': 30.0.0-alpha.5 - '@jest/types': 30.0.0-alpha.5 - '@jridgewell/trace-mapping': 0.3.25 - '@types/node': 20.14.10 - chalk: 4.1.2 - collect-v8-coverage: 1.0.2 - exit: 0.1.2 - glob: 10.4.3 - graceful-fs: 4.2.11 - istanbul-lib-coverage: 3.2.2 - istanbul-lib-instrument: 6.0.3 - istanbul-lib-report: 3.0.1 - istanbul-lib-source-maps: 5.0.6 - istanbul-reports: 3.1.7 - jest-message-util: 30.0.0-alpha.5 - jest-util: 30.0.0-alpha.5 - jest-worker: 30.0.0-alpha.5 - slash: 3.0.0 - string-length: 4.0.2 - strip-ansi: 6.0.1 - v8-to-istanbul: 9.3.0 - transitivePeerDependencies: - - supports-color - - '@jest/schemas@29.6.3': - dependencies: - '@sinclair/typebox': 0.27.8 - - '@jest/schemas@30.0.0-alpha.5': - dependencies: - '@sinclair/typebox': 0.32.34 - - '@jest/snapshot-utils@30.0.0-alpha.5': - dependencies: - '@jest/types': 30.0.0-alpha.5 - chalk: 4.1.2 - graceful-fs: 4.2.11 - natural-compare: 1.4.0 - - '@jest/source-map@30.0.0-alpha.5': - dependencies: - '@jridgewell/trace-mapping': 0.3.25 - callsites: 3.1.0 - graceful-fs: 4.2.11 - - '@jest/test-result@30.0.0-alpha.5': - dependencies: - '@jest/console': 30.0.0-alpha.5 - '@jest/types': 30.0.0-alpha.5 - '@types/istanbul-lib-coverage': 2.0.6 - collect-v8-coverage: 1.0.2 - - '@jest/test-sequencer@30.0.0-alpha.5': - dependencies: - '@jest/test-result': 30.0.0-alpha.5 - graceful-fs: 4.2.11 - jest-haste-map: 30.0.0-alpha.5 - slash: 3.0.0 - - '@jest/transform@30.0.0-alpha.5': - dependencies: - '@babel/core': 7.24.8 - '@jest/types': 30.0.0-alpha.5 - '@jridgewell/trace-mapping': 0.3.25 - babel-plugin-istanbul: 6.1.1 - chalk: 4.1.2 - convert-source-map: 2.0.0 - fast-json-stable-stringify: 2.1.0 - graceful-fs: 4.2.11 - jest-haste-map: 30.0.0-alpha.5 - jest-regex-util: 30.0.0-alpha.5 - jest-util: 30.0.0-alpha.5 - micromatch: 4.0.7 - pirates: 4.0.6 - slash: 3.0.0 - write-file-atomic: 5.0.1 - transitivePeerDependencies: - - supports-color - - '@jest/types@29.6.3': - dependencies: - '@jest/schemas': 29.6.3 - '@types/istanbul-lib-coverage': 2.0.6 - '@types/istanbul-reports': 3.0.4 - '@types/node': 20.14.10 - '@types/yargs': 17.0.32 - chalk: 4.1.2 - - '@jest/types@30.0.0-alpha.5': - dependencies: - '@jest/pattern': 30.0.0-alpha.5 - '@jest/schemas': 30.0.0-alpha.5 - '@types/istanbul-lib-coverage': 2.0.6 - '@types/istanbul-reports': 3.0.4 - '@types/node': 20.14.10 - '@types/yargs': 17.0.32 - chalk: 4.1.2 - - '@jridgewell/gen-mapping@0.3.5': - dependencies: - '@jridgewell/set-array': 1.2.1 - '@jridgewell/sourcemap-codec': 1.4.15 - '@jridgewell/trace-mapping': 0.3.25 - - '@jridgewell/resolve-uri@3.1.2': {} - - '@jridgewell/set-array@1.2.1': {} - - '@jridgewell/sourcemap-codec@1.4.15': {} - - '@jridgewell/trace-mapping@0.3.25': - dependencies: - '@jridgewell/resolve-uri': 3.1.2 - '@jridgewell/sourcemap-codec': 1.4.15 - '@manypkg/find-root@1.1.0': dependencies: '@babel/runtime': 7.24.7 @@ -3494,27 +1975,10 @@ snapshots: '@nodelib/fs.scandir': 2.1.5 fastq: 1.17.1 - '@pkgjs/parseargs@0.11.0': - optional: true - - '@pkgr/core@0.1.1': {} - '@rtsao/scc@1.1.0': {} - '@sinclair/typebox@0.27.8': {} - - '@sinclair/typebox@0.32.34': {} - '@sindresorhus/is@5.6.0': {} - '@sinonjs/commons@3.0.1': - dependencies: - type-detect: 4.0.8 - - '@sinonjs/fake-timers@11.2.2': - dependencies: - '@sinonjs/commons': 3.0.1 - '@szmarczak/http-timer@5.0.1': dependencies: defer-to-connect: 2.0.1 @@ -3523,39 +1987,8 @@ snapshots: '@types/audioworklet@0.0.57': {} - '@types/babel__core@7.20.5': - dependencies: - '@babel/parser': 7.24.8 - '@babel/types': 7.24.8 - '@types/babel__generator': 7.6.8 - '@types/babel__template': 7.4.4 - '@types/babel__traverse': 7.20.6 - - '@types/babel__generator@7.6.8': - dependencies: - '@babel/types': 7.24.8 - - '@types/babel__template@7.4.4': - dependencies: - '@babel/parser': 7.24.8 - '@babel/types': 7.24.8 - - '@types/babel__traverse@7.20.6': - dependencies: - '@babel/types': 7.24.8 - '@types/http-cache-semantics@4.0.4': {} - '@types/istanbul-lib-coverage@2.0.6': {} - - '@types/istanbul-lib-report@3.0.3': - dependencies: - '@types/istanbul-lib-coverage': 2.0.6 - - '@types/istanbul-reports@3.0.4': - dependencies: - '@types/istanbul-lib-report': 3.0.3 - '@types/node@12.20.55': {} '@types/node@20.14.10': @@ -3564,16 +1997,8 @@ snapshots: '@types/semver@7.5.8': {} - '@types/stack-utils@2.0.3': {} - '@types/w3c-web-usb@1.0.10': {} - '@types/yargs-parser@21.0.3': {} - - '@types/yargs@17.0.32': - dependencies: - '@types/yargs-parser': 21.0.3 - '@typescript-eslint/eslint-plugin@7.16.0(@typescript-eslint/parser@7.16.0(eslint@9.7.0)(typescript@5.5.3))(eslint@9.7.0)(typescript@5.5.3)': dependencies: '@eslint-community/regexpp': 4.11.0 @@ -3727,14 +2152,8 @@ snapshots: ansi-colors@4.1.3: {} - ansi-escapes@4.3.2: - dependencies: - type-fest: 0.21.3 - ansi-regex@5.0.1: {} - ansi-regex@6.0.1: {} - ansi-styles@3.2.1: dependencies: color-convert: 1.9.3 @@ -3743,15 +2162,6 @@ snapshots: dependencies: color-convert: 2.0.1 - ansi-styles@5.2.0: {} - - ansi-styles@6.2.1: {} - - anymatch@3.1.3: - dependencies: - normalize-path: 3.0.0 - picomatch: 2.3.1 - argparse@1.0.10: dependencies: sprintf-js: 1.0.3 @@ -3760,62 +2170,8 @@ snapshots: array-union@2.1.0: {} - async@3.2.5: {} - b4a@1.6.6: {} - babel-jest@30.0.0-alpha.5(@babel/core@7.24.8): - dependencies: - '@babel/core': 7.24.8 - '@jest/transform': 30.0.0-alpha.5 - '@types/babel__core': 7.20.5 - babel-plugin-istanbul: 6.1.1 - babel-preset-jest: 30.0.0-alpha.5(@babel/core@7.24.8) - chalk: 4.1.2 - graceful-fs: 4.2.11 - slash: 3.0.0 - transitivePeerDependencies: - - supports-color - - babel-plugin-istanbul@6.1.1: - dependencies: - '@babel/helper-plugin-utils': 7.24.7 - '@istanbuljs/load-nyc-config': 1.1.0 - '@istanbuljs/schema': 0.1.3 - istanbul-lib-instrument: 5.2.1 - test-exclude: 6.0.0 - transitivePeerDependencies: - - supports-color - - babel-plugin-jest-hoist@30.0.0-alpha.5: - dependencies: - '@babel/template': 7.24.7 - '@babel/types': 7.24.8 - '@types/babel__core': 7.20.5 - '@types/babel__traverse': 7.20.6 - - babel-preset-current-node-syntax@1.0.1(@babel/core@7.24.8): - dependencies: - '@babel/core': 7.24.8 - '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.24.8) - '@babel/plugin-syntax-bigint': 7.8.3(@babel/core@7.24.8) - '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.24.8) - '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.24.8) - '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.24.8) - '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.24.8) - '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.24.8) - '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.24.8) - '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.24.8) - '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.24.8) - '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.24.8) - '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.24.8) - - babel-preset-jest@30.0.0-alpha.5(@babel/core@7.24.8): - dependencies: - '@babel/core': 7.24.8 - babel-plugin-jest-hoist: 30.0.0-alpha.5 - babel-preset-current-node-syntax: 1.0.1(@babel/core@7.24.8) - balanced-match@1.0.2: {} bare-events@2.4.2: @@ -3840,21 +2196,6 @@ snapshots: dependencies: fill-range: 7.1.1 - browserslist@4.23.2: - dependencies: - caniuse-lite: 1.0.30001642 - electron-to-chromium: 1.4.827 - node-releases: 2.0.14 - update-browserslist-db: 1.1.0(browserslist@4.23.2) - - bs-logger@0.2.6: - dependencies: - fast-json-stable-stringify: 2.1.0 - - bser@2.1.1: - dependencies: - node-int64: 0.4.0 - buffer-crc32@0.2.13: {} buffer-from@1.1.2: {} @@ -3878,12 +2219,6 @@ snapshots: callsites@3.1.0: {} - camelcase@5.3.1: {} - - camelcase@6.3.0: {} - - caniuse-lite@1.0.30001642: {} - chalk@2.4.2: dependencies: ansi-styles: 3.2.1 @@ -3895,26 +2230,10 @@ snapshots: ansi-styles: 4.3.0 supports-color: 7.2.0 - char-regex@1.0.2: {} - chardet@0.7.0: {} ci-info@3.9.0: {} - ci-info@4.0.0: {} - - cjs-module-lexer@1.3.1: {} - - cliui@8.0.1: - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - - co@4.6.0: {} - - collect-v8-coverage@1.0.2: {} - color-convert@1.9.3: dependencies: color-name: 1.1.3 @@ -3937,12 +2256,6 @@ snapshots: dependencies: safe-buffer: 5.2.1 - convert-source-map@2.0.0: {} - - cross-env@7.0.3: - dependencies: - cross-spawn: 7.0.3 - cross-spawn@5.1.0: dependencies: lru-cache: 4.1.5 @@ -3969,20 +2282,12 @@ snapshots: dependencies: mimic-response: 3.1.0 - dedent@1.5.3: {} - deep-is@0.1.4: {} - deepmerge@4.3.1: {} - defer-to-connect@2.0.1: {} detect-indent@6.1.0: {} - detect-newline@3.1.0: {} - - diff-sequences@30.0.0-alpha.5: {} - dir-glob@3.0.1: dependencies: path-type: 4.0.0 @@ -3991,35 +2296,13 @@ snapshots: dependencies: esutils: 2.0.3 - eastasianwidth@0.2.0: {} - - ejs@3.1.10: - dependencies: - jake: 10.9.1 - - electron-to-chromium@1.4.827: {} - - emittery@0.13.1: {} - - emoji-regex@8.0.0: {} - - emoji-regex@9.2.2: {} - enquirer@2.4.1: dependencies: ansi-colors: 4.1.3 strip-ansi: 6.0.1 - error-ex@1.3.2: - dependencies: - is-arrayish: 0.2.1 - - escalade@3.1.2: {} - escape-string-regexp@1.0.5: {} - escape-string-regexp@2.0.0: {} - escape-string-regexp@4.0.0: {} escape-string-regexp@5.0.0: {} @@ -4118,28 +2401,6 @@ snapshots: esutils@2.0.3: {} - execa@5.1.1: - dependencies: - cross-spawn: 7.0.3 - get-stream: 6.0.1 - human-signals: 2.1.0 - is-stream: 2.0.1 - merge-stream: 2.0.0 - npm-run-path: 4.0.1 - onetime: 5.1.2 - signal-exit: 3.0.7 - strip-final-newline: 2.0.0 - - exit@0.1.2: {} - - expect@30.0.0-alpha.5: - dependencies: - '@jest/expect-utils': 30.0.0-alpha.5 - jest-get-type: 30.0.0-alpha.5 - jest-matcher-utils: 30.0.0-alpha.5 - jest-message-util: 30.0.0-alpha.5 - jest-util: 30.0.0-alpha.5 - ext-list@2.2.2: dependencies: mime-db: 1.52.0 @@ -4177,10 +2438,6 @@ snapshots: dependencies: reusify: 1.0.4 - fb-watchman@2.0.2: - dependencies: - bser: 2.1.1 - fd-slicer@1.1.0: dependencies: pend: 1.2.0 @@ -4200,10 +2457,6 @@ snapshots: strtok3: 7.1.0 token-types: 5.0.1 - filelist@1.0.4: - dependencies: - minimatch: 5.1.6 - filename-reserved-regex@3.0.0: {} filenamify@5.1.1: @@ -4238,11 +2491,6 @@ snapshots: flatted@3.3.1: {} - foreground-child@3.2.1: - dependencies: - cross-spawn: 7.0.3 - signal-exit: 4.1.0 - form-data-encoder@2.1.4: {} formdata-polyfill@4.0.10: @@ -4261,19 +2509,8 @@ snapshots: jsonfile: 4.0.0 universalify: 0.1.2 - fs.realpath@1.0.0: {} - - fsevents@2.3.3: - optional: true - function-bind@1.1.2: {} - gensync@1.0.0-beta.2: {} - - get-caller-file@2.0.5: {} - - get-package-type@0.1.0: {} - get-stream@6.0.1: {} get-tsconfig@4.7.5: @@ -4294,26 +2531,6 @@ snapshots: dependencies: is-glob: 4.0.3 - glob@10.4.3: - dependencies: - foreground-child: 3.2.1 - jackspeak: 3.4.1 - minimatch: 9.0.5 - minipass: 7.1.2 - package-json-from-dist: 1.0.0 - path-scurry: 1.11.1 - - glob@7.2.3: - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - - globals@11.12.0: {} - globals@14.0.0: {} globby@11.1.0: @@ -4351,8 +2568,6 @@ snapshots: dependencies: function-bind: 1.1.2 - html-escaper@2.0.2: {} - http-cache-semantics@4.1.1: {} http2-wrapper@2.2.1: @@ -4362,8 +2577,6 @@ snapshots: human-id@1.0.2: {} - human-signals@2.1.0: {} - iconv-lite@0.4.24: dependencies: safer-buffer: 2.1.2 @@ -4377,36 +2590,20 @@ snapshots: parent-module: 1.0.1 resolve-from: 4.0.0 - import-local@3.1.0: - dependencies: - pkg-dir: 4.2.0 - resolve-cwd: 3.0.0 - imurmurhash@0.1.4: {} - inflight@1.0.6: - dependencies: - once: 1.4.0 - wrappy: 1.0.2 - inherits@2.0.4: {} inspect-with-kind@1.0.5: dependencies: kind-of: 6.0.3 - is-arrayish@0.2.1: {} - is-core-module@2.14.0: dependencies: hasown: 2.0.2 is-extglob@2.1.1: {} - is-fullwidth-code-point@3.0.0: {} - - is-generator-fn@2.1.0: {} - is-glob@4.0.3: dependencies: is-extglob: 2.1.1 @@ -4419,8 +2616,6 @@ snapshots: is-plain-obj@2.1.0: {} - is-stream@2.0.1: {} - is-stream@3.0.0: {} is-subdir@1.2.0: @@ -4431,379 +2626,6 @@ snapshots: isexe@2.0.0: {} - istanbul-lib-coverage@3.2.2: {} - - istanbul-lib-instrument@5.2.1: - dependencies: - '@babel/core': 7.24.8 - '@babel/parser': 7.24.8 - '@istanbuljs/schema': 0.1.3 - istanbul-lib-coverage: 3.2.2 - semver: 6.3.1 - transitivePeerDependencies: - - supports-color - - istanbul-lib-instrument@6.0.3: - dependencies: - '@babel/core': 7.24.8 - '@babel/parser': 7.24.8 - '@istanbuljs/schema': 0.1.3 - istanbul-lib-coverage: 3.2.2 - semver: 7.6.2 - transitivePeerDependencies: - - supports-color - - istanbul-lib-report@3.0.1: - dependencies: - istanbul-lib-coverage: 3.2.2 - make-dir: 4.0.0 - supports-color: 7.2.0 - - istanbul-lib-source-maps@5.0.6: - dependencies: - '@jridgewell/trace-mapping': 0.3.25 - debug: 4.3.5 - istanbul-lib-coverage: 3.2.2 - transitivePeerDependencies: - - supports-color - - istanbul-reports@3.1.7: - dependencies: - html-escaper: 2.0.2 - istanbul-lib-report: 3.0.1 - - jackspeak@3.4.1: - dependencies: - '@isaacs/cliui': 8.0.2 - optionalDependencies: - '@pkgjs/parseargs': 0.11.0 - - jake@10.9.1: - dependencies: - async: 3.2.5 - chalk: 4.1.2 - filelist: 1.0.4 - minimatch: 3.1.2 - - jest-changed-files@30.0.0-alpha.5: - dependencies: - execa: 5.1.1 - jest-util: 30.0.0-alpha.5 - p-limit: 3.1.0 - - jest-circus@30.0.0-alpha.5: - dependencies: - '@jest/environment': 30.0.0-alpha.5 - '@jest/expect': 30.0.0-alpha.5 - '@jest/test-result': 30.0.0-alpha.5 - '@jest/types': 30.0.0-alpha.5 - '@types/node': 20.14.10 - chalk: 4.1.2 - co: 4.6.0 - dedent: 1.5.3 - is-generator-fn: 2.1.0 - jest-each: 30.0.0-alpha.5 - jest-matcher-utils: 30.0.0-alpha.5 - jest-message-util: 30.0.0-alpha.5 - jest-runtime: 30.0.0-alpha.5 - jest-snapshot: 30.0.0-alpha.5 - jest-util: 30.0.0-alpha.5 - p-limit: 3.1.0 - pretty-format: 30.0.0-alpha.5 - pure-rand: 6.1.0 - slash: 3.0.0 - stack-utils: 2.0.6 - transitivePeerDependencies: - - babel-plugin-macros - - supports-color - - jest-cli@30.0.0-alpha.5(@types/node@20.14.10): - dependencies: - '@jest/core': 30.0.0-alpha.5 - '@jest/test-result': 30.0.0-alpha.5 - '@jest/types': 30.0.0-alpha.5 - chalk: 4.1.2 - exit: 0.1.2 - import-local: 3.1.0 - jest-config: 30.0.0-alpha.5(@types/node@20.14.10) - jest-util: 30.0.0-alpha.5 - jest-validate: 30.0.0-alpha.5 - yargs: 17.7.2 - transitivePeerDependencies: - - '@types/node' - - babel-plugin-macros - - supports-color - - ts-node - - jest-config@30.0.0-alpha.5(@types/node@20.14.10): - dependencies: - '@babel/core': 7.24.8 - '@jest/pattern': 30.0.0-alpha.5 - '@jest/test-sequencer': 30.0.0-alpha.5 - '@jest/types': 30.0.0-alpha.5 - babel-jest: 30.0.0-alpha.5(@babel/core@7.24.8) - chalk: 4.1.2 - ci-info: 4.0.0 - deepmerge: 4.3.1 - glob: 10.4.3 - graceful-fs: 4.2.11 - jest-circus: 30.0.0-alpha.5 - jest-environment-node: 30.0.0-alpha.5 - jest-get-type: 30.0.0-alpha.5 - jest-regex-util: 30.0.0-alpha.5 - jest-resolve: 30.0.0-alpha.5 - jest-runner: 30.0.0-alpha.5 - jest-util: 30.0.0-alpha.5 - jest-validate: 30.0.0-alpha.5 - micromatch: 4.0.7 - parse-json: 5.2.0 - pretty-format: 30.0.0-alpha.5 - slash: 3.0.0 - strip-json-comments: 3.1.1 - optionalDependencies: - '@types/node': 20.14.10 - transitivePeerDependencies: - - babel-plugin-macros - - supports-color - - jest-diff@30.0.0-alpha.5: - dependencies: - chalk: 4.1.2 - diff-sequences: 30.0.0-alpha.5 - jest-get-type: 30.0.0-alpha.5 - pretty-format: 30.0.0-alpha.5 - - jest-docblock@30.0.0-alpha.5: - dependencies: - detect-newline: 3.1.0 - - jest-each@30.0.0-alpha.5: - dependencies: - '@jest/types': 30.0.0-alpha.5 - chalk: 4.1.2 - jest-get-type: 30.0.0-alpha.5 - jest-util: 30.0.0-alpha.5 - pretty-format: 30.0.0-alpha.5 - - jest-environment-node@30.0.0-alpha.5: - dependencies: - '@jest/environment': 30.0.0-alpha.5 - '@jest/fake-timers': 30.0.0-alpha.5 - '@jest/types': 30.0.0-alpha.5 - '@types/node': 20.14.10 - jest-mock: 30.0.0-alpha.5 - jest-util: 30.0.0-alpha.5 - - jest-get-type@30.0.0-alpha.5: {} - - jest-haste-map@30.0.0-alpha.5: - dependencies: - '@jest/types': 30.0.0-alpha.5 - '@types/node': 20.14.10 - anymatch: 3.1.3 - fb-watchman: 2.0.2 - graceful-fs: 4.2.11 - jest-regex-util: 30.0.0-alpha.5 - jest-util: 30.0.0-alpha.5 - jest-worker: 30.0.0-alpha.5 - micromatch: 4.0.7 - walker: 1.0.8 - optionalDependencies: - fsevents: 2.3.3 - - jest-leak-detector@30.0.0-alpha.5: - dependencies: - jest-get-type: 30.0.0-alpha.5 - pretty-format: 30.0.0-alpha.5 - - jest-matcher-utils@30.0.0-alpha.5: - dependencies: - chalk: 4.1.2 - jest-diff: 30.0.0-alpha.5 - jest-get-type: 30.0.0-alpha.5 - pretty-format: 30.0.0-alpha.5 - - jest-message-util@30.0.0-alpha.5: - dependencies: - '@babel/code-frame': 7.24.7 - '@jest/types': 30.0.0-alpha.5 - '@types/stack-utils': 2.0.3 - chalk: 4.1.2 - graceful-fs: 4.2.11 - micromatch: 4.0.7 - pretty-format: 30.0.0-alpha.5 - slash: 3.0.0 - stack-utils: 2.0.6 - - jest-mock@30.0.0-alpha.5: - dependencies: - '@jest/types': 30.0.0-alpha.5 - '@types/node': 20.14.10 - jest-util: 30.0.0-alpha.5 - - jest-pnp-resolver@1.2.3(jest-resolve@30.0.0-alpha.5): - optionalDependencies: - jest-resolve: 30.0.0-alpha.5 - - jest-regex-util@30.0.0-alpha.5: {} - - jest-resolve-dependencies@30.0.0-alpha.5: - dependencies: - jest-regex-util: 30.0.0-alpha.5 - jest-snapshot: 30.0.0-alpha.5 - transitivePeerDependencies: - - supports-color - - jest-resolve@30.0.0-alpha.5: - dependencies: - chalk: 4.1.2 - graceful-fs: 4.2.11 - jest-haste-map: 30.0.0-alpha.5 - jest-pnp-resolver: 1.2.3(jest-resolve@30.0.0-alpha.5) - jest-util: 30.0.0-alpha.5 - jest-validate: 30.0.0-alpha.5 - resolve: 1.22.8 - resolve.exports: 2.0.2 - slash: 3.0.0 - - jest-runner@30.0.0-alpha.5: - dependencies: - '@jest/console': 30.0.0-alpha.5 - '@jest/environment': 30.0.0-alpha.5 - '@jest/test-result': 30.0.0-alpha.5 - '@jest/transform': 30.0.0-alpha.5 - '@jest/types': 30.0.0-alpha.5 - '@types/node': 20.14.10 - chalk: 4.1.2 - emittery: 0.13.1 - graceful-fs: 4.2.11 - jest-docblock: 30.0.0-alpha.5 - jest-environment-node: 30.0.0-alpha.5 - jest-haste-map: 30.0.0-alpha.5 - jest-leak-detector: 30.0.0-alpha.5 - jest-message-util: 30.0.0-alpha.5 - jest-resolve: 30.0.0-alpha.5 - jest-runtime: 30.0.0-alpha.5 - jest-util: 30.0.0-alpha.5 - jest-watcher: 30.0.0-alpha.5 - jest-worker: 30.0.0-alpha.5 - p-limit: 3.1.0 - source-map-support: 0.5.13 - transitivePeerDependencies: - - supports-color - - jest-runtime@30.0.0-alpha.5: - dependencies: - '@jest/environment': 30.0.0-alpha.5 - '@jest/fake-timers': 30.0.0-alpha.5 - '@jest/globals': 30.0.0-alpha.5 - '@jest/source-map': 30.0.0-alpha.5 - '@jest/test-result': 30.0.0-alpha.5 - '@jest/transform': 30.0.0-alpha.5 - '@jest/types': 30.0.0-alpha.5 - '@types/node': 20.14.10 - chalk: 4.1.2 - cjs-module-lexer: 1.3.1 - collect-v8-coverage: 1.0.2 - glob: 10.4.3 - graceful-fs: 4.2.11 - jest-haste-map: 30.0.0-alpha.5 - jest-message-util: 30.0.0-alpha.5 - jest-mock: 30.0.0-alpha.5 - jest-regex-util: 30.0.0-alpha.5 - jest-resolve: 30.0.0-alpha.5 - jest-snapshot: 30.0.0-alpha.5 - jest-util: 30.0.0-alpha.5 - slash: 3.0.0 - strip-bom: 4.0.0 - transitivePeerDependencies: - - supports-color - - jest-snapshot@30.0.0-alpha.5: - dependencies: - '@babel/core': 7.24.8 - '@babel/generator': 7.24.8 - '@babel/plugin-syntax-jsx': 7.24.7(@babel/core@7.24.8) - '@babel/plugin-syntax-typescript': 7.24.7(@babel/core@7.24.8) - '@babel/types': 7.24.8 - '@jest/expect-utils': 30.0.0-alpha.5 - '@jest/snapshot-utils': 30.0.0-alpha.5 - '@jest/transform': 30.0.0-alpha.5 - '@jest/types': 30.0.0-alpha.5 - babel-preset-current-node-syntax: 1.0.1(@babel/core@7.24.8) - chalk: 4.1.2 - expect: 30.0.0-alpha.5 - graceful-fs: 4.2.11 - jest-diff: 30.0.0-alpha.5 - jest-get-type: 30.0.0-alpha.5 - jest-matcher-utils: 30.0.0-alpha.5 - jest-message-util: 30.0.0-alpha.5 - jest-util: 30.0.0-alpha.5 - pretty-format: 30.0.0-alpha.5 - semver: 7.6.2 - synckit: 0.9.0 - transitivePeerDependencies: - - supports-color - - jest-util@29.7.0: - dependencies: - '@jest/types': 29.6.3 - '@types/node': 20.14.10 - chalk: 4.1.2 - ci-info: 3.9.0 - graceful-fs: 4.2.11 - picomatch: 2.3.1 - - jest-util@30.0.0-alpha.5: - dependencies: - '@jest/types': 30.0.0-alpha.5 - '@types/node': 20.14.10 - chalk: 4.1.2 - ci-info: 4.0.0 - graceful-fs: 4.2.11 - picomatch: 4.0.2 - - jest-validate@30.0.0-alpha.5: - dependencies: - '@jest/types': 30.0.0-alpha.5 - camelcase: 6.3.0 - chalk: 4.1.2 - jest-get-type: 30.0.0-alpha.5 - leven: 3.1.0 - pretty-format: 30.0.0-alpha.5 - - jest-watcher@30.0.0-alpha.5: - dependencies: - '@jest/test-result': 30.0.0-alpha.5 - '@jest/types': 30.0.0-alpha.5 - '@types/node': 20.14.10 - ansi-escapes: 4.3.2 - chalk: 4.1.2 - emittery: 0.13.1 - jest-util: 30.0.0-alpha.5 - string-length: 4.0.2 - - jest-worker@30.0.0-alpha.5: - dependencies: - '@types/node': 20.14.10 - jest-util: 30.0.0-alpha.5 - merge-stream: 2.0.0 - supports-color: 8.1.1 - - jest@30.0.0-alpha.5(@types/node@20.14.10): - dependencies: - '@jest/core': 30.0.0-alpha.5 - '@jest/types': 30.0.0-alpha.5 - import-local: 3.1.0 - jest-cli: 30.0.0-alpha.5(@types/node@20.14.10) - transitivePeerDependencies: - - '@types/node' - - babel-plugin-macros - - supports-color - - ts-node - - js-tokens@4.0.0: {} - js-yaml@3.14.1: dependencies: argparse: 1.0.10 @@ -4813,12 +2635,8 @@ snapshots: dependencies: argparse: 2.0.1 - jsesc@2.5.2: {} - json-buffer@3.0.1: {} - json-parse-even-better-errors@2.3.1: {} - json-schema-traverse@0.4.1: {} json-stable-stringify-without-jsonify@1.0.1: {} @@ -4835,15 +2653,11 @@ snapshots: kind-of@6.0.3: {} - leven@3.1.0: {} - levn@0.4.1: dependencies: prelude-ls: 1.2.1 type-check: 0.4.0 - lines-and-columns@1.2.4: {} - load-yaml-file@0.2.0: dependencies: graceful-fs: 4.2.11 @@ -4859,41 +2673,25 @@ snapshots: dependencies: p-locate: 5.0.0 - lodash.memoize@4.1.2: {} - lodash.merge@4.6.2: {} lodash.startcase@4.4.0: {} lowercase-keys@3.0.0: {} - lru-cache@10.3.1: {} - lru-cache@4.1.5: dependencies: pseudomap: 1.0.2 yallist: 2.1.2 - lru-cache@5.1.1: - dependencies: - yallist: 3.1.1 - make-dir@4.0.0: dependencies: semver: 7.6.2 - make-error@1.3.6: {} - - makeerror@1.0.12: - dependencies: - tmpl: 1.0.5 - merge-options@3.0.4: dependencies: is-plain-obj: 2.1.0 - merge-stream@2.0.0: {} - merge2@1.4.1: {} micromatch@4.0.7: @@ -4903,8 +2701,6 @@ snapshots: mime-db@1.52.0: {} - mimic-fn@2.1.0: {} - mimic-response@3.1.0: {} mimic-response@4.0.0: {} @@ -4913,16 +2709,10 @@ snapshots: dependencies: brace-expansion: 1.1.11 - minimatch@5.1.6: - dependencies: - brace-expansion: 2.0.1 - minimatch@9.0.5: dependencies: brace-expansion: 2.0.1 - minipass@7.1.2: {} - mri@1.2.0: {} ms@2.1.2: {} @@ -4939,26 +2729,8 @@ snapshots: fetch-blob: 3.2.0 formdata-polyfill: 4.0.10 - node-int64@0.4.0: {} - - node-releases@2.0.14: {} - - normalize-path@3.0.0: {} - normalize-url@8.0.1: {} - npm-run-path@4.0.1: - dependencies: - path-key: 3.1.1 - - once@1.4.0: - dependencies: - wrappy: 1.0.2 - - onetime@5.1.2: - dependencies: - mimic-fn: 2.1.0 - optionator@0.9.4: dependencies: deep-is: 0.1.4 @@ -5004,48 +2776,26 @@ snapshots: p-try@2.2.0: {} - package-json-from-dist@1.0.0: {} - parent-module@1.0.1: dependencies: callsites: 3.1.0 - parse-json@5.2.0: - dependencies: - '@babel/code-frame': 7.24.7 - error-ex: 1.3.2 - json-parse-even-better-errors: 2.3.1 - lines-and-columns: 1.2.4 - path-exists@4.0.0: {} - path-is-absolute@1.0.1: {} - path-key@3.1.1: {} path-parse@1.0.7: {} - path-scurry@1.11.1: - dependencies: - lru-cache: 10.3.1 - minipass: 7.1.2 - path-type@4.0.0: {} peek-readable@5.1.1: {} pend@1.2.0: {} - picocolors@1.0.1: {} - picomatch@2.3.1: {} - picomatch@4.0.2: {} - pify@4.0.1: {} - pirates@4.0.6: {} - pkg-dir@4.2.0: dependencies: find-up: 4.1.0 @@ -5063,26 +2813,16 @@ snapshots: prettier@3.3.3: {} - pretty-format@30.0.0-alpha.5: - dependencies: - '@jest/schemas': 30.0.0-alpha.5 - ansi-styles: 5.2.0 - react-is: 18.3.1 - pseudomap@1.0.2: {} punycode@2.3.1: {} - pure-rand@6.1.0: {} - queue-microtask@1.2.3: {} queue-tick@1.0.1: {} quick-lru@5.1.1: {} - react-is@18.3.1: {} - read-yaml-file@1.1.0: dependencies: graceful-fs: 4.2.11 @@ -5102,22 +2842,14 @@ snapshots: regenerator-runtime@0.14.1: {} - require-directory@2.1.1: {} - resolve-alpn@1.2.1: {} - resolve-cwd@3.0.0: - dependencies: - resolve-from: 5.0.0 - resolve-from@4.0.0: {} resolve-from@5.0.0: {} resolve-pkg-maps@1.0.0: {} - resolve.exports@2.0.2: {} - resolve@1.22.8: dependencies: is-core-module: 2.14.0 @@ -5142,8 +2874,6 @@ snapshots: dependencies: commander: 2.20.3 - semver@6.3.1: {} - semver@7.6.2: {} shebang-command@1.2.0: @@ -5160,8 +2890,6 @@ snapshots: signal-exit@3.0.7: {} - signal-exit@4.1.0: {} - slash@3.0.0: {} sort-keys-length@1.0.1: @@ -5172,11 +2900,6 @@ snapshots: dependencies: is-plain-obj: 1.1.0 - source-map-support@0.5.13: - dependencies: - buffer-from: 1.1.2 - source-map: 0.6.1 - source-map-support@0.5.21: dependencies: buffer-from: 1.1.2 @@ -5193,10 +2916,6 @@ snapshots: stable-hash@0.0.4: {} - stack-utils@2.0.6: - dependencies: - escape-string-regexp: 2.0.0 - streamx@2.18.0: dependencies: fast-fifo: 1.3.2 @@ -5205,23 +2924,6 @@ snapshots: optionalDependencies: bare-events: 2.4.2 - string-length@4.0.2: - dependencies: - char-regex: 1.0.2 - strip-ansi: 6.0.1 - - string-width@4.2.3: - dependencies: - emoji-regex: 8.0.0 - is-fullwidth-code-point: 3.0.0 - strip-ansi: 6.0.1 - - string-width@5.1.2: - dependencies: - eastasianwidth: 0.2.0 - emoji-regex: 9.2.2 - strip-ansi: 7.1.0 - string_decoder@1.3.0: dependencies: safe-buffer: 5.2.1 @@ -5230,21 +2932,13 @@ snapshots: dependencies: ansi-regex: 5.0.1 - strip-ansi@7.1.0: - dependencies: - ansi-regex: 6.0.1 - strip-bom@3.0.0: {} - strip-bom@4.0.0: {} - strip-dirs@3.0.0: dependencies: inspect-with-kind: 1.0.5 is-plain-obj: 1.1.0 - strip-final-newline@2.0.0: {} - strip-json-comments@3.1.1: {} strip-outer@2.0.0: {} @@ -5262,17 +2956,8 @@ snapshots: dependencies: has-flag: 4.0.0 - supports-color@8.1.1: - dependencies: - has-flag: 4.0.0 - supports-preserve-symlinks-flag@1.0.0: {} - synckit@0.9.0: - dependencies: - '@pkgr/core': 0.1.1 - tslib: 2.6.3 - tar-stream@3.1.7: dependencies: b4a: 1.6.6 @@ -5281,12 +2966,6 @@ snapshots: term-size@2.2.1: {} - test-exclude@6.0.0: - dependencies: - '@istanbuljs/schema': 0.1.3 - glob: 7.2.3 - minimatch: 3.1.2 - text-decoder@1.1.0: dependencies: b4a: 1.6.6 @@ -5303,10 +2982,6 @@ snapshots: dependencies: os-tmpdir: 1.0.2 - tmpl@1.0.5: {} - - to-fast-properties@2.0.0: {} - to-regex-range@5.0.1: dependencies: is-number: 7.0.0 @@ -5324,33 +2999,12 @@ snapshots: dependencies: typescript: 5.5.3 - ts-jest@29.2.2(@babel/core@7.24.8)(@jest/types@29.6.3)(jest@30.0.0-alpha.5)(typescript@5.5.3): - dependencies: - bs-logger: 0.2.6 - ejs: 3.1.10 - fast-json-stable-stringify: 2.1.0 - jest: 30.0.0-alpha.5(@types/node@20.14.10) - jest-util: 29.7.0 - json5: 2.2.3 - lodash.memoize: 4.1.2 - make-error: 1.3.6 - semver: 7.6.2 - typescript: 5.5.3 - yargs-parser: 21.1.1 - optionalDependencies: - '@babel/core': 7.24.8 - '@jest/types': 29.6.3 - tslib@2.6.3: {} type-check@0.4.0: dependencies: prelude-ls: 1.2.1 - type-detect@4.0.8: {} - - type-fest@0.21.3: {} - typescript-eslint@7.16.0(eslint@9.7.0)(typescript@5.5.3): dependencies: '@typescript-eslint/eslint-plugin': 7.16.0(@typescript-eslint/parser@7.16.0(eslint@9.7.0)(typescript@5.5.3))(eslint@9.7.0)(typescript@5.5.3) @@ -5373,28 +3027,12 @@ snapshots: universalify@0.1.2: {} - update-browserslist-db@1.1.0(browserslist@4.23.2): - dependencies: - browserslist: 4.23.2 - escalade: 3.1.2 - picocolors: 1.0.1 - uri-js@4.4.1: dependencies: punycode: 2.3.1 util-deprecate@1.0.2: {} - v8-to-istanbul@9.3.0: - dependencies: - '@jridgewell/trace-mapping': 0.3.25 - '@types/istanbul-lib-coverage': 2.0.6 - convert-source-map: 2.0.0 - - walker@1.0.8: - dependencies: - makeerror: 1.0.12 - web-streams-polyfill@3.3.3: {} which-pm@2.2.0: @@ -5412,43 +3050,8 @@ snapshots: word-wrap@1.2.5: {} - wrap-ansi@7.0.0: - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - - wrap-ansi@8.1.0: - dependencies: - ansi-styles: 6.2.1 - string-width: 5.1.2 - strip-ansi: 7.1.0 - - wrappy@1.0.2: {} - - write-file-atomic@5.0.1: - dependencies: - imurmurhash: 0.1.4 - signal-exit: 4.1.0 - - y18n@5.0.8: {} - yallist@2.1.2: {} - yallist@3.1.1: {} - - yargs-parser@21.1.1: {} - - yargs@17.7.2: - dependencies: - cliui: 8.0.1 - escalade: 3.1.2 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 21.1.1 - yauzl@2.10.0: dependencies: buffer-crc32: 0.2.13 diff --git a/toolchain/eslint-config/eslint.config.js b/toolchain/eslint-config/eslint.config.js index c15b42c2..452fe012 100644 --- a/toolchain/eslint-config/eslint.config.js +++ b/toolchain/eslint-config/eslint.config.js @@ -10,7 +10,7 @@ const root = resolve(dirname(fileURLToPath(import.meta.url)), "..", ".."); export default tslint.config( { - ignores: ["**/*.js", "**/*.d.ts"], + ignores: ["**/*.js", "**/*.mjs", "**/*.d.ts"], }, eslint.configs.recommended, { @@ -63,6 +63,11 @@ export default tslint.config( ], }, }, + { + files: ["**/*.spec.ts"], + // Node.js `test` module violates this + rules: { "@typescript-eslint/no-floating-promises": "off" }, + }, { plugins: { "import-x": eslintImportX }, rules: { diff --git a/toolchain/package-lint/index.mjs b/toolchain/package-lint/index.mjs new file mode 100644 index 00000000..de1a16fc --- /dev/null +++ b/toolchain/package-lint/index.mjs @@ -0,0 +1,143 @@ +/// + +import JSON5 from "json5"; +import fs from "node:fs"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; + +const root = fileURLToPath(new URL("../../", import.meta.url)); +/** + * @type {string[]} + */ +const packages = []; + +packages.push(path.join(root, "apps", "cli")); +for (const file of fs.readdirSync(path.join(root, "libraries"))) { + packages.push(path.join(root, "libraries", file)); +} +for (const file of fs.readdirSync(path.join(root, "toolchain"))) { + packages.push(path.join(root, "toolchain", file)); +} + +const REMOVE_DEPS = ["@jest/globals", "cross-env", "eslint", "jest", "ts-jest"]; +const DEP_VERSIONS = { + "@types/node": "^20.14.9", + prettier: "^3.3.3", + typescript: "^5.5.3", +}; + +for (const p of packages) { + const packageJsonPath = path.join(p, "package.json"); + const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf8")); + if (packageJson.dependencies) { + packageJson.dependencies = Object.fromEntries( + Object.entries(packageJson.dependencies) + .filter(([name]) => { + if ( + packageJson.name === "@yume-chan/eslint-config" && + name === "eslint" + ) { + return true; + } + return !REMOVE_DEPS.includes(name); + }) + .sort(([a], [b]) => a.localeCompare(b)), + ); + } + if (packageJson.devDependencies) { + for (const [dep, version] of Object.entries(DEP_VERSIONS)) { + if (packageJson.devDependencies[dep]) { + packageJson.devDependencies[dep] = version; + } + } + + packageJson.devDependencies = Object.fromEntries( + Object.entries(packageJson.devDependencies).filter( + ([name]) => !REMOVE_DEPS.includes(name), + ), + ); + + if (packageJson.scripts) { + packageJson.devDependencies["@yume-chan/eslint-config"] = + "workspace:^1.0.0"; + packageJson.scripts.lint = + "run-eslint && prettier src/**/*.ts --write --tab-width 4"; + + if (packageJson.scripts.test) { + packageJson.devDependencies["@yume-chan/test-runner"] = + "workspace:^1.0.0"; + packageJson.devDependencies["@types/node"] = "^20.14.9"; + packageJson.scripts.test = "run-test"; + } + + packageJson.scripts = Object.fromEntries( + Object.entries(packageJson.scripts).sort(([a], [b]) => + a.localeCompare(b), + ), + ); + } + + packageJson.devDependencies = Object.fromEntries( + Object.entries(packageJson.devDependencies).sort(([a], [b]) => + a.localeCompare(b), + ), + ); + } + fs.writeFileSync( + packageJsonPath, + JSON.stringify(packageJson, null, 4) + "\n", + ); + + const tsConfigPath = path.join(p, "tsconfig.json"); + if (fs.existsSync(tsConfigPath)) { + const tsConfig = JSON5.parse(fs.readFileSync(tsConfigPath, "utf8")); + tsConfig.references ??= []; + + const testTsConfigPath = path.join(p, "tsconfig.test.json"); + if (fs.existsSync(testTsConfigPath)) { + if ( + !tsConfig.references.some( + (ref) => ref.path === "./tsconfig.test.json", + ) + ) { + tsConfig.references.push({ path: "./tsconfig.test.json" }); + } + } else if ( + tsConfig.references.some( + (ref) => ref.path === "./tsconfig.test.json", + ) + ) { + tsConfig.references = tsConfig.references.filter( + (ref) => ref.path !== "./tsconfig.test.json", + ); + } + tsConfig.references.sort((a, b) => a.path.localeCompare(b.path)); + fs.writeFileSync( + tsConfigPath, + JSON.stringify(tsConfig, null, 4) + "\n", + ); + + const buildTsConfigPath = path.join(p, "tsconfig.build.json"); + if (fs.existsSync(buildTsConfigPath)) { + try { + const buildTsConfig = JSON5.parse( + fs.readFileSync(buildTsConfigPath, "utf8"), + ); + if (buildTsConfig.references) { + buildTsConfig.references.sort((a, b) => + a.path.localeCompare(b.path), + ); + } + fs.writeFileSync( + buildTsConfigPath, + JSON.stringify(buildTsConfig, null, 4) + "\n", + ); + } catch (e) { + console.error( + "could not read buildTsConfig", + buildTsConfigPath, + ); + } + } + } +} diff --git a/toolchain/package-lint/package.json b/toolchain/package-lint/package.json new file mode 100644 index 00000000..4718f5eb --- /dev/null +++ b/toolchain/package-lint/package.json @@ -0,0 +1,15 @@ +{ + "name": "@yume-chan/package-lint", + "private": true, + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": {}, + "keywords": [], + "dependencies": { + "@types/node": "^20.14.9", + "json5": "^2.2.3" + }, + "author": "", + "license": "MIT" +} diff --git a/toolchain/test-runner/jsconfig.json b/toolchain/test-runner/jsconfig.json new file mode 100644 index 00000000..cda79602 --- /dev/null +++ b/toolchain/test-runner/jsconfig.json @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "target": "ESNext", + "module": "nodenext", + "checkJs": true + }, +} diff --git a/toolchain/test-runner/package.json b/toolchain/test-runner/package.json new file mode 100644 index 00000000..e25d7320 --- /dev/null +++ b/toolchain/test-runner/package.json @@ -0,0 +1,13 @@ +{ + "name": "@yume-chan/test-runner", + "version": "1.0.0", + "type": "module", + "bin": { + "run-test": "wrapper.js" + }, + "dependencies": {}, + "devDependencies": { + "@types/node": "^20.14.9", + "typescript": "^5.5.3" + } +} diff --git a/toolchain/test-runner/run-test.js b/toolchain/test-runner/run-test.js new file mode 100644 index 00000000..331bdb9d --- /dev/null +++ b/toolchain/test-runner/run-test.js @@ -0,0 +1,136 @@ +#!/usr/bin/env node + +import { spawn } from "node:child_process"; +import { once } from "node:events"; +import { createWriteStream } from "node:fs"; +import { mkdir, opendir } from "node:fs/promises"; +import { resolve } from "node:path"; +import { Transform } from "node:stream"; +import { run } from "node:test"; +import { lcov, spec } from "node:test/reporters"; +import { fileURLToPath } from "node:url"; + +let tsc = resolve( + fileURLToPath(import.meta.url), + "..", + "node_modules", + ".bin", + "tsc", +); +if (process.platform === "win32") { + tsc += ".cmd"; +} + +const child = spawn(tsc, ["-p", "tsconfig.test.json"], { + shell: true, + stdio: "inherit", +}); + +await once(child, "exit"); +if (child.exitCode !== 0) { + process.exit(child.exitCode); +} + +/** @type {string[]} */ +const tests = []; +/** + * @param {string} path + */ +async function findTests(path) { + for await (const entry of await opendir(path)) { + if (entry.isDirectory()) { + await findTests(resolve(entry.parentPath, entry.name)); + } else if (entry.name.endsWith(".spec.js")) { + tests.push(resolve(entry.parentPath, entry.name)); + } + } +} +await findTests(resolve(process.cwd(), "esm")); + +const test = run({ + concurrency: true, + files: tests, +}); +test.on("test:fail", () => { + process.exitCode = 1; +}); +const coverageFolder = resolve(process.cwd(), "coverage"); +await mkdir(coverageFolder, { recursive: true }); + +function getPercentage(count, total) { + return total === 0 ? 100 : (count / total) * 100; +} + +const filterCoverage = test.pipe( + new Transform({ + objectMode: true, + transform(chunk, encoding, callback) { + if (chunk.type !== "test:coverage") { + callback(null, chunk); + return; + } + + const { + data: { + summary, + summary: { totals, workingDirectory }, + }, + } = chunk; + + console.log(chunk); + + summary.files = summary.files.filter( + (file) => + file.path.startsWith(workingDirectory) && + !file.path.endsWith(".spec.ts"), + ); + + totals.totalLineCount = 0; + totals.totalBranchCount = 0; + totals.totalFunctionCount = 0; + totals.coveredLineCount = 0; + totals.coveredBranchCount = 0; + totals.coveredFunctionCount = 0; + + for (const file of summary.files) { + totals.totalLineCount += file.totalLineCount; + totals.totalBranchCount += file.totalBranchCount; + totals.totalFunctionCount += file.totalFunctionCount; + totals.coveredLineCount += file.coveredLineCount; + totals.coveredBranchCount += file.coveredBranchCount; + totals.coveredFunctionCount += file.coveredFunctionCount; + } + + totals.coveredLinePercent = getPercentage( + totals.coveredLineCount, + totals.totalLineCount, + ); + totals.coveredBranchPercent = getPercentage( + totals.coveredBranchCount, + totals.totalBranchCount, + ); + totals.coveredFunctionPercent = getPercentage( + totals.coveredFunctionCount, + totals.totalFunctionCount, + ); + + callback(null, chunk); + }, + }), +); + +// @ts-expect-error +filterCoverage.pipe(spec()).pipe(process.stdout); +filterCoverage + // @ts-expect-error + .pipe(lcov) + // @ts-expect-error + .pipe(createWriteStream(resolve(coverageFolder, "lcov.info"))); + +// run({ +// concurrency: false, +// files: tests, +// }) +// // @ts-expect-error +// .pipe(Lcov) +// .pipe(createWriteStream(resolve(coverageFolder, "lcov.info"))); diff --git a/toolchain/test-runner/wrapper.js b/toolchain/test-runner/wrapper.js new file mode 100644 index 00000000..bad65134 --- /dev/null +++ b/toolchain/test-runner/wrapper.js @@ -0,0 +1,23 @@ +#!/usr/bin/env node + +import { spawn } from "child_process"; +import { fileURLToPath } from "url"; + +const child = spawn( + process.execPath, + [ + "--enable-source-maps", + "--experimental-test-coverage", + fileURLToPath(import.meta.resolve("./run-test.js", import.meta.url)), + ], + { + stdio: "inherit", + env: { + ...process.env, + }, + }, +); + +child.on("exit", (code) => { + process.exit(code); +});