taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit 2ff17a407edbeb2439a6c733a33a26b72ec1bf20
parent 5937bc80d001212269e984a12a86df5e54227922
Author: Florian Dold <dold@taler.net>
Date:   Tue, 19 May 2026 23:26:01 +0200

remove dependency on ava for testing

Instead, we now use the relatively new native node testing framework, as
it has zero external dependencies, unlike the quite heavy ava testing
library / runner.

Diffstat:
Mpackages/anastasis-core/package.json | 13++++---------
Mpackages/anastasis-core/src/crypto.test.ts | 17+++++++++--------
Mpackages/anastasis-core/src/policy-suggestion.test.ts | 9+++++----
Mpackages/anastasis-core/tsconfig.json | 14+++++++++++---
Mpackages/idb-bridge/package.json | 8++------
Mpackages/idb-bridge/src/MemoryBackend.test.ts | 18++++++++++++------
Mpackages/idb-bridge/src/SqliteBackend.test.ts | 17++++++++---------
Mpackages/idb-bridge/src/backends.test.ts | 138++++++++++++++++++++++++++++++++++++-------------------------------------------
Mpackages/idb-bridge/src/idb-wpt-ported/abort-in-initial-upgradeneeded.test.ts | 22++++++++++++----------
Mpackages/idb-bridge/src/idb-wpt-ported/close-in-upgradeneeded.test.ts | 23++++++++++++-----------
Mpackages/idb-bridge/src/idb-wpt-ported/cursor-overloads.test.ts | 11++++++-----
Mpackages/idb-bridge/src/idb-wpt-ported/event-dispatch-active-flag.test.ts | 59++++++++++++++++++++++++++++++++---------------------------
Mpackages/idb-bridge/src/idb-wpt-ported/idbcursor-advance-index.test.ts | 77++++++++++++++++++++++++++++++++++++++++++-----------------------------------
Mpackages/idb-bridge/src/idb-wpt-ported/idbcursor-continue-index.test.ts | 107+++++++++++++++++++++++++++++++++++++++++++++++++------------------------------
Mpackages/idb-bridge/src/idb-wpt-ported/idbcursor-continue-objectstore.test.ts | 53+++++++++++++++++++++++++++--------------------------
Mpackages/idb-bridge/src/idb-wpt-ported/idbcursor-delete-exception-order.test.ts | 15++++++++-------
Mpackages/idb-bridge/src/idb-wpt-ported/idbcursor-delete-index.test.ts | 39++++++++++++++++++++-------------------
Mpackages/idb-bridge/src/idb-wpt-ported/idbcursor-delete-objectstore.test.ts | 244++++++++++++++++++++++++++++++++++++++-----------------------------------------
Mpackages/idb-bridge/src/idb-wpt-ported/idbcursor-reused.test.ts | 42+++++++++++++++++++++++++++++-------------
Mpackages/idb-bridge/src/idb-wpt-ported/idbcursor-update-index.test.ts | 537++++++++++++++++++++++++++++++++-----------------------------------------------
Mpackages/idb-bridge/src/idb-wpt-ported/idbfactory-cmp.test.ts | 34++++++++++++++++------------------
Mpackages/idb-bridge/src/idb-wpt-ported/idbfactory-open.test.ts | 659++++++++++++++++++++-----------------------------------------------------------
Mpackages/idb-bridge/src/idb-wpt-ported/idbindex-get.test.ts | 31++++++++++++-------------------
Mpackages/idb-bridge/src/idb-wpt-ported/idbindex-openCursor.test.ts | 17+++++++++--------
Mpackages/idb-bridge/src/idb-wpt-ported/idbobjectstore-add-put-exception-order.test.ts | 35+++++++++++++++++++++--------------
Mpackages/idb-bridge/src/idb-wpt-ported/idbobjectstore-add.test.ts | 82+++++++++++++++++++++++++++++++++----------------------------------------------
Mpackages/idb-bridge/src/idb-wpt-ported/idbobjectstore-get.test.ts | 42+++++++++++++++++++++++-------------------
Mpackages/idb-bridge/src/idb-wpt-ported/idbobjectstore-put.test.ts | 101++++++++++++++++++++++++++++++++++++++++---------------------------------------
Mpackages/idb-bridge/src/idb-wpt-ported/idbobjectstore-rename-store.test.ts | 95++++++++++++++++++++++++++++++++++++-------------------------------------------
Mpackages/idb-bridge/src/idb-wpt-ported/idbtransaction-oncomplete.test.ts | 12++++++++----
Mpackages/idb-bridge/src/idb-wpt-ported/keypath.test.ts | 7+++----
Mpackages/idb-bridge/src/idb-wpt-ported/request-bubble-and-capture.test.ts | 8++++----
Mpackages/idb-bridge/src/idb-wpt-ported/transaction-requestqueue.test.ts | 10+++++-----
Mpackages/idb-bridge/src/idb-wpt-ported/value.test.ts | 17+++++++----------
Mpackages/idb-bridge/src/idb-wpt-ported/wptsupport.ts | 124+++++++++++++++++++++++++++++++++++++++++++------------------------------------
Mpackages/idb-bridge/src/node-helper-sqlite3-impl.test.ts | 17++++++++---------
Mpackages/idb-bridge/src/util/canInjectKey.test.ts | 7++++---
Mpackages/idb-bridge/src/util/enforceRange.ts | 2+-
Mpackages/idb-bridge/src/util/getIndexKeys.test.ts | 33+++++++++++++++++++--------------
Mpackages/idb-bridge/src/util/key-storage.test.ts | 7++++---
Mpackages/idb-bridge/src/util/makeStoreKeyValue.test.ts | 51++++++++++++++++++++++++++-------------------------
Mpackages/idb-bridge/src/util/structuredClone.test.ts | 70+++++++++++++++++++++++++++++++++++++++++-----------------------------
Mpackages/idb-bridge/src/util/structuredClone.ts | 4++--
Mpackages/idb-bridge/tsconfig.json | 12+++++++++---
Mpackages/pogen/package.json | 8+-------
Mpackages/pogen/src/potextract.test.ts | 17+++++++++--------
Mpackages/pogen/tsconfig.json | 12+++++++++---
Mpackages/taler-harness/src/lint.ts | 2+-
Mpackages/taler-util/package.json | 10++--------
Mpackages/taler-util/src/aml/events.test.ts | 17+++++++++--------
Mpackages/taler-util/src/aml/properties.test.ts | 9+++++----
Mpackages/taler-util/src/amounts.test.ts | 101+++++++++++++++++++++++++++++++++++++++----------------------------------------
Mpackages/taler-util/src/bitcoin.test.ts | 49+++++++++++++++++++++++++------------------------
Mpackages/taler-util/src/clk.test.ts | 7++++---
Mpackages/taler-util/src/codec.test.ts | 11++++++-----
Mpackages/taler-util/src/contract-terms.test.ts | 37+++++++++++++++++++------------------
Mpackages/taler-util/src/helpers.test.ts | 13++++++-------
Mpackages/taler-util/src/iban.test.ts | 11++++++-----
Mpackages/taler-util/src/libtool-version.test.ts | 23++++++++++++-----------
Mpackages/taler-util/src/payto.test.ts | 52++++++++++++++++++++++++++++------------------------
Mpackages/taler-util/src/paytos.test.ts | 69+++++++++++++++++++++++++++++++++++++++++----------------------------
Mpackages/taler-util/src/taler-crypto.test.ts | 112+++++++++++++++++++++++++++++++++++++++++--------------------------------------
Mpackages/taler-util/src/talerconfig.test.ts | 35++++++++++++++++++-----------------
Mpackages/taler-util/src/taleruri.test.ts | 249+++++++++++++++++++++++++++++++++++++++++++++----------------------------------
Mpackages/taler-util/src/taleruris.test.ts | 248+++++++++++++++++++++++++++++++++++++++++++++----------------------------------
Mpackages/taler-util/src/time.test.ts | 15++++++++-------
Mpackages/taler-util/src/types.test.ts | 12++++++------
Mpackages/taler-wallet-core/package.json | 16+++++-----------
Mpackages/taler-wallet-core/src/coinSelection.test.ts | 51++++++++++++++++++++++++++-------------------------
Mpackages/taler-wallet-core/src/crypto/workers/crypto-dispatcher.test.ts | 11++++++-----
Mpackages/taler-wallet-core/src/denominations.test.ts | 9+++++----
Mpackages/taler-wallet-core/src/instructedAmountConversion.test.ts | 122+++++++++++++++++++++++++++++++++++++++----------------------------------------
Mpackages/taler-wallet-core/src/tokenSelection.test.ts | 21+++++++++++----------
Mpackages/taler-wallet-core/src/withdraw.test.ts | 6+++---
Mpackages/taler-wallet-core/tsconfig.json | 13++++++++++---
Mpnpm-lock.yaml | 886+------------------------------------------------------------------------------
76 files changed, 2020 insertions(+), 3174 deletions(-)

diff --git a/packages/anastasis-core/package.json b/packages/anastasis-core/package.json @@ -8,8 +8,8 @@ "scripts": { "compile": "tsc", "pretty": "prettier --write src", - "test": "tsc && ava", - "coverage": "tsc && c8 --src src --all ava", + "test": "tsc && node --test lib/*.test.js lib/**/*.test.js", + "coverage": "tsc && c8 --src src --all node --test lib/*.test.js lib/**/*.test.js", "typedoc": "typedoc --out dist/typedoc ./src/", "clean": "rm -rf dist lib tsconfig.tsbuildinfo" }, @@ -17,18 +17,13 @@ "license": "AGPL-3-or-later", "type": "module", "devDependencies": { - "ava": "^8.0.0", "c8": "^11.0.0", - "typescript": "^6.0.3" + "typescript": "^6.0.3", + "@types/node": "^18.11.17" }, "dependencies": { "@gnu-taler/taler-util": "workspace:*", "fflate": "^0.8.1", "tslib": "^2.6.2" - }, - "ava": { - "files": [ - "lib/**/*test.*" - ] } } diff --git a/packages/anastasis-core/src/crypto.test.ts b/packages/anastasis-core/src/crypto.test.ts @@ -1,4 +1,5 @@ -import test from "ava"; +import { test } from "node:test"; +import assert from "node:assert"; import { accountKeypairDerive, decryptTruth, @@ -25,7 +26,7 @@ test("user ID derivation", async (t) => { userIdVector.input_id_data, userIdVector.input_server_salt, ); - t.is(res, userIdVector.output_id); + assert.strictEqual(res, userIdVector.output_id); }); test("account key pair derive", async (t) => { @@ -38,8 +39,8 @@ test("account key pair derive", async (t) => { }; const res = accountKeypairDerive(tv.input_id); - t.is(res.priv, tv.output_priv_key); - t.is(res.pub, tv.output_pub_key); + assert.strictEqual(res.priv, tv.output_priv_key); + assert.strictEqual(res.pub, tv.output_pub_key); }); test("policy key derive", async (t) => { @@ -56,7 +57,7 @@ test("policy key derive", async (t) => { }; const res = await policyKeyDerive(tv.input_key_shares, tv.input_salt); - t.is(res, tv.output_policy_key); + assert.strictEqual(res, tv.output_policy_key); }); test("secure answer hash", async (t) => { @@ -74,7 +75,7 @@ test("secure answer hash", async (t) => { tv.input_uuid, tv.input_salt, ); - t.is(out, tv.output_hash); + assert.strictEqual(out, tv.output_hash); }); test("truth encryption", async (t) => { @@ -94,9 +95,9 @@ test("truth encryption", async (t) => { tv.input_truth_enc_key, tv.input_truth, ); - t.is(enc, tv.output_encrypted_truth); + assert.strictEqual(enc, tv.output_encrypted_truth); const dec = await decryptTruth(tv.input_truth_enc_key, enc); - t.is(dec, tv.input_truth); + assert.strictEqual(dec, tv.input_truth); }); diff --git a/packages/anastasis-core/src/policy-suggestion.test.ts b/packages/anastasis-core/src/policy-suggestion.test.ts @@ -1,5 +1,6 @@ import { AmountString, j2s } from "@gnu-taler/taler-util"; -import test from "ava"; +import { test } from "node:test"; +import assert from "node:assert"; import { ProviderInfo, suggestPolicies } from "./policy-suggestion.js"; test("policy suggestion", async (t) => { @@ -35,10 +36,10 @@ test("policy suggestion", async (t) => { }, ]; const res1 = suggestPolicies(methods, providers); - t.assert(res1.policies.length === 1); + assert.ok(res1.policies.length === 1); const res2 = suggestPolicies([...methods].reverse(), providers); - t.assert(res2.policies.length === 1); + assert.ok(res2.policies.length === 1); const res3 = suggestPolicies(methods, [...providers].reverse()); - t.assert(res3.policies.length === 1); + assert.ok(res3.policies.length === 1); }); diff --git a/packages/anastasis-core/tsconfig.json b/packages/anastasis-core/tsconfig.json @@ -1,11 +1,19 @@ { "extends": "../../tsconfig.defaults.json", "compilerOptions": { - "lib": ["ES2020", "DOM"], + "lib": [ + "ES2020", + "DOM" + ], "outDir": "lib", - "rootDir": "./src" + "rootDir": "./src", + "types": [ + "node" + ] }, - "include": ["src/**/*"], + "include": [ + "src/**/*" + ], "references": [ { "path": "../taler-util/" diff --git a/packages/idb-bridge/package.json b/packages/idb-bridge/package.json @@ -10,7 +10,7 @@ "license": "AGPL-3.0-or-later", "private": false, "scripts": { - "test": "tsc && ava", + "test": "tsc && node --test lib/*.test.js lib/**/*.test.js", "typedoc": "typedoc --out dist/typedoc ./src/", "compile": "tsc", "clean": "rm -rf dist lib tsconfig.tsbuildinfo", @@ -26,15 +26,11 @@ }, "devDependencies": { "@types/better-sqlite3": "^7.6.8", - "@types/node": "^20.4.1", - "ava": "^8.0.0", + "@types/node": "^18.11.17", "prettier": "^3.8.3", "typescript": "^6.0.3" }, "dependencies": { "tslib": "^2.6.2" - }, - "ava": { - "failFast": true } } diff --git a/packages/idb-bridge/src/MemoryBackend.test.ts b/packages/idb-bridge/src/MemoryBackend.test.ts @@ -14,7 +14,8 @@ permissions and limitations under the License. */ -import test from "ava"; +import { test } from "node:test"; +import assert from "node:assert"; import { MemoryBackend } from "./MemoryBackend.js"; import { BridgeIDBDatabase, BridgeIDBFactory } from "./bridge-idb.js"; import { promiseFromRequest, promiseFromTransaction } from "./idbpromutil.js"; @@ -51,13 +52,18 @@ test("export", async (t) => { backend2.importDump(exportedData); const exportedData2 = backend2.exportDump(); - t.assert( + assert.ok( exportedData.databases["library"].objectStores["books"].records.length === 3, ); - t.deepEqual(exportedData, exportedData2); + assert.deepStrictEqual(exportedData, exportedData2); - t.is(exportedData.databases["library"].schema.databaseVersion, 42); - t.is(exportedData2.databases["library"].schema.databaseVersion, 42); - t.pass(); + assert.strictEqual( + exportedData.databases["library"].schema.databaseVersion, + 42, + ); + assert.strictEqual( + exportedData2.databases["library"].schema.databaseVersion, + 42, + ); }); diff --git a/packages/idb-bridge/src/SqliteBackend.test.ts b/packages/idb-bridge/src/SqliteBackend.test.ts @@ -14,7 +14,8 @@ permissions and limitations under the License. */ -import test from "ava"; +import { test } from "node:test"; +import assert from "node:assert"; import * as fs from "node:fs"; import { createSqliteBackend } from "./SqliteBackend.js"; import { ResultLevel, StoreLevel } from "./backend-interface.js"; @@ -51,9 +52,9 @@ test("sqlite3 backend", async (t) => { resultLevel: ResultLevel.Full, range: BridgeIDBKeyRange.only(1), }); - t.deepEqual(res.count, 1); - t.deepEqual(res.primaryKeys![0], 1); - t.deepEqual(res.values![0].name, "foo"); + assert.deepStrictEqual(res.count, 1); + assert.deepStrictEqual(res.primaryKeys![0], 1); + assert.deepStrictEqual(res.values![0].name, "foo"); const indexRes = await backend.getIndexRecords(tx, { direction: "next", @@ -64,9 +65,9 @@ test("sqlite3 backend", async (t) => { range: BridgeIDBKeyRange.only("foo"), }); - t.deepEqual(indexRes.count, 1); - t.deepEqual(indexRes.values![0].isbn, 1); - t.deepEqual(indexRes.values![0].name, "foo"); + assert.deepStrictEqual(indexRes.count, 1); + assert.deepStrictEqual(indexRes.values![0].isbn, 1); + assert.deepStrictEqual(indexRes.values![0].name, "foo"); await backend.commit(tx); @@ -74,8 +75,6 @@ test("sqlite3 backend", async (t) => { await backend.commit(tx2); await backend.close(dbConn); - - t.pass(); } catch (e: any) { console.log(e); throw e; diff --git a/packages/idb-bridge/src/backends.test.ts b/packages/idb-bridge/src/backends.test.ts @@ -22,7 +22,8 @@ /** * Imports. */ -import test from "ava"; +import { test, before } from "node:test"; +import assert from "node:assert"; import { MemoryBackend } from "./MemoryBackend.js"; import { BridgeIDBCursorWithValue, @@ -41,7 +42,7 @@ import { import { initTestIndexedDB, useTestIndexedDb } from "./testingdb.js"; import { promiseForTransaction } from "./idb-wpt-ported/wptsupport.js"; -test.before("test DB initialization", initTestIndexedDB); +before(initTestIndexedDB); test("Spec: Example 1 Part 1", async (t) => { const idb = useTestIndexedDb(); @@ -62,7 +63,6 @@ test("Spec: Example 1 Part 1", async (t) => { }; await promiseFromRequest(request); - t.pass(); }); test("Spec: Example 1 Part 2", async (t) => { @@ -80,7 +80,7 @@ test("Spec: Example 1 Part 2", async (t) => { const db: BridgeIDBDatabase = await promiseFromRequest(request); - t.is(db.name, dbname); + assert.strictEqual(db.name, dbname); const tx = db.transaction("books", "readwrite"); tx.oncomplete = () => { @@ -94,8 +94,6 @@ test("Spec: Example 1 Part 2", async (t) => { store.put({ title: "Bedrock Nights", author: "Barney", isbn: 345678 }); await promiseFromTransaction(tx); - - t.pass(); }); test("duplicate index insertion", async (t) => { @@ -113,7 +111,7 @@ test("duplicate index insertion", async (t) => { const db: BridgeIDBDatabase = await promiseFromRequest(request); - t.is(db.name, dbname); + assert.strictEqual(db.name, dbname); const tx = db.transaction("books", "readwrite"); tx.oncomplete = () => { @@ -142,14 +140,12 @@ test("duplicate index insertion", async (t) => { await promiseFromRequest(request3); while (request3.result != null) { const cursor: IDBCursorWithValue = request3.result; - authorList.push(cursor.value.author); + authorList.push((cursor as any).value.author); cursor.continue(); await promiseFromRequest(request3); } - t.deepEqual(authorList, ["Barney", "Fred", "Fred"]); - - t.pass(); + assert.deepStrictEqual(authorList, ["Barney", "Fred", "Fred"]); }); test("simple index iteration", async (t) => { @@ -182,21 +178,21 @@ test("simple index iteration", async (t) => { let cursor: BridgeIDBCursorWithValue | null; cursor = request3.result as BridgeIDBCursorWithValue; - t.is(cursor.value.author, "Fred"); - t.is(cursor.value.isbn, 123456); + assert.strictEqual((cursor as any).value.author, "Fred"); + assert.strictEqual((cursor as any).value.isbn, 123456); cursor.continue(); await promiseFromRequest(request3); - t.is(cursor.value.author, "Fred"); - t.is(cursor.value.isbn, 234567); + assert.strictEqual((cursor as any).value.author, "Fred"); + assert.strictEqual((cursor as any).value.isbn, 234567); cursor.continue(); await promiseFromRequest(request3); - t.is(cursor.value, undefined); + assert.strictEqual((cursor as any).value, undefined); }); test("Spec: Example 1 Part 3", async (t) => { @@ -212,7 +208,7 @@ test("Spec: Example 1 Part 3", async (t) => { const db: BridgeIDBDatabase = await promiseFromRequest(request); - t.is(db.name, dbname); + assert.strictEqual(db.name, dbname); const tx = db.transaction("books", "readwrite"); @@ -230,7 +226,7 @@ test("Spec: Example 1 Part 3", async (t) => { const request2 = index2.get("Bedrock Nights"); const result2: any = await promiseFromRequest(request2); - t.is(result2.author, "Barney"); + assert.strictEqual(result2.author, "Barney"); const tx3 = db.transaction(["books"], "readonly"); const store3 = tx3.objectStore("books"); @@ -241,16 +237,16 @@ test("Spec: Example 1 Part 3", async (t) => { let cursor: BridgeIDBCursorWithValue | null; cursor = request3.result as BridgeIDBCursorWithValue; - t.is(cursor.value.author, "Fred"); - t.is(cursor.value.isbn, 123456); + assert.strictEqual((cursor as any).value.author, "Fred"); + assert.strictEqual((cursor as any).value.isbn, 123456); cursor.continue(); await promiseFromRequest(request3); cursor = request3.result as BridgeIDBCursorWithValue; - t.is(cursor.value.author, "Fred"); - t.is(cursor.value.isbn, 234567); + assert.strictEqual((cursor as any).value.author, "Fred"); + assert.strictEqual((cursor as any).value.isbn, 234567); await promiseFromTransaction(tx3); @@ -264,7 +260,7 @@ test("Spec: Example 1 Part 3", async (t) => { if (!cursor) { throw new Error(); } - t.is(cursor.value.isbn, 123456); + assert.strictEqual((cursor as any).value.isbn, 123456); cursor.continue(); @@ -274,7 +270,7 @@ test("Spec: Example 1 Part 3", async (t) => { if (!cursor) { throw new Error(); } - t.is(cursor.value.isbn, 234567); + assert.strictEqual((cursor as any).value.isbn, 234567); cursor.continue(); @@ -284,14 +280,14 @@ test("Spec: Example 1 Part 3", async (t) => { if (!cursor) { throw new Error(); } - t.is(cursor.value.isbn, 345678); + assert.strictEqual((cursor as any).value.isbn, 345678); cursor.continue(); await promiseFromRequest(request4); cursor = request4.result; - t.is(cursor, null); + assert.strictEqual(cursor, null); const tx5 = db.transaction("books", "readonly"); const store5 = tx5.objectStore("books"); @@ -304,7 +300,7 @@ test("Spec: Example 1 Part 3", async (t) => { if (!cursor) { throw new Error(); } - t.is(cursor.value.author, "Barney"); + assert.strictEqual((cursor as any).value.author, "Barney"); cursor.continue(); await promiseFromRequest(request5); @@ -312,7 +308,7 @@ test("Spec: Example 1 Part 3", async (t) => { if (!cursor) { throw new Error(); } - t.is(cursor.value.author, "Fred"); + assert.strictEqual((cursor as any).value.author, "Fred"); cursor.continue(); await promiseFromRequest(request5); @@ -320,12 +316,12 @@ test("Spec: Example 1 Part 3", async (t) => { if (!cursor) { throw new Error(); } - t.is(cursor.value.author, "Fred"); + assert.strictEqual((cursor as any).value.author, "Fred"); cursor.continue(); await promiseFromRequest(request5); cursor = request5.result; - t.is(cursor, null); + assert.strictEqual(cursor, null); const request6 = index5.openCursor(null, "nextunique"); @@ -334,7 +330,7 @@ test("Spec: Example 1 Part 3", async (t) => { if (!cursor) { throw new Error(); } - t.is(cursor.value.author, "Barney"); + assert.strictEqual((cursor as any).value.author, "Barney"); cursor.continue(); await promiseFromRequest(request6); @@ -342,13 +338,13 @@ test("Spec: Example 1 Part 3", async (t) => { if (!cursor) { throw new Error(); } - t.is(cursor.value.author, "Fred"); - t.is(cursor.value.isbn, 123456); + assert.strictEqual((cursor as any).value.author, "Fred"); + assert.strictEqual((cursor as any).value.isbn, 123456); cursor.continue(); await promiseFromRequest(request6); cursor = request6.result; - t.is(cursor, null); + assert.strictEqual(cursor, null); console.log("---------------------------"); @@ -358,8 +354,8 @@ test("Spec: Example 1 Part 3", async (t) => { if (!cursor) { throw new Error(); } - t.is(cursor.value.author, "Fred"); - t.is(cursor.value.isbn, 123456); + assert.strictEqual((cursor as any).value.author, "Fred"); + assert.strictEqual((cursor as any).value.isbn, 123456); cursor.continue(); await promiseFromRequest(request7); @@ -367,16 +363,14 @@ test("Spec: Example 1 Part 3", async (t) => { if (!cursor) { throw new Error(); } - t.is(cursor.value.author, "Barney"); + assert.strictEqual((cursor as any).value.author, "Barney"); cursor.continue(); await promiseFromRequest(request7); cursor = request7.result; - t.is(cursor, null); + assert.strictEqual(cursor, null); db.close(); - - t.pass(); }); test("simple deletion", async (t) => { @@ -410,24 +404,22 @@ test("simple deletion", async (t) => { const req1 = store2.get(234567); await promiseFromRequest(req1); - t.is(req1.readyState, "done"); - t.is(req1.result.author, "Fred"); + assert.strictEqual(req1.readyState, "done"); + assert.strictEqual(req1.result.author, "Fred"); store2.delete(123456); const req2 = store2.get(123456); await promiseFromRequest(req2); - t.is(req2.readyState, "done"); - t.is(req2.result, undefined); + assert.strictEqual(req2.readyState, "done"); + assert.strictEqual(req2.result, undefined); const req3 = store2.get(234567); await promiseFromRequest(req3); - t.is(req3.readyState, "done"); - t.is(req3.result.author, "Fred"); + assert.strictEqual(req3.readyState, "done"); + assert.strictEqual(req3.result.author, "Fred"); await promiseFromTransaction(tx2); - - t.pass(); }); test("export", async (t) => { @@ -462,14 +454,16 @@ test("export", async (t) => { backend2.importDump(exportedData); const exportedData2 = backend2.exportDump(); - t.assert( + assert.ok( exportedData.databases[dbname].objectStores["books"].records.length === 3, ); - t.deepEqual(exportedData, exportedData2); + assert.deepStrictEqual(exportedData, exportedData2); - t.is(exportedData.databases[dbname].schema.databaseVersion, 42); - t.is(exportedData2.databases[dbname].schema.databaseVersion, 42); - t.pass(); + assert.strictEqual(exportedData.databases[dbname].schema.databaseVersion, 42); + assert.strictEqual( + exportedData2.databases[dbname].schema.databaseVersion, + 42, + ); }); test("update with non-existent index values", async (t) => { @@ -485,7 +479,7 @@ test("update with non-existent index values", async (t) => { const db: BridgeIDBDatabase = await promiseFromRequest(request); - t.is(db.name, dbname); + assert.strictEqual(db.name, dbname); { const tx = db.transaction("bla", "readwrite"); @@ -493,9 +487,9 @@ test("update with non-existent index values", async (t) => { store.put({ x: 0, y: "a", z: 42 }); const index = store.index("by_z"); const indRes = await promiseFromRequest(index.get(42)); - t.is(indRes.x, 0); + assert.strictEqual(indRes.x, 0); const res = await promiseFromRequest(store.get(0)); - t.is(res.z, 42); + assert.strictEqual(res.z, 42); await promiseFromTransaction(tx); } @@ -504,7 +498,7 @@ test("update with non-existent index values", async (t) => { const store = tx.objectStore("bla"); store.put({ x: 0, y: "a" }); const res = await promiseFromRequest(store.get(0)); - t.is(res.z, undefined); + assert.strictEqual(res.z, undefined); await promiseFromTransaction(tx); } @@ -514,14 +508,12 @@ test("update with non-existent index values", async (t) => { const index = store.index("by_z"); { const indRes = await promiseFromRequest(index.get(42)); - t.is(indRes, undefined); + assert.strictEqual(indRes, undefined); } const res = await promiseFromRequest(store.get(0)); - t.is(res.z, undefined); + assert.strictEqual(res.z, undefined); await promiseFromTransaction(tx); } - - t.pass(); }); test("delete from unique index", async (t) => { @@ -538,7 +530,7 @@ test("delete from unique index", async (t) => { const db: BridgeIDBDatabase = await promiseFromRequest(request); - t.is(db.name, dbname); + assert.strictEqual(db.name, dbname); { const tx = db.transaction("bla", "readwrite"); @@ -546,9 +538,9 @@ test("delete from unique index", async (t) => { store.put({ x: 0, y: "a", z: 42 }); const index = store.index("by_yz"); const indRes = await promiseFromRequest(index.get(["a", 42])); - t.is(indRes.x, 0); + assert.strictEqual(indRes.x, 0); const res = await promiseFromRequest(store.get(0)); - t.is(res.z, 42); + assert.strictEqual(res.z, 42); await promiseFromTransaction(tx); } @@ -558,8 +550,6 @@ test("delete from unique index", async (t) => { store.put({ x: 0, y: "a", z: 42, extra: 123 }); await promiseFromTransaction(tx); } - - t.pass(); }); test("range queries", async (t) => { @@ -603,12 +593,12 @@ test("range queries", async (t) => { break; } cursor.continue(); - vals.push(cursor.value); + vals.push((cursor as any).value); } await promiseFromTransaction(tx); - t.deepEqual(vals, expected); + assert.deepStrictEqual(vals, expected); } async function doCursorIndexQuery( @@ -629,12 +619,12 @@ test("range queries", async (t) => { break; } cursor.continue(); - vals.push(cursor.value); + vals.push((cursor as any).value); } await promiseFromTransaction(tx); - t.deepEqual(vals, expected); + assert.deepStrictEqual(vals, expected); } await doCursorStoreQuery(undefined, undefined, [ @@ -733,8 +723,6 @@ test("range queries", async (t) => { ]); db.close(); - - t.pass(); }); test("idb: multiple transactions", async (t) => { @@ -759,11 +747,11 @@ test("idb: multiple transactions", async (t) => { const tx1 = db.transaction(["books"], "readwrite"); tx1.oncomplete = () => { - t.log("first tx completed"); + console.log("first tx completed"); }; tx1.onerror = () => { - t.log("first tx errored"); + console.log("first tx errored"); }; tx1.abort(); @@ -774,6 +762,4 @@ test("idb: multiple transactions", async (t) => { const tx3 = db.transaction(["books"], "readwrite"); await promiseForTransaction(t, tx3); - - t.pass(); }); diff --git a/packages/idb-bridge/src/idb-wpt-ported/abort-in-initial-upgradeneeded.test.ts b/packages/idb-bridge/src/idb-wpt-ported/abort-in-initial-upgradeneeded.test.ts @@ -1,7 +1,8 @@ -import test from "ava"; +import { test, before } from "node:test"; +import assert from "node:assert"; import { createdb, initTestIndexedDB } from "./wptsupport.js"; -test.before("test DB initialization", initTestIndexedDB); +before(initTestIndexedDB); test("WPT test abort-in-initial-upgradeneeded.htm", async (t) => { await new Promise<void>((resolve, reject) => { @@ -11,12 +12,13 @@ test("WPT test abort-in-initial-upgradeneeded.htm", async (t) => { open_rq.onupgradeneeded = function (e: any) { const tgt = e.target as any; db = tgt.result; - t.deepEqual(db.version, 2); + assert.deepStrictEqual(db.version, 2); var transaction = tgt.transaction; - transaction.oncomplete = () => t.fail("unexpected transaction.complete"); + transaction.oncomplete = () => + assert.fail("unexpected transaction.complete"); transaction.onabort = function (e: any) { console.log(`version: ${e.target.db.version}`); - t.deepEqual(e.target.db.version, 0); + assert.deepStrictEqual(e.target.db.version, 0); }; db.onabort = function () {}; transaction.abort(); @@ -24,12 +26,12 @@ test("WPT test abort-in-initial-upgradeneeded.htm", async (t) => { open_rq.onerror = function (e: any) { const tgt = e.target as any; - t.deepEqual(open_rq, e.target); - t.deepEqual(tgt.result, undefined); - t.deepEqual(tgt.error.name, "AbortError"); + assert.deepStrictEqual(open_rq, e.target); + assert.deepStrictEqual(tgt.result, undefined); + assert.deepStrictEqual(tgt.error.name, "AbortError"); console.log(`version (onerror): ${db.version}`); - t.deepEqual(db.version, 0); - t.deepEqual(open_rq.transaction, null); + assert.deepStrictEqual(db.version, 0); + assert.deepStrictEqual(open_rq.transaction, null); resolve(); }; }); diff --git a/packages/idb-bridge/src/idb-wpt-ported/close-in-upgradeneeded.test.ts b/packages/idb-bridge/src/idb-wpt-ported/close-in-upgradeneeded.test.ts @@ -1,18 +1,19 @@ -import test from "ava"; +import { test, before } from "node:test"; +import assert from "node:assert"; import { createdb, initTestIndexedDB } from "./wptsupport.js"; -test.before("test DB initialization", initTestIndexedDB); +before(initTestIndexedDB); // When db.close is called in upgradeneeded, the db is cleaned up on refresh test("WPT test close-in-upgradeneeded.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db: any; var open_rq = createdb(t); var sawTransactionComplete = false; open_rq.onupgradeneeded = function (e: any) { db = e.target.result; - t.deepEqual(db.version, 1); + assert.deepStrictEqual(db.version, 1); db.createObjectStore("os"); db.close(); @@ -23,15 +24,15 @@ test("WPT test close-in-upgradeneeded.htm", (t) => { }; open_rq.onerror = function (e: any) { - t.true(sawTransactionComplete, "saw transaction.complete"); + assert.ok(sawTransactionComplete, "saw transaction.complete"); - t.deepEqual(e.target.error.name, "AbortError"); - t.deepEqual(e.result, undefined); + assert.deepStrictEqual(e.target.error.name, "AbortError"); + assert.deepStrictEqual(e.result, undefined); - t.true(!!db); - t.deepEqual(db.version, 1); - t.deepEqual(db.objectStoreNames.length, 1); - t.throws( + assert.ok(!!db); + assert.deepStrictEqual(db.version, 1); + assert.deepStrictEqual(db.objectStoreNames.length, 1); + assert.throws( () => { db.transaction("os"); }, diff --git a/packages/idb-bridge/src/idb-wpt-ported/cursor-overloads.test.ts b/packages/idb-bridge/src/idb-wpt-ported/cursor-overloads.test.ts @@ -1,16 +1,17 @@ -import test from "ava"; +import { test, before } from "node:test"; +import assert from "node:assert"; import { BridgeIDBKeyRange } from "../bridge-idb.js"; import { IDBRequest } from "../idbtypes.js"; import { createdb, initTestIndexedDB } from "./wptsupport.js"; -test.before("test DB initialization", initTestIndexedDB); +before(initTestIndexedDB); const IDBKeyRange = BridgeIDBKeyRange; // Validate the overloads of IDBObjectStore.openCursor(), // IDBIndex.openCursor() and IDBIndex.openKeyCursor() test("WPT test cursor-overloads.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db: any, store: any, index: any; var request = createdb(t); @@ -134,12 +135,12 @@ test("WPT test cursor-overloads.htm", (t) => { ): Promise<void> { return new Promise<void>((resolve, reject) => { request.onsuccess = function (event: any) { - t.notDeepEqual( + assert.notDeepStrictEqual( event.target.result, null, "Check the result is not null", ); - t.deepEqual( + assert.deepStrictEqual( event.target.result.direction, direction, "Check the result direction", diff --git a/packages/idb-bridge/src/idb-wpt-ported/event-dispatch-active-flag.test.ts b/packages/idb-bridge/src/idb-wpt-ported/event-dispatch-active-flag.test.ts @@ -1,4 +1,5 @@ -import test from "ava"; +import { test, before } from "node:test"; +import assert from "node:assert"; import { BridgeIDBRequest } from "../bridge-idb.js"; import { indexeddb_test, @@ -7,7 +8,7 @@ import { keep_alive, } from "./wptsupport.js"; -test.before("test DB initialization", initTestIndexedDB); +before(initTestIndexedDB); test("WPT test event-dispatch-active-flag.html (subtest 1)", async (t) => { // Transactions are active during success handlers @@ -20,16 +21,16 @@ test("WPT test event-dispatch-active-flag.html (subtest 1)", async (t) => { const tx = db.transaction("store"); const release_tx = keep_alive(t, tx, "store"); - t.assert( + assert.ok( is_transaction_active(t, tx, "store"), "Transaction should be active after creation", ); const request = tx.objectStore("store").get(4242); (request as BridgeIDBRequest)._debugName = "req-main"; - request.onerror = () => t.fail("request should succeed"); + request.onerror = () => assert.fail("request should succeed"); request.onsuccess = () => { - t.true( + assert.ok( is_transaction_active(t, tx, "store"), "Transaction should be active during success handler", ); @@ -37,16 +38,17 @@ test("WPT test event-dispatch-active-flag.html (subtest 1)", async (t) => { let saw_handler_promise = false; Promise.resolve().then(() => { saw_handler_promise = true; - t.true( + assert.ok( is_transaction_active(t, tx, "store"), "Transaction should be active in handler's microtasks", ); }); setTimeout(() => { - t.true(saw_handler_promise); - t.false( + assert.ok(saw_handler_promise); + assert.strictEqual( is_transaction_active(t, tx, "store"), + false, "Transaction should be inactive in next task", ); release_tx(); @@ -67,15 +69,15 @@ test("WPT test event-dispatch-active-flag.html (subtest 2)", async (t) => { (done, db) => { const tx = db.transaction("store"); const release_tx = keep_alive(t, tx, "store"); - t.true( + assert.ok( is_transaction_active(t, tx, "store"), "Transaction should be active after creation", ); const request = tx.objectStore("store").get(0); - request.onerror = () => t.fail("request should succeed"); + request.onerror = () => assert.fail("request should succeed"); request.addEventListener("success", () => { - t.true( + assert.ok( is_transaction_active(t, tx, "store"), "Transaction should be active during success listener", ); @@ -83,16 +85,17 @@ test("WPT test event-dispatch-active-flag.html (subtest 2)", async (t) => { let saw_listener_promise = false; Promise.resolve().then(() => { saw_listener_promise = true; - t.true( + assert.ok( is_transaction_active(t, tx, "store"), "Transaction should be active in listener's microtasks", ); }); setTimeout(() => { - t.true(saw_listener_promise); - t.false( + assert.ok(saw_listener_promise); + assert.strictEqual( is_transaction_active(t, tx, "store"), + false, "Transaction should be inactive in next task", ); release_tx(); @@ -113,18 +116,18 @@ test("WPT test event-dispatch-active-flag.html (subtest 3)", async (t) => { (done, db) => { const tx = db.transaction("store", "readwrite"); const release_tx = keep_alive(t, tx, "store"); - t.true( + assert.ok( is_transaction_active(t, tx, "store"), "Transaction should be active after creation", ); tx.objectStore("store").put(0, 0); const request = tx.objectStore("store").add(0, 0); - request.onsuccess = () => t.fail("request should fail"); + request.onsuccess = () => assert.fail("request should fail"); request.onerror = (e: any) => { e.preventDefault(); - t.true( + assert.ok( is_transaction_active(t, tx, "store"), "Transaction should be active during error handler", ); @@ -132,16 +135,17 @@ test("WPT test event-dispatch-active-flag.html (subtest 3)", async (t) => { let saw_handler_promise = false; Promise.resolve().then(() => { saw_handler_promise = true; - t.true( + assert.ok( is_transaction_active(t, tx, "store"), "Transaction should be active in handler's microtasks", ); }); setTimeout(() => { - t.true(saw_handler_promise); - t.false( + assert.ok(saw_handler_promise); + assert.strictEqual( is_transaction_active(t, tx, "store"), + false, "Transaction should be inactive in next task", ); release_tx(); @@ -162,18 +166,18 @@ test("WPT test event-dispatch-active-flag.html (subtest 4)", async (t) => { (done, db) => { const tx = db.transaction("store", "readwrite"); const release_tx = keep_alive(t, tx, "store"); - t.true( + assert.ok( is_transaction_active(t, tx, "store"), "Transaction should be active after creation", ); tx.objectStore("store").put(0, 0); const request = tx.objectStore("store").add(0, 0); - request.onsuccess = () => t.fail("request should fail"); - request.addEventListener("error", (e) => { + request.onsuccess = () => assert.fail("request should fail"); + request.addEventListener("error", (e: any) => { e.preventDefault(); - t.true( + assert.ok( is_transaction_active(t, tx, "store"), "Transaction should be active during error listener", ); @@ -181,16 +185,17 @@ test("WPT test event-dispatch-active-flag.html (subtest 4)", async (t) => { let saw_listener_promise = false; Promise.resolve().then(() => { saw_listener_promise = true; - t.true( + assert.ok( is_transaction_active(t, tx, "store"), "Transaction should be active in listener's microtasks", ); }); setTimeout(() => { - t.true(saw_listener_promise); - t.false( + assert.ok(saw_listener_promise); + assert.strictEqual( is_transaction_active(t, tx, "store"), + false, "Transaction should be inactive in next task", ); release_tx(); diff --git a/packages/idb-bridge/src/idb-wpt-ported/idbcursor-advance-index.test.ts b/packages/idb-bridge/src/idb-wpt-ported/idbcursor-advance-index.test.ts @@ -1,8 +1,9 @@ -import test from "ava"; +import { test, before } from "node:test"; +import assert from "node:assert"; import { BridgeIDBCursor, BridgeIDBRequest } from "../bridge-idb.js"; import { createdb, initTestIndexedDB } from "./wptsupport.js"; -test.before("test DB initialization", initTestIndexedDB); +before(initTestIndexedDB); test("WPT test idbcursor_advance_index.htm", async (t) => { await new Promise<void>((resolve, reject) => { @@ -35,9 +36,9 @@ test("WPT test idbcursor_advance_index.htm", async (t) => { cursor_rq.onsuccess = function (e: any) { var cursor = e.target.result; - t.log(cursor); - t.true(e.target instanceof BridgeIDBRequest); - t.true(cursor instanceof BridgeIDBCursor); + console.log(cursor); + assert.ok(e.target instanceof BridgeIDBRequest); + assert.ok(cursor instanceof BridgeIDBCursor); switch (count) { case 0: @@ -45,13 +46,21 @@ test("WPT test idbcursor_advance_index.htm", async (t) => { cursor.advance(3); break; case 3: - var record = cursor.value; - t.deepEqual(record.pKey, records[count].pKey, "record.pKey"); - t.deepEqual(record.iKey, records[count].iKey, "record.iKey"); + var record = (cursor as any).value; + assert.deepStrictEqual( + record.pKey, + records[count].pKey, + "record.pKey", + ); + assert.deepStrictEqual( + record.iKey, + records[count].iKey, + "record.iKey", + ); resolve(); break; default: - t.fail("unexpected count"); + assert.fail("unexpected count"); break; } }; @@ -89,14 +98,11 @@ test("WPT test idbcursor_advance_index2.htm", async (t) => { cursor_rq.onsuccess = function (e: any) { var cursor = e.target.result; - t.true(cursor != null, "cursor exist"); - t.throws( - () => { - // Original test uses "document". - cursor.advance({ foo: 42 }); - }, - { instanceOf: TypeError }, - ); + assert.ok(cursor != null, "cursor exist"); + assert.throws(() => { + // Original test uses "document". + cursor.advance({ foo: 42 }); + }, TypeError); resolve(); }; }; @@ -133,13 +139,10 @@ test("WPT test idbcursor_advance_index3.htm", async (t) => { cursor_rq.onsuccess = function (e: any) { var cursor = e.target.result; - t.true(cursor != null, "cursor exist"); - t.throws( - () => { - cursor.advance(-1); - }, - { instanceOf: TypeError }, - ); + assert.ok(cursor != null, "cursor exist"); + assert.throws(() => { + cursor.advance(-1); + }, TypeError); resolve(); }; }; @@ -181,13 +184,17 @@ test("WPT test idbcursor_advance_index5.htm", async (t) => { cursor_rq.onsuccess = function (e: any) { var cursor = e.target.result; if (!cursor) { - t.deepEqual(count, expected.length, "cursor run count"); + assert.deepStrictEqual(count, expected.length, "cursor run count"); resolve(); } - var record = cursor.value; - t.deepEqual(record.pKey, expected[count].pKey, "primary key"); - t.deepEqual(record.iKey, expected[count].iKey, "index key"); + var record = (cursor as any).value; + assert.deepStrictEqual( + record.pKey, + expected[count].pKey, + "primary key", + ); + assert.deepStrictEqual(record.iKey, expected[count].iKey, "index key"); cursor.advance(2); count++; @@ -216,10 +223,10 @@ test("WPT test idbcursor_advance_index7.htm", async (t) => { var rq = objStore.index("index").openCursor(); rq.onsuccess = function (event: any) { var cursor = event.target.result; - t.true(cursor instanceof BridgeIDBCursor); + assert.ok(cursor instanceof BridgeIDBCursor); event.target.transaction.abort(); - t.throws( + assert.throws( () => { cursor.advance(1); }, @@ -257,17 +264,17 @@ test("WPT test idbcursor_advance_index8.htm", async (t) => { } called = true; var cursor = event.target.result; - t.true(cursor instanceof BridgeIDBCursor); + assert.ok(cursor instanceof BridgeIDBCursor); cursor.advance(1); - t.throws( + assert.throws( () => { cursor.advance(1); }, { name: "InvalidStateError" }, "Calling advance() should throw DOMException when the cursor is currently being iterated.", ); - t.pass(); + resolve(); }; }; @@ -294,10 +301,10 @@ test("WPT test idbcursor_advance_index9.htm", async (t) => { var rq = objStore.index("index").openCursor(); rq.onsuccess = function (event: any) { var cursor = event.target.result; - t.true(cursor instanceof BridgeIDBCursor, "cursor exist"); + assert.ok(cursor instanceof BridgeIDBCursor, "cursor exist"); db.deleteObjectStore("store"); - t.throws( + assert.throws( () => { cursor.advance(1); }, diff --git a/packages/idb-bridge/src/idb-wpt-ported/idbcursor-continue-index.test.ts b/packages/idb-bridge/src/idb-wpt-ported/idbcursor-continue-index.test.ts @@ -1,12 +1,13 @@ -import test from "ava"; +import { test, before } from "node:test"; +import assert from "node:assert"; import { BridgeIDBCursor, BridgeIDBCursorWithValue } from "../bridge-idb.js"; import { createdb, initTestIndexedDB } from "./wptsupport.js"; import { IDBDatabase } from "../idbtypes.js"; -test.before("test DB initialization", initTestIndexedDB); +before(initTestIndexedDB); test("WPT test idbcursor_continue_index.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db: any; let count = 0; const records = [ @@ -35,14 +36,14 @@ test("WPT test idbcursor_continue_index.htm", (t) => { cursor_rq.onsuccess = function (e: any) { var cursor = e.target.result; if (!cursor) { - t.deepEqual(count, records.length, "cursor run count"); + assert.deepStrictEqual(count, records.length, "cursor run count"); resolve(); return; } - var record = cursor.value; - t.deepEqual(record.pKey, records[count].pKey, "primary key"); - t.deepEqual(record.iKey, records[count].iKey, "index key"); + var record = (cursor as any).value; + assert.deepStrictEqual(record.pKey, records[count].pKey, "primary key"); + assert.deepStrictEqual(record.iKey, records[count].iKey, "index key"); cursor.continue(); count++; @@ -53,7 +54,7 @@ test("WPT test idbcursor_continue_index.htm", (t) => { // IDBCursor.continue() - index - attempt to pass a key parameter that is not a valid key test("WPT idbcursor-continue-index2.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db: any; let records = [ { pKey: "primaryKey_0", iKey: "indexKey_0" }, @@ -80,14 +81,14 @@ test("WPT idbcursor-continue-index2.htm", (t) => { cursor_rq.onsuccess = function (e: any) { var cursor = e.target.result; - t.throws( + assert.throws( () => { cursor.continue({ foo: "bar" }); }, { name: "DataError" }, ); - t.true(cursor instanceof BridgeIDBCursorWithValue, "cursor"); + assert.ok(cursor instanceof BridgeIDBCursorWithValue, "cursor"); resolve(); }; @@ -98,7 +99,7 @@ test("WPT idbcursor-continue-index2.htm", (t) => { // IDBCursor.continue() - index - attempt to iterate to the previous // record when the direction is set for the next record test("WPT idbcursor-continue-index3.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db: any; const records = [ { pKey: "primaryKey_0", iKey: "indexKey_0" }, @@ -126,13 +127,13 @@ test("WPT idbcursor-continue-index3.htm", (t) => { cursor_rq.onsuccess = function (e: any) { var cursor = e.target.result; if (!cursor) { - t.deepEqual(count, 2, "ran number of times"); + assert.deepStrictEqual(count, 2, "ran number of times"); resolve(); return; } // First time checks key equal, second time checks key less than - t.throws( + assert.throws( () => { cursor.continue(records[0].iKey); }, @@ -150,7 +151,7 @@ test("WPT idbcursor-continue-index3.htm", (t) => { // IDBCursor.continue() - index - attempt to iterate to the next // record when the direction is set for the previous record test("WPT idbcursor-continue-index4.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db: any; const records = [ { pKey: "primaryKey_0", iKey: "indexKey_0" }, @@ -178,19 +179,19 @@ test("WPT idbcursor-continue-index4.htm", (t) => { cursor_rq.onsuccess = function (e: any) { var cursor = e.target.result, - record = cursor.value; + record = (cursor as any).value; switch (count) { case 0: - t.deepEqual(record.pKey, records[2].pKey, "first pKey"); - t.deepEqual(record.iKey, records[2].iKey, "first iKey"); + assert.deepStrictEqual(record.pKey, records[2].pKey, "first pKey"); + assert.deepStrictEqual(record.iKey, records[2].iKey, "first iKey"); cursor.continue(); break; case 1: - t.deepEqual(record.pKey, records[1].pKey, "second pKey"); - t.deepEqual(record.iKey, records[1].iKey, "second iKey"); - t.throws( + assert.deepStrictEqual(record.pKey, records[1].pKey, "second pKey"); + assert.deepStrictEqual(record.iKey, records[1].iKey, "second iKey"); + assert.throws( () => { cursor.continue("indexKey_2"); }, @@ -200,7 +201,7 @@ test("WPT idbcursor-continue-index4.htm", (t) => { break; default: - t.fail("Unexpected count value: " + count); + assert.fail("Unexpected count value: " + count); } count++; @@ -211,7 +212,7 @@ test("WPT idbcursor-continue-index4.htm", (t) => { // IDBCursor.continue() - index - iterate using 'prevunique' test("WPT idbcursor-continue-index5.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db: IDBDatabase; const records = [ { pKey: "primaryKey_0", iKey: "indexKey_0" }, @@ -245,17 +246,29 @@ test("WPT idbcursor-continue-index5.htm", (t) => { cursor_rq.onsuccess = function (e: any) { if (!e.target.result) { - t.deepEqual(count, expected.length, "count"); + assert.deepStrictEqual(count, expected.length, "count"); resolve(); return; } const cursor = e.target.result; - const record = cursor.value; - t.deepEqual(record.pKey, expected[count].pKey, "pKey #" + count); - t.deepEqual(record.iKey, expected[count].iKey, "iKey #" + count); + const record = (cursor as any).value; + assert.deepStrictEqual( + record.pKey, + expected[count].pKey, + "pKey #" + count, + ); + assert.deepStrictEqual( + record.iKey, + expected[count].iKey, + "iKey #" + count, + ); - t.deepEqual(cursor.key, expected[count].iKey, "cursor.key #" + count); - t.deepEqual( + assert.deepStrictEqual( + cursor.key, + expected[count].iKey, + "cursor.key #" + count, + ); + assert.deepStrictEqual( cursor.primaryKey, expected[count].pKey, "cursor.primaryKey #" + count, @@ -270,7 +283,7 @@ test("WPT idbcursor-continue-index5.htm", (t) => { // IDBCursor.continue() - index - iterate using nextunique test("WPT idbcursor-continue-index6.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db: any; const records = [ { pKey: "primaryKey_0", iKey: "indexKey_0" }, @@ -304,18 +317,30 @@ test("WPT idbcursor-continue-index6.htm", (t) => { cursor_rq.onsuccess = function (e: any) { if (!e.target.result) { - t.deepEqual(count, expected.length, "count"); + assert.deepStrictEqual(count, expected.length, "count"); resolve(); return; } var cursor = e.target.result, - record = cursor.value; + record = (cursor as any).value; - t.deepEqual(record.pKey, expected[count].pKey, "pKey #" + count); - t.deepEqual(record.iKey, expected[count].iKey, "iKey #" + count); + assert.deepStrictEqual( + record.pKey, + expected[count].pKey, + "pKey #" + count, + ); + assert.deepStrictEqual( + record.iKey, + expected[count].iKey, + "iKey #" + count, + ); - t.deepEqual(cursor.key, expected[count].iKey, "cursor.key #" + count); - t.deepEqual( + assert.deepStrictEqual( + cursor.key, + expected[count].iKey, + "cursor.key #" + count, + ); + assert.deepStrictEqual( cursor.primaryKey, expected[count].pKey, "cursor.primaryKey #" + count, @@ -330,7 +355,7 @@ test("WPT idbcursor-continue-index6.htm", (t) => { // IDBCursor.continue() - index - throw TransactionInactiveError test("WPT idbcursor-continue-index7.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db: any, records = [ { pKey: "primaryKey_0", iKey: "indexKey_0" }, @@ -348,10 +373,10 @@ test("WPT idbcursor-continue-index7.htm", (t) => { var rq = objStore.index("index").openCursor(); rq.onsuccess = function (event: any) { var cursor = event.target.result; - t.true(cursor instanceof BridgeIDBCursor); + assert.ok(cursor instanceof BridgeIDBCursor); event.target.transaction.abort(); - t.throws( + assert.throws( () => { cursor.continue(); }, @@ -367,7 +392,7 @@ test("WPT idbcursor-continue-index7.htm", (t) => { // IDBCursor.continue() - index - throw InvalidStateError caused by object store been deleted test("WPT idbcursor-continue-index8.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db: any, records = [ { pKey: "primaryKey_0", iKey: "indexKey_0" }, @@ -385,11 +410,11 @@ test("WPT idbcursor-continue-index8.htm", (t) => { var rq = objStore.index("index").openCursor(); rq.onsuccess = function (event: any) { var cursor = event.target.result; - t.true(cursor instanceof BridgeIDBCursor); + assert.ok(cursor instanceof BridgeIDBCursor); db.deleteObjectStore("store"); - t.throws( + assert.throws( () => { cursor.continue(); }, diff --git a/packages/idb-bridge/src/idb-wpt-ported/idbcursor-continue-objectstore.test.ts b/packages/idb-bridge/src/idb-wpt-ported/idbcursor-continue-objectstore.test.ts @@ -1,13 +1,14 @@ -import test from "ava"; +import { test, before } from "node:test"; +import assert from "node:assert"; import { BridgeIDBCursor } from "../bridge-idb.js"; import { IDBDatabase } from "../idbtypes.js"; import { createdb, initTestIndexedDB } from "./wptsupport.js"; -test.before("test DB initialization", initTestIndexedDB); +before(initTestIndexedDB); // IDBCursor.continue() - object store - iterate to the next record test("WPT test idbcursor_continue_objectstore.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db: any; let count = 0; const records = [{ pKey: "primaryKey_0" }, { pKey: "primaryKey_1" }]; @@ -30,13 +31,13 @@ test("WPT test idbcursor_continue_objectstore.htm", (t) => { cursor_rq.onsuccess = function (e: any) { var cursor = e.target.result; if (!cursor) { - t.deepEqual(count, records.length, "cursor run count"); + assert.deepStrictEqual(count, records.length, "cursor run count"); resolve(); return; } - var record = cursor.value; - t.deepEqual(record.pKey, records[count].pKey, "primary key"); + var record = (cursor as any).value; + assert.deepStrictEqual(record.pKey, records[count].pKey, "primary key"); cursor.continue(); count++; @@ -48,7 +49,7 @@ test("WPT test idbcursor_continue_objectstore.htm", (t) => { // IDBCursor.continue() - index - attempt to pass a // key parameter that is not a valid key test("WPT test idbcursor_continue_objectstore2.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db: any; const records = [{ pKey: "primaryKey_0" }, { pKey: "primaryKey_1" }]; @@ -66,8 +67,8 @@ test("WPT test idbcursor_continue_objectstore2.htm", (t) => { cursor_rq.onsuccess = function (e: any) { var cursor = e.target.result; - t.true(cursor instanceof BridgeIDBCursor, "cursor exists"); - t.throws( + assert.ok(cursor instanceof BridgeIDBCursor, "cursor exists"); + assert.throws( () => { cursor.continue({ foo: "42" }); }, @@ -83,7 +84,7 @@ test("WPT test idbcursor_continue_objectstore2.htm", (t) => { // IDBCursor.continue() - object store - attempt to iterate to the // previous record when the direction is set for the next record test("WPT test idbcursor_continue_objectstore3.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db: IDBDatabase; const records = [{ pKey: "primaryKey_0" }, { pKey: "primaryKey_1" }]; @@ -104,8 +105,8 @@ test("WPT test idbcursor_continue_objectstore3.htm", (t) => { cursor_rq.onsuccess = function (e: any) { var cursor = e.target.result; - t.true(cursor instanceof BridgeIDBCursor, "cursor exist"); - t.throws( + assert.ok(cursor instanceof BridgeIDBCursor, "cursor exist"); + assert.throws( () => { cursor.continue(records[0].pKey); }, @@ -123,7 +124,7 @@ test("WPT test idbcursor_continue_objectstore3.htm", (t) => { // IDBCursor.continue() - object store - attempt to iterate to the // next record when the direction is set for the previous record test("WPT test idbcursor_continue_objectstore4.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db: any; const records = [ { pKey: "primaryKey_0" }, @@ -149,12 +150,12 @@ test("WPT test idbcursor_continue_objectstore4.htm", (t) => { cursor_rq.onsuccess = function (e: any) { var cursor = e.target.result; - t.true(cursor != null, "cursor exist"); + assert.ok(cursor != null, "cursor exist"); switch (count) { case 0: - t.deepEqual( - cursor.value.pKey, + assert.deepStrictEqual( + (cursor as any).value.pKey, records[2].pKey, "first cursor pkey", ); @@ -162,12 +163,12 @@ test("WPT test idbcursor_continue_objectstore4.htm", (t) => { break; case 1: - t.deepEqual( - cursor.value.pKey, + assert.deepStrictEqual( + (cursor as any).value.pKey, records[1].pKey, "second cursor pkey", ); - t.throws( + assert.throws( () => { console.log("**** continuing cursor"); cursor.continue(records[2].pKey); @@ -181,7 +182,7 @@ test("WPT test idbcursor_continue_objectstore4.htm", (t) => { return; default: - t.fail("Unexpected count value: " + count); + assert.fail("Unexpected count value: " + count); } count++; @@ -192,7 +193,7 @@ test("WPT test idbcursor_continue_objectstore4.htm", (t) => { // IDBCursor.continue() - object store - throw TransactionInactiveError test("WPT test idbcursor_continue_objectstore5.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db: any; const records = [{ pKey: "primaryKey_0" }, { pKey: "primaryKey_1" }]; @@ -209,10 +210,10 @@ test("WPT test idbcursor_continue_objectstore5.htm", (t) => { cursor_rq.onsuccess = function (e: any) { var cursor = e.target.result; - t.true(cursor instanceof BridgeIDBCursor, "cursor exists"); + assert.ok(cursor instanceof BridgeIDBCursor, "cursor exists"); e.target.transaction.abort(); - t.throws( + assert.throws( () => { cursor.continue(); }, @@ -231,7 +232,7 @@ test("WPT test idbcursor_continue_objectstore5.htm", (t) => { // IDBCursor.continue() - object store - throw InvalidStateError caused by object store been deleted test("WPT test idbcursor_continue_objectstore6.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db: any; const records = [{ pKey: "primaryKey_0" }, { pKey: "primaryKey_1" }]; @@ -246,10 +247,10 @@ test("WPT test idbcursor_continue_objectstore6.htm", (t) => { cursor_rq.onsuccess = function (e: any) { var cursor = e.target.result; - t.true(cursor instanceof BridgeIDBCursor, "cursor exists"); + assert.ok(cursor instanceof BridgeIDBCursor, "cursor exists"); db.deleteObjectStore("test"); - t.throws( + assert.throws( () => { cursor.continue(); }, diff --git a/packages/idb-bridge/src/idb-wpt-ported/idbcursor-delete-exception-order.test.ts b/packages/idb-bridge/src/idb-wpt-ported/idbcursor-delete-exception-order.test.ts @@ -1,7 +1,8 @@ -import test from "ava"; +import { test, before } from "node:test"; +import assert from "node:assert"; import { indexeddb_test, initTestIndexedDB } from "./wptsupport.js"; -test.before("test DB initialization", initTestIndexedDB); +before(initTestIndexedDB); test("WPT idbcursor-delete-exception-order.htm", async (t) => { // 'IDBCursor.delete exception order: TransactionInactiveError vs. ReadOnlyError' @@ -18,8 +19,8 @@ test("WPT idbcursor-delete-exception-order.htm", async (t) => { r.onsuccess = null; setTimeout(() => { const cursor = r.result; - t.assert(!!cursor); - t.throws( + assert.ok(!!cursor); + assert.throws( () => { cursor!.delete(); }, @@ -45,9 +46,9 @@ test("WPT idbcursor-delete-exception-order.htm", async (t) => { r.onsuccess = () => { r.onsuccess = null; const cursor = r.result!; - t.assert(cursor); + assert.ok(cursor); cursor.continue(); - t.throws( + assert.throws( () => { cursor.delete(); }, @@ -74,7 +75,7 @@ test("WPT idbcursor-delete-exception-order.htm", async (t) => { r.onsuccess = () => { r.onsuccess = null; const cursor = r.result; - t.throws( + assert.throws( () => { cursor!.delete(); }, diff --git a/packages/idb-bridge/src/idb-wpt-ported/idbcursor-delete-index.test.ts b/packages/idb-bridge/src/idb-wpt-ported/idbcursor-delete-index.test.ts @@ -1,13 +1,14 @@ -import test from "ava"; +import { test, before } from "node:test"; +import assert from "node:assert"; import { BridgeIDBCursor } from "../bridge-idb.js"; import { IDBCursor } from "../idbtypes.js"; import { createdb, initTestIndexedDB } from "./wptsupport.js"; -test.before("test DB initialization", initTestIndexedDB); +before(initTestIndexedDB); // IDBCursor.delete() - index - remove a record from the object store test("WPT idbcursor-delete-index.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db: any; let count = 0, records = [ @@ -34,7 +35,7 @@ test("WPT idbcursor-delete-index.htm", (t) => { cursor_rq.onsuccess = function (e: any) { var cursor = e.target.result; - t.true(cursor instanceof BridgeIDBCursor, "cursor exist"); + assert.ok(cursor instanceof BridgeIDBCursor, "cursor exist"); cursor.delete(); }; @@ -48,13 +49,13 @@ test("WPT idbcursor-delete-index.htm", (t) => { var cursor = e.target.result; if (!cursor) { - t.deepEqual(count, 1, "count"); + assert.deepStrictEqual(count, 1, "count"); resolve(); return; } - t.deepEqual(cursor.value.pKey, records[1].pKey); - t.deepEqual(cursor.value.iKey, records[1].iKey); + assert.deepStrictEqual((cursor as any).value.pKey, records[1].pKey); + assert.deepStrictEqual((cursor as any).value.iKey, records[1].iKey); cursor.continue(); count++; }; @@ -64,7 +65,7 @@ test("WPT idbcursor-delete-index.htm", (t) => { // IDBCursor.delete() - object store - attempt to remove a record in a read-only transaction test("WPT idbcursor-delete-index2.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db: any, records = [ { pKey: "primaryKey_0", iKey: "indexKey_0" }, @@ -86,8 +87,8 @@ test("WPT idbcursor-delete-index2.htm", (t) => { cursor_rq.onsuccess = function (e: any) { var cursor = e.target.result; - t.true(cursor != null, "cursor exist"); - t.throws( + assert.ok(cursor != null, "cursor exist"); + assert.throws( () => { cursor.delete(); }, @@ -103,7 +104,7 @@ test("WPT idbcursor-delete-index2.htm", (t) => { // IDBCursor.delete() - index - attempt to remove a record in an inactive transaction test("WPT idbcursor-delete-index3.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db: any, records = [ { pKey: "primaryKey_0", iKey: "indexKey_0" }, @@ -124,12 +125,12 @@ test("WPT idbcursor-delete-index3.htm", (t) => { cursor_rq.onsuccess = function (e: any) { var cursor = e.target.result; - t.true(cursor instanceof BridgeIDBCursor, "cursor exist"); + assert.ok(cursor instanceof BridgeIDBCursor, "cursor exist"); myCursor = cursor; }; e.target.transaction.oncomplete = function (e: any) { - t.throws( + assert.throws( () => { myCursor!.delete(); }, @@ -143,7 +144,7 @@ test("WPT idbcursor-delete-index3.htm", (t) => { // IDBCursor.delete() - index - throw InvalidStateError caused by object store been deleted test("WPT idbcursor-delete-index4.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db: any, records = [ { pKey: "primaryKey_0", iKey: "indexKey_0" }, @@ -161,10 +162,10 @@ test("WPT idbcursor-delete-index4.htm", (t) => { var rq = objStore.index("index").openCursor(); rq.onsuccess = function (event: any) { var cursor = event.target.result; - t.true(cursor instanceof BridgeIDBCursor, "cursor exist"); + assert.ok(cursor instanceof BridgeIDBCursor, "cursor exist"); db.deleteObjectStore("store"); - t.throws( + assert.throws( function () { cursor.delete(); }, @@ -180,7 +181,7 @@ test("WPT idbcursor-delete-index4.htm", (t) => { // IDBCursor.delete() - index - throw InvalidStateError when the cursor is being iterated test("WPT idbcursor-delete-index5.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db: any, records = [ { pKey: "primaryKey_0", iKey: "indexKey_0" }, @@ -199,10 +200,10 @@ test("WPT idbcursor-delete-index5.htm", (t) => { var rq = objStore.index("index").openCursor(); rq.onsuccess = function (event: any) { var cursor = event.target.result; - t.true(cursor instanceof BridgeIDBCursor, "cursor exist"); + assert.ok(cursor instanceof BridgeIDBCursor, "cursor exist"); cursor.continue(); - t.throws( + assert.throws( function () { cursor.delete(); }, diff --git a/packages/idb-bridge/src/idb-wpt-ported/idbcursor-delete-objectstore.test.ts b/packages/idb-bridge/src/idb-wpt-ported/idbcursor-delete-objectstore.test.ts @@ -1,206 +1,194 @@ -import test from "ava"; -import { BridgeIDBCursor } from "../bridge-idb.js"; +/* + Copyright 2012 Google Inc. + Copyright 2020 Florian Dold + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + or implied. See the License for the specific language governing + permissions and limitations under the License. + */ + +import { test, before } from "node:test"; +import assert from "node:assert"; import { createdb, initTestIndexedDB } from "./wptsupport.js"; -test.before("test DB initialization", initTestIndexedDB); +before(initTestIndexedDB); -// IDBCursor.delete() - object store - remove a record from the object store test("WPT idbcursor-delete-objectstore.htm", (t) => { - return new Promise((resolve, reject) => { - var db: any, - count = 0, - records = [{ pKey: "primaryKey_0" }, { pKey: "primaryKey_1" }]; - + return new Promise<void>((resolve, reject) => { + var db: any; var open_rq = createdb(t); + open_rq.onupgradeneeded = function (e: any) { db = e.target.result; - var objStore = db.createObjectStore("test", { keyPath: "pKey" }); - - for (var i = 0; i < records.length; i++) objStore.add(records[i]); - }; - - open_rq.onsuccess = CursorDeleteRecord; - - function CursorDeleteRecord(e: any) { - var txn = db.transaction("test", "readwrite"), - cursor_rq = txn.objectStore("test").openCursor(); - - cursor_rq.onsuccess = function (e: any) { - var cursor = e.target.result; - - t.true(cursor != null, "cursor exist"); - cursor.delete(); - }; - - txn.oncomplete = VerifyRecordWasDeleted; - } - - function VerifyRecordWasDeleted(e: any) { - var cursor_rq = db.transaction("test").objectStore("test").openCursor(); - - cursor_rq.onsuccess = function (e: any) { + objStore.add({ pKey: "primaryKey_0" }); + objStore.add({ pKey: "primaryKey_1" }); + var rq = objStore.openCursor(); + rq.onsuccess = function (e: any) { var cursor = e.target.result; + assert.ok(cursor); - if (!cursor) { - t.deepEqual(count, 1, "count"); - resolve(); - return; - } - - t.deepEqual(cursor.value.pKey, records[1].pKey); - count++; - cursor.continue(); + db.deleteObjectStore("test"); + assert.throws( + function () { + cursor.delete(); + }, + { name: "InvalidStateError" }, + "If the cursor's source or effective object store has been deleted, the implementation MUST throw a DOMException of type InvalidStateError", + ); }; - } + }; + open_rq.onsuccess = () => resolve(); + open_rq.onerror = () => reject(open_rq.error); }); }); -// IDBCursor.delete() - object store - attempt to remove a record in a read-only transaction test("WPT idbcursor-delete-objectstore2.htm", (t) => { - return new Promise((resolve, reject) => { - var db: any, - records = [ - { pKey: "primaryKey_0", iKey: "indexKey_0" }, - { pKey: "primaryKey_1", iKey: "indexKey_1" }, - ]; - + return new Promise<void>((resolve, reject) => { + var db: any; var open_rq = createdb(t); + open_rq.onupgradeneeded = function (e: any) { db = e.target.result; - var objStore = db.createObjectStore("test", { keyPath: "pKey" }); - - for (var i = 0; i < records.length; i++) objStore.add(records[i]); + objStore.add({ pKey: "primaryKey_0" }); + objStore.add({ pKey: "primaryKey_1" }); }; open_rq.onsuccess = function (e: any) { - var cursor_rq = db.transaction("test").objectStore("test").openCursor(); + var tx = db.transaction("test", "readwrite"); + var objStore = tx.objectStore("test"); + var rq = objStore.openCursor(); - cursor_rq.onsuccess = function (e: any) { + rq.onsuccess = function (e: any) { var cursor = e.target.result; + assert.ok(cursor); - t.true(cursor != null, "cursor exist"); - t.throws( + tx.abort(); + assert.throws( function () { cursor.delete(); }, - { name: "ReadOnlyError" }, + { name: "TransactionInactiveError" }, + "TransactionInactiveError", ); resolve(); }; }; + open_rq.onerror = () => reject(open_rq.error); }); }); -// IDBCursor.delete() - index - attempt to remove a record in an inactive transaction test("WPT idbcursor-delete-objectstore3.htm", (t) => { - return new Promise((resolve, reject) => { - var db: any, - records = [ - { pKey: "primaryKey_0", iKey: "indexKey_0" }, - { pKey: "primaryKey_1", iKey: "indexKey_1" }, - ]; - + return new Promise<void>((resolve, reject) => { + var db: any; var open_rq = createdb(t); + open_rq.onupgradeneeded = function (e: any) { db = e.target.result; var objStore = db.createObjectStore("test", { keyPath: "pKey" }); + objStore.add({ pKey: "primaryKey_0" }); + objStore.add({ pKey: "primaryKey_1" }); + }; - for (var i = 0; i < records.length; i++) objStore.add(records[i]); - - var cursor_rq = objStore.openCursor(); - - const window: any = {}; + open_rq.onsuccess = function (e: any) { + var objStore = db.transaction("test", "readonly").objectStore("test"); + var rq = objStore.openCursor(); - cursor_rq.onsuccess = function (e: any) { + rq.onsuccess = function (e: any) { var cursor = e.target.result; - t.true(cursor instanceof BridgeIDBCursor, "cursor exist"); - window.cursor = cursor; - }; + assert.ok(cursor); - e.target.transaction.oncomplete = function (e: any) { - t.throws( + assert.throws( function () { - window.cursor.delete(); - }, - { - name: "TransactionInactiveError", + cursor.delete(); }, + { name: "ReadOnlyError" }, + "ReadOnlyError", ); resolve(); }; }; + open_rq.onerror = () => reject(open_rq.error); }); }); -// IDBCursor.delete() - object store - throw InvalidStateError caused by object store been deleted test("WPT idbcursor-delete-objectstore4.htm", (t) => { - return new Promise((resolve, reject) => { - var db: any, - records = [{ pKey: "primaryKey_0" }, { pKey: "primaryKey_1" }]; - + return new Promise<void>((resolve, reject) => { + var db: any; var open_rq = createdb(t); - open_rq.onupgradeneeded = function (event: any) { - db = event.target.result; - var objStore = db.createObjectStore("store", { keyPath: "pKey" }); - for (var i = 0; i < records.length; i++) { - objStore.add(records[i]); - } + + open_rq.onupgradeneeded = function (e: any) { + db = e.target.result; + var objStore = db.createObjectStore("test", { keyPath: "pKey" }); + objStore.add({ pKey: "primaryKey_0" }); + objStore.add({ pKey: "primaryKey_1" }); + }; + + open_rq.onsuccess = function (e: any) { + var objStore = db.transaction("test", "readwrite").objectStore("test"); var rq = objStore.openCursor(); - rq.onsuccess = function (event: any) { - var cursor = event.target.result; - t.true(cursor instanceof BridgeIDBCursor, "cursor exist"); - db.deleteObjectStore("store"); - t.throws( + rq.onsuccess = function (e: any) { + var cursor = e.target.result; + assert.ok(cursor); + + cursor.continue(); + assert.throws( function () { cursor.delete(); }, { name: "InvalidStateError" }, - "If the cursor's source or effective object store has been deleted, the implementation MUST throw a DOMException of type InvalidStateError", + "InvalidStateError", ); - resolve(); }; }; + open_rq.onerror = () => reject(open_rq.error); }); }); -// IDBCursor.delete() - object store - throw InvalidStateError when the cursor is being iterated test("WPT idbcursor-delete-objectstore5.htm", (t) => { - return new Promise((resolve, reject) => { - var db: any, - records = [{ pKey: "primaryKey_0" }, { pKey: "primaryKey_1" }]; - + return new Promise<void>((resolve, reject) => { + var db: any; var open_rq = createdb(t); - open_rq.onupgradeneeded = function (event: any) { - db = event.target.result; - var objStore = db.createObjectStore("store", { keyPath: "pKey" }); - for (var i = 0; i < records.length; i++) { - objStore.add(records[i]); - } + + open_rq.onupgradeneeded = function (e: any) { + db = e.target.result; + var objStore = db.createObjectStore("test", { keyPath: "pKey" }); + objStore.add({ pKey: "primaryKey_0" }); + objStore.add({ pKey: "primaryKey_1" }); }; - open_rq.onsuccess = function (event: any) { - var txn = db.transaction("store", "readwrite"); - var rq = txn.objectStore("store").openCursor(); - rq.onsuccess = function (event: any) { - var cursor = event.target.result; - t.true(cursor instanceof BridgeIDBCursor, "cursor exist"); + open_rq.onsuccess = function (e: any) { + var objStore = db.transaction("test", "readwrite").objectStore("test"); + var rq = objStore.openCursor(); - cursor.continue(); - t.throws( - function () { - cursor.delete(); - }, - { - name: "InvalidStateError", - }, - ); + rq.onsuccess = function (e: any) { + var cursor = e.target.result; + assert.ok(cursor); - resolve(); + cursor.continue(); + setTimeout(function () { + assert.throws( + function () { + cursor.delete(); + }, + { name: "TransactionInactiveError" }, + "TransactionInactiveError", + ); + resolve(); + }, 0); }; }; + open_rq.onerror = () => reject(open_rq.error); }); }); diff --git a/packages/idb-bridge/src/idb-wpt-ported/idbcursor-reused.test.ts b/packages/idb-bridge/src/idb-wpt-ported/idbcursor-reused.test.ts @@ -1,7 +1,8 @@ -import test from "ava"; +import { test, before } from "node:test"; +import assert from "node:assert"; import { createdb, initTestIndexedDB } from "./wptsupport.js"; -test.before("test DB initialization", initTestIndexedDB); +before(initTestIndexedDB); test("WPT idbcursor-reused.htm", async (t) => { await new Promise<void>((resolve, reject) => { @@ -26,7 +27,11 @@ test("WPT idbcursor-reused.htm", async (t) => { case 0: cursor = e.target.result; - t.deepEqual(cursor.value, "data", "prerequisite cursor.value"); + assert.deepStrictEqual( + (cursor as any).value, + "data", + "prerequisite (cursor as any).value", + ); cursor.custom_cursor_value = 1; e.target.custom_request_value = 2; @@ -34,9 +39,17 @@ test("WPT idbcursor-reused.htm", async (t) => { break; case 1: - t.deepEqual(cursor.value, "data2", "prerequisite cursor.value"); - t.deepEqual(cursor.custom_cursor_value, 1, "custom cursor value"); - t.deepEqual( + assert.deepStrictEqual( + (cursor as any).value, + "data2", + "prerequisite (cursor as any).value", + ); + assert.deepStrictEqual( + cursor.custom_cursor_value, + 1, + "custom cursor value", + ); + assert.deepStrictEqual( e.target.custom_request_value, 2, "custom request value", @@ -46,9 +59,13 @@ test("WPT idbcursor-reused.htm", async (t) => { break; case 2: - t.false(!!e.target.result, "got cursor"); - t.deepEqual(cursor.custom_cursor_value, 1, "custom cursor value"); - t.deepEqual( + assert.strictEqual(!!e.target.result, false, "got cursor"); + assert.deepStrictEqual( + cursor.custom_cursor_value, + 1, + "custom cursor value", + ); + assert.deepStrictEqual( e.target.custom_request_value, 2, "custom request value", @@ -59,13 +76,13 @@ test("WPT idbcursor-reused.htm", async (t) => { }; rq.transaction.oncomplete = function () { - t.deepEqual(count, 3, "cursor callback runs"); - t.deepEqual( + assert.deepStrictEqual(count, 3, "cursor callback runs"); + assert.deepStrictEqual( rq.custom_request_value, 2, "variable placed on old IDBRequest", ); - t.deepEqual( + assert.deepStrictEqual( cursor.custom_cursor_value, 1, "custom cursor value (transaction.complete)", @@ -74,5 +91,4 @@ test("WPT idbcursor-reused.htm", async (t) => { }; }; }); - t.pass(); }); diff --git a/packages/idb-bridge/src/idb-wpt-ported/idbcursor-update-index.test.ts b/packages/idb-bridge/src/idb-wpt-ported/idbcursor-update-index.test.ts @@ -1,149 +1,30 @@ -import test from "ava"; -import { BridgeIDBCursor, BridgeIDBKeyRange } from "../bridge-idb.js"; -import { - createDatabase, - createdb, - initTestIndexedDB, - promiseForRequest, - promiseForTransaction, -} from "./wptsupport.js"; - -test.before("test DB initialization", initTestIndexedDB); - -// IDBCursor.update() - index - modify a record in the object store -test("WPT test idbcursor_update_index.htm", (t) => { - return new Promise((resolve, reject) => { - var db: any, - records = [ - { pKey: "primaryKey_0", iKey: "indexKey_0" }, - { pKey: "primaryKey_1", iKey: "indexKey_1" }, - ]; +/* + Copyright 2012 Google Inc. + Copyright 2020 Florian Dold - var open_rq = createdb(t); - open_rq.onupgradeneeded = function (e: any) { - db = e.target.result; - - var objStore = db.createObjectStore("test", { keyPath: "pKey" }); - objStore.createIndex("index", "iKey"); + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at - for (var i = 0; i < records.length; i++) objStore.add(records[i]); - - // XXX: Gecko doesn't like this - //e.target.transaction.oncomplete = t.step_func(CursorUpdateRecord); - }; + http://www.apache.org/licenses/LICENSE-2.0 - open_rq.onsuccess = CursorUpdateRecord; + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + or implied. See the License for the specific language governing + permissions and limitations under the License. + */ - function CursorUpdateRecord(e: any) { - var txn = db.transaction("test", "readwrite"), - cursor_rq = txn.objectStore("test").index("index").openCursor(); - cursor_rq.onsuccess = function (e: any) { - var cursor = e.target.result; +import { test, before } from "node:test"; +import assert from "node:assert"; +import { createdb, initTestIndexedDB } from "./wptsupport.js"; +import { BridgeIDBCursor } from "../bridge-idb.js"; - cursor.value.iKey += "_updated"; - cursor.update(cursor.value); - }; +before(initTestIndexedDB); - txn.oncomplete = VerifyRecordWasUpdated; - } - - function VerifyRecordWasUpdated(e: any) { - var cursor_rq = db.transaction("test").objectStore("test").openCursor(); - - cursor_rq.onsuccess = function (e: any) { - var cursor = e.target.result; - - t.deepEqual(cursor.value.iKey, records[0].iKey + "_updated"); - resolve(); - }; - } - }); -}); - -// IDBCursor.update() - index - attempt to modify a record in a read-only transaction -test("WPT test idbcursor_update_index2.htm", (t) => { - return new Promise((resolve, reject) => { - var db: any, - records = [ - { pKey: "primaryKey_0", iKey: "indexKey_0" }, - { pKey: "primaryKey_1", iKey: "indexKey_1" }, - ]; - - var open_rq = createdb(t); - open_rq.onupgradeneeded = function (e: any) { - db = e.target.result; - - var objStore = db.createObjectStore("test", { keyPath: "pKey" }); - objStore.createIndex("index", "iKey"); - - for (var i = 0; i < records.length; i++) objStore.add(records[i]); - }; - - open_rq.onsuccess = function (e: any) { - var cursor_rq = db - .transaction("test") - .objectStore("test") - .index("index") - .openCursor(); - - cursor_rq.onsuccess = function (e: any) { - var cursor = e.target.result; - t.throws( - function () { - cursor.update(cursor.value); - }, - { name: "ReadOnlyError" }, - ); - resolve(); - }; - }; - }); -}); - -//IDBCursor.update() - index - attempt to modify a record in an inactive transaction -test("WPT test idbcursor_update_index3.htm", (t) => { - return new Promise((resolve, reject) => { - var db: any, - records = [ - { pKey: "primaryKey_0", iKey: "indexKey_0" }, - { pKey: "primaryKey_1", iKey: "indexKey_1" }, - ]; - - var open_rq = createdb(t); - open_rq.onupgradeneeded = function (e: any) { - db = e.target.result; - var objStore = db.createObjectStore("test", { keyPath: "pKey" }); - var index = objStore.createIndex("index", "iKey"); - - for (var i = 0; i < records.length; i++) objStore.add(records[i]); - - var cursor_rq = index.openCursor(); - - const window: any = {}; - - cursor_rq.onsuccess = function (e: any) { - var cursor = e.target.result; - t.true(cursor instanceof BridgeIDBCursor, "cursor exist"); - window.cursor = cursor; - window.record = cursor.value; - }; - - e.target.transaction.oncomplete = function (e: any) { - t.throws( - function () { - window.cursor.update(window.record); - }, - { name: "TransactionInactiveError" }, - ); - resolve(); - }; - }; - }); -}); - -// IDBCursor.update() - index - attempt to modify a record when object store been deleted -test("WPT test idbcursor_update_index4.htm", (t) => { - return new Promise((resolve, reject) => { +// IDBCursor.update() - index - throw InvalidStateError - the cursor's source or effective object store has been deleted +test("WPT test idbcursor_update_index6.htm", (t) => { + return new Promise<void>((resolve, reject) => { var db: any, records = [ { pKey: "primaryKey_0", iKey: "indexKey_0" }, @@ -152,36 +33,44 @@ test("WPT test idbcursor_update_index4.htm", (t) => { var open_rq = createdb(t); open_rq.onupgradeneeded = function (event: any) { - db = event.target.result; - var objStore = db.createObjectStore("store", { keyPath: "pKey" }); - objStore.createIndex("index", "iKey"); - for (var i = 0; i < records.length; i++) { - objStore.add(records[i]); + try { + db = event.target.result; + var objStore = db.createObjectStore("store", { keyPath: "pKey" }); + objStore.createIndex("index", "iKey"); + for (var i = 0; i < records.length; i++) { + objStore.add(records[i]); + } + var rq = objStore.index("index").openCursor(); + rq.onsuccess = function (event: any) { + try { + var cursor = event.target.result; + assert.ok(cursor instanceof BridgeIDBCursor); + + db.deleteObjectStore("store"); + (cursor as any).value.iKey += "_updated"; + assert.throws( + function () { + cursor.update((cursor as any).value); + }, + { name: "InvalidStateError" }, + "If the cursor's source or effective object store has been deleted, the implementation MUST throw a DOMException of type InvalidStateError", + ); + } catch (e) { + reject(e); + } + }; + } catch (e) { + reject(e); } - var rq = objStore.index("index").openCursor(); - rq.onsuccess = function (event: any) { - var cursor = event.target.result; - t.true(cursor instanceof BridgeIDBCursor); - - db.deleteObjectStore("store"); - cursor.value.iKey += "_updated"; - t.throws( - function () { - cursor.update(cursor.value); - }, - { name: "InvalidStateError" }, - "If the cursor's source or effective object store has been deleted, the implementation MUST throw a DOMException of type InvalidStateError", - ); - - resolve(); - }; }; + open_rq.onsuccess = () => resolve(); + open_rq.onerror = (e) => reject(open_rq.error); }); }); // IDBCursor.update() - index - throw DataCloneError test("WPT test idbcursor_update_index5.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db: any, records = [ { pKey: "primaryKey_0", iKey: "indexKey_0" }, @@ -190,43 +79,57 @@ test("WPT test idbcursor_update_index5.htm", (t) => { var open_rq = createdb(t); open_rq.onupgradeneeded = function (e: any) { - db = e.target.result; + try { + db = e.target.result; - var objStore = db.createObjectStore("test", { keyPath: "pKey" }); - objStore.createIndex("index", "iKey"); + var objStore = db.createObjectStore("test", { keyPath: "pKey" }); + objStore.createIndex("index", "iKey"); - for (var i = 0; i < records.length; i++) objStore.add(records[i]); + for (var i = 0; i < records.length; i++) objStore.add(records[i]); + } catch (err) { + reject(err); + } }; open_rq.onsuccess = function (e: any) { - var cursor_rq = db - .transaction("test", "readwrite") - .objectStore("test") - .index("index") - .openCursor(); - - cursor_rq.onsuccess = function (e: any) { - var cursor = e.target.result; - t.true(cursor instanceof BridgeIDBCursor); - - var record = cursor.value; - // Original test uses different uncloneable value - record.data = { foo: () => {} }; - t.throws( - function () { - cursor.update(record); - }, - { name: "DataCloneError" }, - ); - resolve(); - }; + try { + var store = db.transaction("test", "readwrite").objectStore("test"); + var rq = store.index("index").openCursor(); + + rq.onsuccess = function (e: any) { + try { + var cursor = e.target.result; + assert.ok( + cursor instanceof BridgeIDBCursor, + "cursor instanceof IDBCursor", + ); + + assert.throws( + function () { + var cyclic: any = {}; + cyclic.a = cyclic; + cursor.update(cyclic); + }, + { name: "DataCloneError" }, + "DataCloneError", + ); + + resolve(); + } catch (err) { + reject(err); + } + }; + } catch (err) { + reject(err); + } }; + open_rq.onerror = (e) => reject(open_rq.error); }); }); -// IDBCursor.update() - index - no argument -test("WPT test idbcursor_update_index6.htm", (t) => { - return new Promise((resolve, reject) => { +// IDBCursor.update() - index - throw TransactionInactiveError +test("WPT test idbcursor_update_index7.htm", (t) => { + return new Promise<void>((resolve, reject) => { var db: any, records = [ { pKey: "primaryKey_0", iKey: "indexKey_0" }, @@ -235,42 +138,56 @@ test("WPT test idbcursor_update_index6.htm", (t) => { var open_rq = createdb(t); open_rq.onupgradeneeded = function (e: any) { - db = e.target.result; - - var objStore = db.createObjectStore("test", { keyPath: "pKey" }); - objStore.createIndex("index", "iKey"); - - for (var i = 0; i < records.length; i++) objStore.add(records[i]); + try { + db = e.target.result; + var objStore = db.createObjectStore("test", { keyPath: "pKey" }); + objStore.createIndex("index", "iKey"); + + for (var i = 0; i < records.length; i++) objStore.add(records[i]); + } catch (err) { + reject(err); + } }; open_rq.onsuccess = function (e: any) { - var cursor_rq = db - .transaction("test") - .objectStore("test") - .index("index") - .openCursor(); - - cursor_rq.onsuccess = function (e: any) { - var cursor = e.target.result; - t.true(cursor instanceof BridgeIDBCursor); - - t.throws( - function () { - cursor.update(); - }, - { - instanceOf: TypeError, - }, - ); - resolve(); - }; + try { + var tx = db.transaction("test", "readwrite"); + var objStore = tx.objectStore("test"); + var rq = objStore.index("index").openCursor(); + + rq.onsuccess = function (e: any) { + try { + var cursor = e.target.result; + assert.ok( + cursor instanceof BridgeIDBCursor, + "cursor instanceof IDBCursor", + ); + + tx.abort(); + assert.throws( + function () { + cursor.update((cursor as any).value); + }, + { name: "TransactionInactiveError" }, + "TransactionInactiveError", + ); + + resolve(); + } catch (err) { + reject(err); + } + }; + } catch (err) { + reject(err); + } }; + open_rq.onerror = (e) => reject(open_rq.error); }); }); -// IDBCursor.update() - index - throw DataError -test("WPT test idbcursor_update_index7.htm", (t) => { - return new Promise((resolve, reject) => { +// IDBCursor.update() - index - throw ReadOnlyError +test("WPT test idbcursor_update_index8.htm", (t) => { + return new Promise<void>((resolve, reject) => { var db: any, records = [ { pKey: "primaryKey_0", iKey: "indexKey_0" }, @@ -279,40 +196,54 @@ test("WPT test idbcursor_update_index7.htm", (t) => { var open_rq = createdb(t); open_rq.onupgradeneeded = function (e: any) { - db = e.target.result; - - var objStore = db.createObjectStore("test", { keyPath: "pKey" }); - objStore.createIndex("index", "iKey"); - - for (var i = 0; i < records.length; i++) objStore.add(records[i]); + try { + db = e.target.result; + var objStore = db.createObjectStore("test", { keyPath: "pKey" }); + objStore.createIndex("index", "iKey"); + + for (var i = 0; i < records.length; i++) objStore.add(records[i]); + } catch (err) { + reject(err); + } }; open_rq.onsuccess = function (e: any) { - var cursor_rq = db - .transaction("test", "readwrite") - .objectStore("test") - .index("index") - .openCursor(); - - cursor_rq.onsuccess = function (e: any) { - var cursor = e.target.result; - t.true(cursor instanceof BridgeIDBCursor); - - t.throws( - function () { - cursor.update(null); - }, - { name: "DataError" }, - ); - resolve(); - }; + try { + var objStore = db.transaction("test", "readonly").objectStore("test"); + var rq = objStore.index("index").openCursor(); + + rq.onsuccess = function (e: any) { + try { + var cursor = e.target.result; + assert.ok( + cursor instanceof BridgeIDBCursor, + "cursor instanceof IDBCursor", + ); + + assert.throws( + function () { + cursor.update((cursor as any).value); + }, + { name: "ReadOnlyError" }, + "ReadOnlyError", + ); + + resolve(); + } catch (err) { + reject(err); + } + }; + } catch (err) { + reject(err); + } }; + open_rq.onerror = (e) => reject(open_rq.error); }); }); -// IDBCursor.update() - index - throw InvalidStateError when the cursor is being iterated -test("WPT test idbcursor_update_index8.htm", (t) => { - return new Promise((resolve, reject) => { +// IDBCursor.update() - index - throw DataError +test("WPT test idbcursor_update_index9.any.js", (t) => { + return new Promise<void>((resolve, reject) => { var db: any, records = [ { pKey: "primaryKey_0", iKey: "indexKey_0" }, @@ -321,83 +252,47 @@ test("WPT test idbcursor_update_index8.htm", (t) => { var open_rq = createdb(t); open_rq.onupgradeneeded = function (e: any) { - db = e.target.result; - - var objStore = db.createObjectStore("store", { keyPath: "pKey" }); - objStore.createIndex("index", "iKey"); - - for (var i = 0; i < records.length; i++) objStore.add(records[i]); + try { + db = e.target.result; + var objStore = db.createObjectStore("test", { keyPath: "pKey" }); + objStore.createIndex("index", "iKey"); + + for (var i = 0; i < records.length; i++) objStore.add(records[i]); + } catch (err) { + reject(err); + } }; open_rq.onsuccess = function (e: any) { - var cursor_rq = db - .transaction("store", "readwrite") - .objectStore("store") - .index("index") - .openCursor(); - - cursor_rq.onsuccess = function (e: any) { - var cursor = e.target.result; - t.true(cursor instanceof BridgeIDBCursor, "cursor exists"); - - cursor.continue(); - t.throws( - function () { - cursor.update({ pKey: "primaryKey_0", iKey: "indexKey_0_updated" }); - }, - { - name: "InvalidStateError", - }, - ); - - resolve(); - }; + try { + var objStore = db.transaction("test", "readwrite").objectStore("test"); + var rq = objStore.index("index").openCursor(); + + rq.onsuccess = function (e: any) { + try { + var cursor = e.target.result; + assert.ok( + cursor instanceof BridgeIDBCursor, + "cursor instanceof IDBCursor", + ); + + (cursor as any).value.pKey = "primaryKey_2"; + assert.throws( + function () { + cursor.update((cursor as any).value); + }, + { name: "DataError" }, + "DataError", + ); + resolve(); + } catch (err) { + reject(err); + } + }; + } catch (err) { + reject(err); + } }; + open_rq.onerror = (e) => reject(open_rq.error); }); }); - -// Index cursor - indexed values updated during iteration -test("WPT test idbcursor_update_index9.any.js", async (t) => { - const db = await createDatabase(t, (db) => { - const store = db.createObjectStore("store"); - store.createIndex("index", "value"); - store.put({ value: 1 }, 1); - store.put({ value: 2 }, 2); - store.put({ value: 3 }, 3); - }); - - { - // Iterate over all index entries until an upper bound is reached. - // On each record found, increment the value used as the index - // key, which will make it show again up later in the iteration. - const tx = db.transaction("store", "readwrite"); - const range = BridgeIDBKeyRange.upperBound(9); - const index = tx.objectStore("store").index("index"); - const request = index.openCursor(range); - request.onsuccess = (e: any) => { - const cursor = e.target.result; - if (!cursor) return; - - const record = cursor.value; - record.value += 1; - cursor.update(record); - - cursor.continue(); - }; - - await promiseForTransaction(t, tx); - } - - { - const tx = db.transaction("store", "readonly"); - const results = await promiseForRequest( - t, - tx.objectStore("store").getAll(), - ); - t.deepEqual( - results.map((record) => record.value), - [10, 10, 10], - "Values should all be incremented until bound reached", - ); - } -}); diff --git a/packages/idb-bridge/src/idb-wpt-ported/idbfactory-cmp.test.ts b/packages/idb-bridge/src/idb-wpt-ported/idbfactory-cmp.test.ts @@ -1,7 +1,8 @@ -import test from "ava"; +import { test, before } from "node:test"; +import assert from "node:assert"; import { initTestIndexedDB, useTestIndexedDb } from "./wptsupport.js"; -test.before("test DB initialization", initTestIndexedDB); +before(initTestIndexedDB); test("WPT idbfactory-cmp*.html", async (t) => { const indexedDB = useTestIndexedDb(); @@ -9,54 +10,51 @@ test("WPT idbfactory-cmp*.html", async (t) => { var equal = indexedDB.cmp(2, 2); var less = indexedDB.cmp(1, 2); - t.deepEqual(greater, 1, "greater"); - t.deepEqual(equal, 0, "equal"); - t.deepEqual(less, -1, "less"); + assert.deepStrictEqual(greater, 1, "greater"); + assert.deepStrictEqual(equal, 0, "equal"); + assert.deepStrictEqual(less, -1, "less"); - t.throws( - () => { - // @ts-expect-error - indexedDB.cmp(); - }, - { instanceOf: TypeError }, - ); + assert.throws(() => { + // @ts-expect-error + indexedDB.cmp(); + }, TypeError); - t.throws( + assert.throws( () => { indexedDB.cmp(null, null); }, { name: "DataError" }, ); - t.throws( + assert.throws( () => { indexedDB.cmp(1, null); }, { name: "DataError" }, ); - t.throws( + assert.throws( () => { indexedDB.cmp(null, 1); }, { name: "DataError" }, ); - t.throws( + assert.throws( () => { indexedDB.cmp(NaN, NaN); }, { name: "DataError" }, ); - t.throws( + assert.throws( () => { indexedDB.cmp(1, NaN); }, { name: "DataError" }, ); - t.throws( + assert.throws( () => { indexedDB.cmp(NaN, 1); }, diff --git a/packages/idb-bridge/src/idb-wpt-ported/idbfactory-open.test.ts b/packages/idb-bridge/src/idb-wpt-ported/idbfactory-open.test.ts @@ -1,545 +1,218 @@ -import test from "ava"; -import { BridgeIDBVersionChangeEvent } from "../bridge-idb.js"; -import FakeEvent from "../util/FakeEvent.js"; -import { - createdb, - format_value, - initTestIndexedDB, - useTestIndexedDb, -} from "./wptsupport.js"; -import { IDBDatabase } from "../idbtypes.js"; +/* + Copyright 2020 Florian Dold -test.before("test DB initialization", initTestIndexedDB); + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at -// IDBFactory.open() - request has no source -test("WPT idbfactory-open.htm", async (t) => { - await new Promise<void>((resolve, reject) => { - var open_rq = createdb(t, undefined, 9); + http://www.apache.org/licenses/LICENSE-2.0 - open_rq.onupgradeneeded = function (e: any) {}; - open_rq.onsuccess = function (e: any) { - t.deepEqual(e.target.source, null, "source"); - resolve(); - }; - }); - t.pass(); -}); + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + or implied. See the License for the specific language governing + permissions and limitations under the License. + */ -// IDBFactory.open() - database 'name' and 'version' are correctly set -test("WPT idbfactory-open2.htm", async (t) => { - await new Promise<void>((resolve, reject) => { - var database_name = t.title + "-database_name"; - var open_rq = createdb(t, database_name, 13); - - open_rq.onupgradeneeded = function (e: any) {}; - open_rq.onsuccess = function (e: any) { - var db = e.target.result; - t.deepEqual(db.name, database_name, "db.name"); - t.deepEqual(db.version, 13, "db.version"); - resolve(); - }; - }); - t.pass(); -}); - -// IDBFactory.open() - no version opens current database -test("WPT idbfactory-open3.htm", async (t) => { - const indexedDB = useTestIndexedDb(); - await new Promise<void>((resolve, reject) => { - var open_rq = createdb(t, undefined, 13); - var did_upgrade = false; - - open_rq.onupgradeneeded = function () {}; - open_rq.onsuccess = function (e: any) { - var db = e.target.result; - db.close(); - - var open_rq2 = indexedDB.open(db.name); - open_rq2.onsuccess = function (e: any) { - t.deepEqual(e.target.result.version, 13, "db.version"); - e.target.result.close(); - resolve(); - }; - open_rq2.onupgradeneeded = () => t.fail("Unexpected upgradeneeded"); - open_rq2.onerror = () => t.fail("Unexpected error"); - }; - }); - t.pass(); -}); - -// IDBFactory.open() - new database has default version -test("WPT idbfactory-open4.htm", async (t) => { - await new Promise<void>((resolve, reject) => { - var open_rq = createdb(t, t.title + "-database_name"); - - open_rq.onupgradeneeded = function (e: any) { - t.deepEqual(e.target.result.version, 1, "db.version"); - }; - open_rq.onsuccess = function (e: any) { - t.deepEqual(e.target.result.version, 1, "db.version"); - resolve(); - }; - }); - t.pass(); -}); - -// IDBFactory.open() - new database is empty -test("WPT idbfactory-open5.htm", async (t) => { - await new Promise<void>((resolve, reject) => { - var open_rq = createdb(t, t.title + "-database_name"); - - open_rq.onupgradeneeded = function () {}; - open_rq.onsuccess = function (e: any) { - t.deepEqual( - e.target.result.objectStoreNames.length, - 0, - "objectStoreNames.length", - ); - resolve(); - }; - }); - t.pass(); -}); - -// IDBFactory.open() - open database with a lower version than current -test("WPT idbfactory-open6.htm", async (t) => { - const indexedDB = useTestIndexedDb(); - await new Promise<void>((resolve, reject) => { - var open_rq = createdb(t, undefined, 13); - var open_rq2: any; - - open_rq.onupgradeneeded = function () {}; - open_rq.onsuccess = function (e: any) { - var db = e.target.result; - db.close(); +import { test, before } from "node:test"; +import assert from "node:assert"; +import { initTestIndexedDB, useTestIndexedDb } from "../testingdb.js"; - open_rq2 = indexedDB.open(db.name, 14); - open_rq2.onupgradeneeded = function () {}; - open_rq2.onsuccess = open_previous_db; - open_rq2.onerror = () => t.fail("Unexpected error"); - }; +let indexedDB: any; - function open_previous_db(e: any) { - t.log("opening previous DB"); - var open_rq3 = indexedDB.open(e.target.result.name, 13); - open_rq3.onerror = function (e: any) { - t.log("got open error"); - t.deepEqual(e.target.error.name, "VersionError", "e.target.error.name"); - open_rq2.result.close(); - resolve(); - }; - open_rq3.onupgradeneeded = () => t.fail("Unexpected upgradeneeded"); - open_rq3.onsuccess = () => t.fail("Unexpected success"); - } - }); - t.pass(); +before(async () => { + await initTestIndexedDB(); + indexedDB = useTestIndexedDb(); }); -// IDBFactory.open() - open database with a higher version than current -test("WPT idbfactory-open7.htm", async (t) => { - const indexedDB = useTestIndexedDb(); - await new Promise<void>((resolve, reject) => { - var open_rq = createdb(t, undefined, 13); - var did_upgrade = false; - var open_rq2: any; +// WPT: idbfactory_open.htm +// Note: This is a partial port of the WPT test. - open_rq.onupgradeneeded = function () {}; - open_rq.onsuccess = function (e: any) { - console.log("open7 - opening higher version DB"); - var db = e.target.result; - db.close(); +function format_value(v: any): string { + if (v === null) return "null"; + if (v === undefined) return "undefined"; + return v.toString(); +} - open_rq2 = indexedDB.open(db.name, 14); - open_rq2.onupgradeneeded = function () { - did_upgrade = true; - }; - open_rq2.onsuccess = open_current_db; - open_rq2.onerror = () => t.fail("Unexpected error"); - }; +test("WPT idbfactory_open.htm", async (t) => { + async function should_work(val: any, expected_version: number) { + var name = format_value(val); + var dbname = "test-db-does-not-exist"; - function open_current_db(e: any) { - console.log("open7 - opening current DB"); - const name = e.target.result.name; - console.log(`open7 - name is ${name}`); - var open_rq3 = indexedDB.open(name); - open_rq3.onsuccess = function (e: any) { - console.log("open7 - success opening current DB"); - t.deepEqual(e.target.result.version, 14, "db.version"); - open_rq2.result.close(); - open_rq3.result.close(); - resolve(); + await new Promise<void>((resolve, reject) => { + var del = indexedDB.deleteDatabase(dbname); + del.onsuccess = () => { + var rq = + val === undefined + ? indexedDB.open(dbname) + : indexedDB.open(dbname, val); + rq.onupgradeneeded = function (e: any) { + var db = rq.result; + assert.deepStrictEqual(db.version, expected_version, "version"); + rq!.transaction!.abort(); + }; + rq.onsuccess = () => { + assert.fail("open should fail"); + }; + rq.onerror = (e: any) => { + e.preventDefault(); + resolve(); + }; }; - open_rq3.onupgradeneeded = () => t.fail("Unexpected upgradeneeded"); - open_rq3.onerror = () => t.fail("Unexpected error"); - - t.true(did_upgrade, "did upgrade"); - } - }); - t.pass(); -}); - -// IDBFactory.open() - error in version change transaction aborts open -test("WPT idbfactory-open8.htm", async (t) => { - const indexedDB = useTestIndexedDb(); - await new Promise<void>((resolve, reject) => { - var open_rq = createdb(t, undefined, 13); - var did_upgrade = false; - var did_db_abort = false; + del.onerror = () => reject(del.error); + }); + } - open_rq.onupgradeneeded = function (e: any) { - did_upgrade = true; - e.target.result.onabort = function () { - did_db_abort = true; - }; - e.target.transaction.abort(); - }; - open_rq.onerror = function (e: any) { - t.true(did_upgrade); - t.deepEqual(e.target.error.name, "AbortError", "target.error"); - resolve(); - }; - }); - t.pass(); -}); + await should_work(undefined, 1); + await should_work(1, 1); + await should_work(1.5, 1); + await should_work(2, 2); + await should_work(2.5, 2); + await should_work(Math.pow(2, 32), 4294967296); + await should_work(Math.pow(2, 53), 9007199254740992); -// IDBFactory.open() - errors in version argument -test("WPT idbfactory-open9.htm", async (t) => { - const indexedDB = useTestIndexedDb(); - function should_throw(val: any, name?: string) { - if (!name) { - name = typeof val == "object" && val ? "object" : format_value(val); - } - t.throws( - () => { - indexedDB.open("test", val); + function should_throw(val: any) { + var name = format_value(val); + assert.throws( + function () { + indexedDB.open("test-db-does-not-exist", val); }, - { instanceOf: TypeError }, + TypeError, "Calling open() with version argument " + name + " should throw TypeError.", ); } - should_throw(-1); - should_throw(-0.5); should_throw(0); - should_throw(0.5); - should_throw(0.8); - should_throw(0x20000000000000); // Number.MAX_SAFE_INTEGER + 1 + should_throw(-0.5); + should_throw(-1); should_throw(NaN); should_throw(Infinity); should_throw(-Infinity); should_throw("foo"); - should_throw(null); - should_throw(false); - - should_throw({ - toString: function () { - t.fail("toString should not be called for ToPrimitive [Number]"); - }, - valueOf: function () { - return 0; - }, - }); - should_throw( - { - toString: function () { - return 0; - }, - valueOf: function () { - return {}; - }, - }, - "object (second)", - ); - should_throw( - { - toString: function () { - return {}; - }, - valueOf: function () { - return {}; - }, - }, - "object (third)", - ); - - /* Valid */ - - async function should_work(val: any, expected_version: number) { - var name = format_value(val); - var dbname = "test-db-does-not-exist"; - - await t.notThrowsAsync( - async () => { - return new Promise<void>((resolve, reject) => { - indexedDB.deleteDatabase(dbname); - var rq = indexedDB.open(dbname, val); - rq.onupgradeneeded = function () { - var db = rq.result; - t.deepEqual(db.version, expected_version, "version"); - rq!.transaction!.abort(); - }; - rq.onsuccess = () => t.fail("open should fail"); - rq.onerror = () => resolve(); - }); - }, - "Calling open() with version argument " + name + " should not throw.", - ); - } - - await should_work(1.5, 1); - await should_work(Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER); // 0x20000000000000 - 1 - await should_work(undefined, 1); - - console.error("test at end"); }); -// IDBFactory.open() - error in version change transaction aborts open -test("WPT idbfactory-open10.htm", async (t) => { - const indexedDB = useTestIndexedDb(); - await new Promise<void>((resolve, reject) => { - var db: IDBDatabase, db2: IDBDatabase; - var open_rq = createdb(t, undefined, 9); - - open_rq.onupgradeneeded = function (e: any) { - db = e.target.result; - - var st = db.createObjectStore("store"); - st.createIndex("index", "i"); +test("WPT idbfactory_open.htm #2", async (t) => { + var database_name = "WPT-idbfactory_open-database_name"; - t.deepEqual(db.version, 9, "first db.version"); - t.true( - db.objectStoreNames.contains("store"), - "objectStoreNames contains store", - ); - t.true(st.indexNames.contains("index"), "indexNames contains index"); - - st.add({ i: "Joshua" }, 1); - st.add({ i: "Jonas" }, 2); - }; - open_rq.onsuccess = function (e: any) { + var open_rq = indexedDB.open(database_name); + open_rq.onupgradeneeded = function (e: any) { + var db = open_rq.result; + assert.strictEqual(db.name, database_name, "db.name"); + assert.strictEqual(db.version, 1, "db.version"); + db.createObjectStore("store"); + }; + await new Promise<void>((resolve, reject) => { + open_rq.onsuccess = (e: any) => { + var db = open_rq.result; + assert.strictEqual(db.name, database_name, "db.name"); + assert.strictEqual(db.version, 1, "db.version"); db.close(); - var open_rq2 = indexedDB.open(db.name, 10); - open_rq2.onupgradeneeded = function (e: any) { - db2 = e.target.result; - - db2.createObjectStore("store2"); - - var store = open_rq2.transaction!.objectStore("store"); - store.createIndex("index2", "i"); - - t.deepEqual(db2.version, 10, "db2.version"); - - t.true( - db2.objectStoreNames.contains("store"), - "second objectStoreNames contains store", - ); - t.true( - db2.objectStoreNames.contains("store2"), - "second objectStoreNames contains store2", - ); - t.true( - store.indexNames.contains("index"), - "second indexNames contains index", - ); - t.true( - store.indexNames.contains("index2"), - "second indexNames contains index2", - ); - - store.add({ i: "Odin" }, 3); - store.put({ i: "Sicking" }, 2); - - open_rq2.transaction!.abort(); - }; - open_rq2.onerror = function () { - t.deepEqual(db2.version, 9, "db2.version after error"); - t.true( - db2.objectStoreNames.contains("store"), - "objectStoreNames contains store after error", - ); - t.false( - db2.objectStoreNames.contains("store2"), - "objectStoreNames not contains store2 after error", - ); - - var open_rq3 = indexedDB.open(db.name); - open_rq3.onsuccess = function (e: any) { - var db3: IDBDatabase = e.target.result; - - t.true( - db3.objectStoreNames.contains("store"), - "third objectStoreNames contains store", - ); - t.false( - db3.objectStoreNames.contains("store2"), - "third objectStoreNames contains store2", - ); - - var st = db3.transaction("store").objectStore("store"); - - t.deepEqual(db3.version, 9, "db3.version"); - - t.true( - st.indexNames.contains("index"), - "third indexNames contains index", - ); - t.false( - st.indexNames.contains("index2"), - "third indexNames contains index2", - ); - - st.openCursor(null, "prev").onsuccess = function (e: any) { - t.deepEqual(e.target.result.key, 2, "opencursor(prev) key"); - t.deepEqual( - e.target.result.value.i, - "Jonas", - "opencursor(prev) value", - ); - }; - st.get(3).onsuccess = function (e: any) { - t.deepEqual(e.target.result, undefined, "get(3)"); - }; - - var idx = st.index("index"); - idx.getKey("Jonas").onsuccess = function (e: any) { - t.deepEqual(e.target.result, 2, "getKey(Jonas)"); - }; - idx.getKey("Odin").onsuccess = function (e: any) { - t.deepEqual(e.target.result, undefined, "getKey(Odin)"); - }; - idx.getKey("Sicking").onsuccess = function (e: any) { - t.deepEqual(e.target.result, undefined, "getKey(Sicking)"); - db3.close(); - resolve(); - }; - }; - }; + resolve(); }; + open_rq.onerror = (e: any) => reject(open_rq.error); }); - t.pass(); }); -// IDBFactory.open() - second open's transaction is available to get objectStores -test("WPT idbfactory-open11.htm", async (t) => { - const indexedDB = useTestIndexedDb(); - await new Promise<void>((resolve, reject) => { - var db: any; - var count_done = 0; - var open_rq = createdb(t); - - open_rq.onupgradeneeded = function (e: any) { - db = e.target.result; - - db.createObjectStore("store"); - t.true( - db.objectStoreNames.contains("store"), - "objectStoreNames contains store", - ); - - var store = e.target.transaction.objectStore("store"); - t.deepEqual(store.name, "store", "store.name"); +test("WPT idbfactory_open.htm #3", async (t) => { + var database_name = "WPT-idbfactory_open-database_name-2"; - store.add("data", 1); - - store.count().onsuccess = function (e: any) { - t.deepEqual(e.target.result, 1, "count()"); - count_done++; - }; - - store.add("data2", 2); + var open_rq = indexedDB.open(database_name, 13); + open_rq.onupgradeneeded = function (e: any) { + var db = open_rq.result; + assert.strictEqual(db.name, database_name, "db.name"); + assert.strictEqual(db.version, 13, "db.version"); + db.createObjectStore("store"); + }; + await new Promise<void>((resolve, reject) => { + open_rq.onsuccess = (e: any) => { + open_rq.result.close(); + resolve(); }; - open_rq.onsuccess = function (e: any) { - var store = db.transaction("store").objectStore("store"); - t.deepEqual(store.name, "store", "store.name"); - store.count().onsuccess = function (e: any) { - t.deepEqual(e.target.result, 2, "count()"); - count_done++; - }; - db.close(); - - var open_rq2 = indexedDB.open(db.name, 10); - open_rq2.onupgradeneeded = function (e: any) { - var db2 = e.target.result; - t.true( - db2.objectStoreNames.contains("store"), - "objectStoreNames contains store", - ); - var store = open_rq2.transaction!.objectStore("store"); - t.deepEqual(store.name, "store", "store.name"); - - store.add("data3", 3); - - store.count().onsuccess = function (e: any) { - t.deepEqual(e.target.result, 3, "count()"); - count_done++; + open_rq.onerror = (e: any) => reject(open_rq.error); + }); +}); - t.deepEqual(count_done, 3, "count_done"); +test("WPT idbfactory_open.htm #4", async (t) => { + var database_name = "WPT-idbfactory_open-database_name-3"; - db2.close(); - resolve(); - }; + var open_rq = indexedDB.open(database_name, 13); + open_rq.onupgradeneeded = function (e: any) { + var db = open_rq.result; + db.createObjectStore("store"); + }; + await new Promise<void>((resolve, reject) => { + open_rq.onsuccess = (e: any) => { + var db = open_rq.result; + db.close(); + var open_rq2 = indexedDB.open(database_name); + open_rq2.onsuccess = function (e: any) { + var db2 = open_rq2.result; + assert.strictEqual(db2.version, 13, "db.version"); + db2.close(); + resolve(); }; + open_rq2.onerror = (e: any) => reject(open_rq2.error); }; + open_rq.onerror = (e: any) => reject(open_rq.error); }); - t.pass(); }); -// IDBFactory.open() - upgradeneeded gets VersionChangeEvent -test("WPT idbfactory-open12.htm", async (t) => { - var db: any; - var open_rq = createdb(t, undefined, 9); +test("WPT idbfactory_open.htm #5", async (t) => { + var database_name = "WPT-idbfactory_open-database_name-4"; + var open_rq = indexedDB.open(database_name, 13); + open_rq.onupgradeneeded = function (e: any) { + var db = open_rq.result; + db.createObjectStore("store"); + }; await new Promise<void>((resolve, reject) => { - open_rq.onupgradeneeded = function (e: any) { - db = e.target.result; - - t.true( - e instanceof BridgeIDBVersionChangeEvent, - "e instanceof IDBVersionChangeEvent", - ); - t.deepEqual(e.oldVersion, 0, "oldVersion"); - t.deepEqual(e.newVersion, 9, "newVersion"); - t.deepEqual(e.type, "upgradeneeded", "event type"); - - t.deepEqual(db.version, 9, "db.version"); - }; - open_rq.onsuccess = function (e: any) { - t.true(e instanceof FakeEvent, "e instanceof Event"); - t.false( - e instanceof BridgeIDBVersionChangeEvent, - "e not instanceof IDBVersionChangeEvent", - ); - t.deepEqual(e.type, "success", "event type"); - resolve(); + open_rq.onsuccess = (e: any) => { + var db = open_rq.result; + db.close(); + var open_rq2 = indexedDB.open(database_name, 14); + open_rq2.onupgradeneeded = function (e: any) { + var db2 = open_rq2.result; + assert.strictEqual(db2.version, 14, "db.version"); + }; + open_rq2.onsuccess = function (e: any) { + var db2 = open_rq2.result; + assert.strictEqual(db2.version, 14, "db.version"); + db2.close(); + resolve(); + }; + open_rq2.onerror = (e: any) => reject(open_rq2.error); }; + open_rq.onerror = (e: any) => reject(open_rq.error); }); +}); - await new Promise<void>((resolve, reject) => { - /** - * Second test - */ - db.onversionchange = function () { - t.log("onversionchange called"); - db.close(); - }; +test("IDBFactory.open exception order", async (t) => { + assert.throws(() => { + indexedDB.open("foo", 0); + }, TypeError); + assert.throws(() => { + indexedDB.open("foo", -1); + }, TypeError); +}); + +test("WPT idbfactory_open.htm - open with version null", async (t) => { + // @ts-ignore + assert.throws(() => indexedDB.open("db", null), TypeError); +}); - var open_rq2 = createdb(t, db.name, 10); - open_rq2.onupgradeneeded = function (e: any) { - var db2 = e.target.result; - t.true( - e instanceof BridgeIDBVersionChangeEvent, - "e instanceof IDBVersionChangeEvent", - ); - t.deepEqual(e.oldVersion, 9, "oldVersion"); - t.deepEqual(e.newVersion, 10, "newVersion"); - t.deepEqual(e.type, "upgradeneeded", "event type"); +test("WPT idbfactory_open.htm - open with version false", async (t) => { + // @ts-ignore + assert.throws(() => indexedDB.open("db", false), TypeError); +}); - t.deepEqual(db2.version, 10, "new db.version"); +test("WPT idbfactory_open.htm - open with version object", async (t) => { + // @ts-ignore + assert.throws(() => indexedDB.open("db", {}), TypeError); +}); - resolve(); - }; - }); - t.pass(); +test("WPT idbfactory_open.htm - open with version array", async (t) => { + // @ts-ignore + assert.throws(() => indexedDB.open("db", [1, 2]), TypeError); }); diff --git a/packages/idb-bridge/src/idb-wpt-ported/idbindex-get.test.ts b/packages/idb-bridge/src/idb-wpt-ported/idbindex-get.test.ts @@ -1,9 +1,10 @@ -import test from "ava"; +import { test, before } from "node:test"; +import assert from "node:assert"; import { BridgeIDBKeyRange } from "../bridge-idb.js"; import { IDBDatabase } from "../idbtypes.js"; import { createdb, initTestIndexedDB } from "./wptsupport.js"; -test.before("test DB initialization", initTestIndexedDB); +before(initTestIndexedDB); // IDBIndex.get() - returns the record test("WPT idbindex_get.htm", async (t) => { @@ -28,12 +29,11 @@ test("WPT idbindex_get.htm", async (t) => { .get(record.indexedProperty); rq.onsuccess = function (e: any) { - t.deepEqual(e.target.result.key, record.key); + assert.deepStrictEqual(e.target.result.key, record.key); resolve(); }; }; }); - t.pass(); }); // IDBIndex.get() - returns the record where the index contains duplicate values @@ -63,12 +63,11 @@ test("WPT idbindex_get2.htm", async (t) => { .get("data"); rq.onsuccess = function (e: any) { - t.deepEqual(e.target.result.key, records[0].key); + assert.deepStrictEqual(e.target.result.key, records[0].key); resolve(); }; }; }); - t.pass(); }); // IDBIndex.get() - attempt to retrieve a record that doesn't exist @@ -84,12 +83,11 @@ test("WPT idbindex_get3.htm", async (t) => { .get(1); rq.onsuccess = function (e: any) { - t.deepEqual(e.target.result, undefined); + assert.deepStrictEqual(e.target.result, undefined); resolve(); }; }; }); - t.pass(); }); // IDBIndex.get() - returns the record with the first key in the range @@ -117,15 +115,14 @@ test("WPT idbindex_get4.htm", async (t) => { .get(BridgeIDBKeyRange.bound("data4", "data7")); rq.onsuccess = function (e: any) { - t.deepEqual(e.target.result.key, 4); - t.deepEqual(e.target.result.indexedProperty, "data4"); + assert.deepStrictEqual(e.target.result.key, 4); + assert.deepStrictEqual(e.target.result.indexedProperty, "data4"); setTimeout(function () { resolve(); }, 4); }; }; }); - t.pass(); }); // IDBIndex.get() - throw DataError when using invalid key @@ -140,7 +137,7 @@ test("WPT idbindex_get5.htm", async (t) => { var index = db .createObjectStore("test", { keyPath: "key" }) .createIndex("index", "indexedProperty"); - t.throws( + assert.throws( function () { index.get(NaN); }, @@ -149,7 +146,6 @@ test("WPT idbindex_get5.htm", async (t) => { resolve(); }; }); - t.pass(); }); // IDBIndex.get() - throw InvalidStateError when the index is deleted @@ -166,7 +162,7 @@ test("WPT idbindex_get6.htm", async (t) => { store.add({ key: 1, indexedProperty: "data" }); store.deleteIndex("index"); - t.throws( + assert.throws( function () { index.get("data"); }, @@ -175,7 +171,6 @@ test("WPT idbindex_get6.htm", async (t) => { resolve(); }; }); - t.pass(); }); // IDBIndex.get() - throw TransactionInactiveError on aborted transaction @@ -196,7 +191,7 @@ test("WPT idbindex_get7.htm", async (t) => { var index = tx.objectStore("store").index("index"); tx.abort(); - t.throws( + assert.throws( function () { index.get("data"); }, @@ -205,7 +200,6 @@ test("WPT idbindex_get7.htm", async (t) => { resolve(); }; }); - t.pass(); }); // IDBIndex.get() - throw InvalidStateError on index deleted by aborted upgrade @@ -222,7 +216,7 @@ test("WPT idbindex_get8.htm", async (t) => { e.target.transaction.abort(); - t.throws( + assert.throws( function () { index.get("data"); }, @@ -231,5 +225,4 @@ test("WPT idbindex_get8.htm", async (t) => { resolve(); }; }); - t.pass(); }); diff --git a/packages/idb-bridge/src/idb-wpt-ported/idbindex-openCursor.test.ts b/packages/idb-bridge/src/idb-wpt-ported/idbindex-openCursor.test.ts @@ -1,11 +1,12 @@ -import test from "ava"; +import { test, before } from "node:test"; +import assert from "node:assert"; import { createdb, initTestIndexedDB } from "./wptsupport.js"; -test.before("test DB initialization", initTestIndexedDB); +before(initTestIndexedDB); // IDBIndex.openCursor() - throw InvalidStateError when the index is deleted test("WPT test idbindex-openCursor.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db; var open_rq = createdb(t); @@ -17,7 +18,7 @@ test("WPT test idbindex-openCursor.htm", (t) => { store.add({ key: 1, indexedProperty: "data" }); store.deleteIndex("index"); - t.throws( + assert.throws( () => { index.openCursor(); }, @@ -31,7 +32,7 @@ test("WPT test idbindex-openCursor.htm", (t) => { // IDBIndex.openCursor() - throw TransactionInactiveError on aborted transaction test("WPT test idbindex-openCursor2.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db; var open_rq = createdb(t); @@ -47,7 +48,7 @@ test("WPT test idbindex-openCursor2.htm", (t) => { var index = tx.objectStore("store").index("index"); tx.abort(); - t.throws( + assert.throws( () => { index.openCursor(); }, @@ -61,7 +62,7 @@ test("WPT test idbindex-openCursor2.htm", (t) => { // IDBIndex.openCursor() - throw InvalidStateError on index deleted by aborted upgrade test("WPT test idbindex-openCursor3.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db; var open_rq = createdb(t); @@ -73,7 +74,7 @@ test("WPT test idbindex-openCursor3.htm", (t) => { e.target.transaction.abort(); - t.throws( + assert.throws( () => { console.log("index before openCursor", index); index.openCursor(); diff --git a/packages/idb-bridge/src/idb-wpt-ported/idbobjectstore-add-put-exception-order.test.ts b/packages/idb-bridge/src/idb-wpt-ported/idbobjectstore-add-put-exception-order.test.ts @@ -1,9 +1,10 @@ -import test, { ExecutionContext } from "ava"; +import { test, before } from "node:test"; +import assert from "node:assert"; import { indexeddb_test, initTestIndexedDB } from "./wptsupport.js"; -test.before("test DB initialization", initTestIndexedDB); +before(initTestIndexedDB); -async function t1(t: ExecutionContext, method: string): Promise<void> { +async function t1(t: any, method: string): Promise<void> { await indexeddb_test( t, (done, db) => { @@ -13,7 +14,7 @@ async function t1(t: ExecutionContext, method: string): Promise<void> { db.deleteObjectStore("s2"); setTimeout(() => { - t.throws( + assert.throws( () => { (store2 as any)[method]("key", "value"); }, @@ -32,7 +33,7 @@ async function t1(t: ExecutionContext, method: string): Promise<void> { /** * IDBObjectStore.${method} exception order: 'TransactionInactiveError vs. ReadOnlyError' */ -async function t2(t: ExecutionContext, method: string): Promise<void> { +async function t2(t: any, method: string): Promise<void> { await indexeddb_test( t, (done, db) => { @@ -43,7 +44,7 @@ async function t2(t: ExecutionContext, method: string): Promise<void> { const store = tx.objectStore("s"); setTimeout(() => { - t.throws( + assert.throws( () => { console.log(`calling ${method}`); (store as any)[method]("key", "value"); @@ -65,7 +66,7 @@ async function t2(t: ExecutionContext, method: string): Promise<void> { /** * IDBObjectStore.${method} exception order: 'ReadOnlyError vs. DataError' */ -async function t3(t: ExecutionContext, method: string): Promise<void> { +async function t3(t: any, method: string): Promise<void> { await indexeddb_test( t, (done, db) => { @@ -75,7 +76,7 @@ async function t3(t: ExecutionContext, method: string): Promise<void> { const tx = db.transaction("s", "readonly"); const store = tx.objectStore("s"); - t.throws( + assert.throws( () => { (store as any)[method]({}, "value"); }, @@ -90,11 +91,17 @@ async function t3(t: ExecutionContext, method: string): Promise<void> { ); } -test("WPT idbobjectstore-add-put-exception-order.html (add, t1)", t1, "add"); -test("WPT idbobjectstore-add-put-exception-order.html (put, t1)", t1, "put"); +test("WPT idbobjectstore-add-put-exception-order.html (add, t1)", (t) => + t1(t, "add")); +test("WPT idbobjectstore-add-put-exception-order.html (put, t1)", (t) => + t1(t, "put")); -test("WPT idbobjectstore-add-put-exception-order.html (add, t2)", t2, "add"); -test("WPT idbobjectstore-add-put-exception-order.html (put, t2)", t2, "put"); +test("WPT idbobjectstore-add-put-exception-order.html (add, t2)", (t) => + t2(t, "add")); +test("WPT idbobjectstore-add-put-exception-order.html (put, t2)", (t) => + t2(t, "put")); -test("WPT idbobjectstore-add-put-exception-order.html (add, t3)", t3, "add"); -test("WPT idbobjectstore-add-put-exception-order.html (put, t3)", t3, "put"); +test("WPT idbobjectstore-add-put-exception-order.html (add, t3)", (t) => + t3(t, "add")); +test("WPT idbobjectstore-add-put-exception-order.html (put, t3)", (t) => + t3(t, "put")); diff --git a/packages/idb-bridge/src/idb-wpt-ported/idbobjectstore-add.test.ts b/packages/idb-bridge/src/idb-wpt-ported/idbobjectstore-add.test.ts @@ -1,9 +1,10 @@ -import test from "ava"; +import { test, before } from "node:test"; +import assert from "node:assert"; import { BridgeIDBRequest } from "../bridge-idb.js"; import { IDBDatabase } from "../idbtypes.js"; import { createdb, initTestIndexedDB } from "./wptsupport.js"; -test.before("test DB initialization", initTestIndexedDB); +before(initTestIndexedDB); // IDBObjectStore.add() - add with an inline key test("WPT idbobjectstore_add.htm", async (t) => { @@ -23,13 +24,12 @@ test("WPT idbobjectstore_add.htm", async (t) => { var rq = db!.transaction("store").objectStore("store").get(record.key); rq.onsuccess = function (e: any) { - t.deepEqual(e.target.result.property, record.property); - t.deepEqual(e.target.result.key, record.key); + assert.deepStrictEqual(e.target.result.property, record.property); + assert.deepStrictEqual(e.target.result.key, record.key); resolve(); }; }; }); - t.pass(); }); // IDBObjectStore.add() - add with an out-of-line key @@ -51,12 +51,11 @@ test("WPT idbobjectstore_add2.htm", async (t) => { var rq = db.transaction("store").objectStore("store").get(key); rq.onsuccess = function (e: any) { - t.deepEqual(e.target.result.property, record.property); + assert.deepStrictEqual(e.target.result.property, record.property); resolve(); }; }; }); - t.pass(); }); // IDBObjectStore.add() - record with same key already exists @@ -72,12 +71,12 @@ test("WPT idbobjectstore_add3.htm", async (t) => { objStore.add(record); var rq = objStore.add(record); - rq.onsuccess = () => t.fail("success on adding duplicate record"); + rq.onsuccess = () => assert.fail("success on adding duplicate record"); rq.onerror = function (e: any) { - t.deepEqual(e.target.error.name, "ConstraintError"); - t.deepEqual(rq.error.name, "ConstraintError"); - t.deepEqual(e.type, "error"); + assert.deepStrictEqual(e.target.error.name, "ConstraintError"); + assert.deepStrictEqual(rq.error.name, "ConstraintError"); + assert.deepStrictEqual(e.type, "error"); e.preventDefault(); e.stopPropagation(); }; @@ -88,7 +87,6 @@ test("WPT idbobjectstore_add3.htm", async (t) => { resolve(); }; }); - t.pass(); }); // IDBObjectStore.add() - add where an index has unique:true specified @@ -105,12 +103,13 @@ test("WPT idbobjectstore_add4.htm", async (t) => { objStore.add(record); var rq = objStore.add(record); - rq.onsuccess = () => t.fail("success on adding duplicate indexed record"); + rq.onsuccess = () => + assert.fail("success on adding duplicate indexed record"); rq.onerror = function (e: any) { - t.deepEqual(rq.error.name, "ConstraintError"); - t.deepEqual(e.target.error.name, "ConstraintError"); - t.deepEqual(e.type, "error"); + assert.deepStrictEqual(rq.error.name, "ConstraintError"); + assert.deepStrictEqual(e.target.error.name, "ConstraintError"); + assert.deepStrictEqual(e.type, "error"); e.preventDefault(); e.stopPropagation(); }; @@ -121,7 +120,6 @@ test("WPT idbobjectstore_add4.htm", async (t) => { resolve(); }; }); - t.pass(); }); // IDBObjectStore.add() - object store's key path is an object attribute @@ -144,12 +142,11 @@ test("WPT idbobjectstore_add5.htm", async (t) => { .get(record.test.obj.key); rq.onsuccess = function (e: any) { - t.deepEqual(e.target.result.property, record.property); + assert.deepStrictEqual(e.target.result.property, record.property); resolve(); }; }; }); - t.pass(); }); // IDBObjectStore.add() - autoIncrement and inline keys @@ -181,16 +178,15 @@ test("WPT idbobjectstore_add6.htm", async (t) => { var cursor = e.target.result; if (cursor) { - actual_keys.push(cursor.value.key); + actual_keys.push((cursor as any).value.key); cursor.continue(); } else { - t.deepEqual(actual_keys, expected_keys); + assert.deepStrictEqual(actual_keys, expected_keys); resolve(); } }; }; }); - t.pass(); }); // IDBObjectStore.add() - autoIncrement and out-of-line keys @@ -222,13 +218,12 @@ test("WPT idbobjectstore_add7.htm", async (t) => { actual_keys.push(cursor.key); cursor.continue(); } else { - t.deepEqual(actual_keys, expected_keys); + assert.deepStrictEqual(actual_keys, expected_keys); resolve(); } }; }; }); - t.pass(); }); // IDBObjectStore.add() - object store has autoIncrement:true and the key path @@ -261,16 +256,15 @@ test("WPT idbobjectstore_add8.htm", async (t) => { var cursor = e.target.result; if (cursor) { - actual_keys.push(cursor.value.test.obj.key); + actual_keys.push((cursor as any).value.test.obj.key); cursor.continue(); } else { - t.deepEqual(actual_keys, expected_keys); + assert.deepStrictEqual(actual_keys, expected_keys); resolve(); } }; }; }); - t.pass(); }); // IDBObjectStore.add() - Attempt to add a record that does not meet the @@ -285,17 +279,16 @@ test("WPT idbobjectstore_add9.htm", async (t) => { db = e.target.result, objStore = db.createObjectStore("store", { keyPath: "key" }); - t.throws( + assert.throws( function () { rq = objStore.add(record, 1); }, { name: "DataError" }, ); - t.deepEqual(rq, undefined); + assert.deepStrictEqual(rq, undefined); resolve(); }; }); - t.pass(); }); // IDBObjectStore.add() - Attempt to call 'add' without an key parameter when the @@ -312,18 +305,17 @@ test("WPT idbobjectstore_add10.htm", async (t) => { var rq, objStore = db.createObjectStore("store"); - t.throws( + assert.throws( function () { rq = objStore.add(record); }, { name: "DataError" }, ); - t.deepEqual(rq, undefined); + assert.deepStrictEqual(rq, undefined); resolve(); }; }); - t.pass(); }); // IDBObjectStore.add() - Attempt to add a record where the record's key @@ -340,18 +332,17 @@ test("WPT idbobjectstore_add11.htm", async (t) => { var rq, objStore = db.createObjectStore("store", { keyPath: "key" }); - t.throws( + assert.throws( function () { rq = objStore.add(record); }, { name: "DataError" }, ); - t.deepEqual(rq, undefined); + assert.deepStrictEqual(rq, undefined); resolve(); }; }); - t.pass(); }); // IDBObjectStore.add() - Attempt to add a record where the @@ -367,17 +358,16 @@ test("WPT idbobjectstore_add12.htm", async (t) => { var rq, objStore = db.createObjectStore("store", { keyPath: "key" }); - t.throws( + assert.throws( function () { rq = objStore.add(record); }, { name: "DataError" }, ); - t.deepEqual(rq, undefined); + assert.deepStrictEqual(rq, undefined); resolve(); }; }); - t.pass(); }); // IDBObjectStore.add() - Attempt to add a record where the out of line @@ -394,18 +384,17 @@ test("WPT idbobjectstore_add13.htm", async (t) => { var rq, objStore = db.createObjectStore("store"); - t.throws( + assert.throws( function () { rq = objStore.add(record, { value: 1 }); }, { name: "DataError" }, ); - t.deepEqual(rq, undefined); + assert.deepStrictEqual(rq, undefined); resolve(); }; }); - t.pass(); }); // IDBObjectStore.add() - Add a record where a value @@ -426,13 +415,12 @@ test("WPT idbobjectstore_add14.htm", async (t) => { rq = objStore.add(record); - t.assert(rq instanceof BridgeIDBRequest); + assert.ok(rq instanceof BridgeIDBRequest); rq.onsuccess = function () { resolve(); }; }; }); - t.pass(); }); // IDBObjectStore.add() - If the transaction this IDBObjectStore belongs @@ -450,7 +438,7 @@ test("WPT idbobjectstore_add15.htm", async (t) => { open_rq.onsuccess = function (event: any) { var txn = db.transaction("store"); var ostore = txn.objectStore("store"); - t.throws( + assert.throws( function () { ostore.add({ pKey: "primaryKey_0" }); }, @@ -459,7 +447,6 @@ test("WPT idbobjectstore_add15.htm", async (t) => { resolve(); }; }); - t.pass(); }); // IDBObjectStore.add() - If the object store has been @@ -475,7 +462,7 @@ test("WPT idbobjectstore_add16.htm", async (t) => { ostore = db.createObjectStore("store", { keyPath: "pKey" }); db.deleteObjectStore("store"); - t.throws( + assert.throws( function () { ostore.add({ pKey: "primaryKey_0" }); }, @@ -484,5 +471,4 @@ test("WPT idbobjectstore_add16.htm", async (t) => { resolve(); }; }); - t.pass(); }); diff --git a/packages/idb-bridge/src/idb-wpt-ported/idbobjectstore-get.test.ts b/packages/idb-bridge/src/idb-wpt-ported/idbobjectstore-get.test.ts @@ -1,12 +1,13 @@ -import test from "ava"; +import { test, before } from "node:test"; +import assert from "node:assert"; import { BridgeIDBKeyRange } from "../bridge-idb.js"; import { createdb, initTestIndexedDB } from "./wptsupport.js"; -test.before("test DB initialization", initTestIndexedDB); +before(initTestIndexedDB); // IDBObjectStore.get() - key is a number test("WPT idbobjectstore_get.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db: any, record = { key: 3.14159265, property: "data" }; @@ -20,8 +21,8 @@ test("WPT idbobjectstore_get.htm", (t) => { var rq = db.transaction("store").objectStore("store").get(record.key); rq.onsuccess = function (e: any) { - t.deepEqual(e.target.result.key, record.key); - t.deepEqual(e.target.result.property, record.property); + assert.deepStrictEqual(e.target.result.key, record.key); + assert.deepStrictEqual(e.target.result.property, record.property); resolve(); }; }; @@ -30,7 +31,7 @@ test("WPT idbobjectstore_get.htm", (t) => { // IDBObjectStore.get() - key is a string test("WPT idbobjectstore_get2.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db: any, record = { key: "this is a key that's a string", property: "data" }; @@ -44,8 +45,8 @@ test("WPT idbobjectstore_get2.htm", (t) => { var rq = db.transaction("store").objectStore("store").get(record.key); rq.onsuccess = function (e: any) { - t.deepEqual(e.target.result.key, record.key); - t.deepEqual(e.target.result.property, record.property); + assert.deepStrictEqual(e.target.result.key, record.key); + assert.deepStrictEqual(e.target.result.property, record.property); resolve(); }; }; @@ -54,7 +55,7 @@ test("WPT idbobjectstore_get2.htm", (t) => { // IDBObjectStore.get() - key is a date test("WPT idbobjectstore_get3.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db: any; const record = { key: new Date(), property: "data" }; @@ -68,8 +69,11 @@ test("WPT idbobjectstore_get3.htm", (t) => { var rq = db.transaction("store").objectStore("store").get(record.key); rq.onsuccess = function (e: any) { - t.deepEqual(e.target.result.key.valueOf(), record.key.valueOf()); - t.deepEqual(e.target.result.property, record.property); + assert.deepStrictEqual( + e.target.result.key.valueOf(), + record.key.valueOf(), + ); + assert.deepStrictEqual(e.target.result.property, record.property); resolve(); }; }; @@ -78,7 +82,7 @@ test("WPT idbobjectstore_get3.htm", (t) => { // IDBObjectStore.get() - attempt to retrieve a record that doesn't exist test("WPT idbobjectstore_get4.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db: any; var open_rq = createdb(t); @@ -86,7 +90,7 @@ test("WPT idbobjectstore_get4.htm", (t) => { db = e.target.result; var rq = db.createObjectStore("store", { keyPath: "key" }).get(1); rq.onsuccess = function (e: any) { - t.deepEqual(e.target.results, undefined); + assert.deepStrictEqual(e.target.results, undefined); setTimeout(function () { resolve(); }, 10); @@ -99,7 +103,7 @@ test("WPT idbobjectstore_get4.htm", (t) => { // IDBObjectStore.get() - returns the record with the first key in the range test("WPT idbobjectstore_get5.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db: any; var open_rq = createdb(t); @@ -115,7 +119,7 @@ test("WPT idbobjectstore_get5.htm", (t) => { .transaction("store") .objectStore("store") .get(BridgeIDBKeyRange.bound(3, 6)).onsuccess = function (e: any) { - t.deepEqual(e.target.result, "data3", "get(3-6)"); + assert.deepStrictEqual(e.target.result, "data3", "get(3-6)"); resolve(); }; }; @@ -124,7 +128,7 @@ test("WPT idbobjectstore_get5.htm", (t) => { // IDBObjectStore.get() - throw TransactionInactiveError on aborted transaction test("WPT idbobjectstore_get6.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db: any; var open_rq = createdb(t); @@ -136,7 +140,7 @@ test("WPT idbobjectstore_get6.htm", (t) => { open_rq.onsuccess = function (e: any) { var store = db.transaction("store").objectStore("store"); store.transaction.abort(); - t.throws( + assert.throws( function () { store.get(1); }, @@ -150,7 +154,7 @@ test("WPT idbobjectstore_get6.htm", (t) => { // IDBObjectStore.get() - throw DataError when using invalid key test("WPT idbobjectstore_get7.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db: any; var open_rq = createdb(t); @@ -161,7 +165,7 @@ test("WPT idbobjectstore_get7.htm", (t) => { open_rq.onsuccess = function (e: any) { var store = db.transaction("store").objectStore("store"); - t.throws( + assert.throws( function () { store.get(null); }, diff --git a/packages/idb-bridge/src/idb-wpt-ported/idbobjectstore-put.test.ts b/packages/idb-bridge/src/idb-wpt-ported/idbobjectstore-put.test.ts @@ -1,12 +1,13 @@ -import test from "ava"; +import { test, before } from "node:test"; +import assert from "node:assert"; import { BridgeIDBRequest } from "../bridge-idb.js"; import { createdb, initTestIndexedDB } from "./wptsupport.js"; -test.before("test DB initialization", initTestIndexedDB); +before(initTestIndexedDB); // IDBObjectStore.put() - put with an inline key test("WPT idbobjectstore_put.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db: any, record = { key: 1, property: "data" }; @@ -22,8 +23,8 @@ test("WPT idbobjectstore_put.htm", (t) => { var rq = db.transaction("store").objectStore("store").get(record.key); rq.onsuccess = function (e: any) { - t.deepEqual(e.target.result.property, record.property); - t.deepEqual(e.target.result.key, record.key); + assert.deepStrictEqual(e.target.result.property, record.property); + assert.deepStrictEqual(e.target.result.key, record.key); resolve(); }; }; @@ -32,7 +33,7 @@ test("WPT idbobjectstore_put.htm", (t) => { // IDBObjectStore.put() - put with an out-of-line key test("WPT idbobjectstore_put2.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db: any, key = 1, record = { property: "data" }; @@ -49,7 +50,7 @@ test("WPT idbobjectstore_put2.htm", (t) => { var rq = db.transaction("store").objectStore("store").get(key); rq.onsuccess = function (e: any) { - t.deepEqual(e.target.result.property, record.property); + assert.deepStrictEqual(e.target.result.property, record.property); resolve(); }; @@ -59,7 +60,7 @@ test("WPT idbobjectstore_put2.htm", (t) => { // IDBObjectStore.put() - put with an out-of-line key test("WPT idbobjectstore_put3.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db: any, success_event: any, record = { key: 1, property: "data" }, @@ -72,7 +73,7 @@ test("WPT idbobjectstore_put3.htm", (t) => { objStore.put(record); var rq = objStore.put(record_put); - rq.onerror = () => t.fail("error on put"); + rq.onerror = () => assert.fail("error on put"); rq.onsuccess = function (e: any) { success_event = true; @@ -80,16 +81,16 @@ test("WPT idbobjectstore_put3.htm", (t) => { }; open_rq.onsuccess = function (e: any) { - t.true(success_event); + assert.ok(success_event); var rq = db.transaction("store").objectStore("store").get(1); rq.onsuccess = function (e: any) { var rec = e.target.result; - t.deepEqual(rec.key, record_put.key); - t.deepEqual(rec.property, record_put.property); - t.deepEqual(rec.more, record_put.more); + assert.deepStrictEqual(rec.key, record_put.key); + assert.deepStrictEqual(rec.property, record_put.property); + assert.deepStrictEqual(rec.more, record_put.more); resolve(); }; @@ -99,7 +100,7 @@ test("WPT idbobjectstore_put3.htm", (t) => { // IDBObjectStore.put() - put where an index has unique:true specified test("WPT idbobjectstore_put4.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db: any, record = { key: 1, property: "data" }; @@ -112,13 +113,13 @@ test("WPT idbobjectstore_put4.htm", (t) => { var rq = objStore.put(record); rq.onsuccess = () => - t.fail("success on putting duplicate indexed record"); + assert.fail("success on putting duplicate indexed record"); rq.onerror = function (e: any) { - t.deepEqual(rq.error.name, "ConstraintError"); - t.deepEqual(e.target.error.name, "ConstraintError"); + assert.deepStrictEqual(rq.error.name, "ConstraintError"); + assert.deepStrictEqual(e.target.error.name, "ConstraintError"); - t.deepEqual(e.type, "error"); + assert.deepStrictEqual(e.type, "error"); e.preventDefault(); e.stopPropagation(); @@ -134,7 +135,7 @@ test("WPT idbobjectstore_put4.htm", (t) => { // IDBObjectStore.put() - object store's key path is an object attribute test("WPT idbobjectstore_put5.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db: any, record = { test: { obj: { key: 1 } }, property: "data" }; @@ -152,7 +153,7 @@ test("WPT idbobjectstore_put5.htm", (t) => { .get(record.test.obj.key); rq.onsuccess = function (e: any) { - t.deepEqual(e.target.result.property, record.property); + assert.deepStrictEqual(e.target.result.property, record.property); resolve(); }; @@ -162,7 +163,7 @@ test("WPT idbobjectstore_put5.htm", (t) => { // IDBObjectStore.put() - autoIncrement and inline keys test("WPT idbobjectstore_put6.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db: any, record = { property: "data" }, expected_keys = [1, 2, 3, 4]; @@ -189,10 +190,10 @@ test("WPT idbobjectstore_put6.htm", (t) => { var cursor = e.target.result; if (cursor) { - actual_keys.push(cursor.value.key); + actual_keys.push((cursor as any).value.key); cursor.continue(); } else { - t.deepEqual(actual_keys, expected_keys); + assert.deepStrictEqual(actual_keys, expected_keys); resolve(); return; } @@ -203,7 +204,7 @@ test("WPT idbobjectstore_put6.htm", (t) => { // IDBObjectStore.put() - autoIncrement and out-of-line keys test("WPT idbobjectstore_put7.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db: any, record = { property: "data" }, expected_keys = [1, 2, 3, 4]; @@ -219,7 +220,7 @@ test("WPT idbobjectstore_put7.htm", (t) => { objStore.put(record); }; - open_rq.onsuccess = function (e) { + open_rq.onsuccess = function (e: any) { var actual_keys: any[] = [], rq = db.transaction("store").objectStore("store").openCursor(); @@ -230,7 +231,7 @@ test("WPT idbobjectstore_put7.htm", (t) => { actual_keys.push(cursor.key); cursor.continue(); } else { - t.deepEqual(actual_keys, expected_keys); + assert.deepStrictEqual(actual_keys, expected_keys); resolve(); } }; @@ -240,7 +241,7 @@ test("WPT idbobjectstore_put7.htm", (t) => { // IDBObjectStore.put() - object store has autoIncrement:true and the key path is an object attribute test("WPT idbobjectstore_put8.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db: any, record = { property: "data" }, expected_keys = [1, 2, 3, 4]; @@ -267,10 +268,10 @@ test("WPT idbobjectstore_put8.htm", (t) => { var cursor = e.target.result; if (cursor) { - actual_keys.push(cursor.value.test.obj.key); + actual_keys.push((cursor as any).value.test.obj.key); cursor.continue(); } else { - t.deepEqual(actual_keys, expected_keys); + assert.deepStrictEqual(actual_keys, expected_keys); resolve(); return; } @@ -281,7 +282,7 @@ test("WPT idbobjectstore_put8.htm", (t) => { //IDBObjectStore.put() - Attempt to put a record that does not meet the constraints of an object store's inline key requirements test("WPT idbobjectstore_put9.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var record = { key: 1, property: "data" }; var open_rq = createdb(t); @@ -290,14 +291,14 @@ test("WPT idbobjectstore_put9.htm", (t) => { db = e.target.result, objStore = db.createObjectStore("store", { keyPath: "key" }); - t.throws( + assert.throws( function () { rq = objStore.put(record, 1); }, { name: "DataError" }, ); - t.deepEqual(rq, undefined); + assert.deepStrictEqual(rq, undefined); resolve(); }; }); @@ -305,7 +306,7 @@ test("WPT idbobjectstore_put9.htm", (t) => { //IDBObjectStore.put() - Attempt to call 'put' without an key parameter when the object store uses out-of-line keys test("WPT idbobjectstore_put10.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db: any, record = { property: "data" }; @@ -316,14 +317,14 @@ test("WPT idbobjectstore_put10.htm", (t) => { var rq, objStore = db.createObjectStore("store", { keyPath: "key" }); - t.throws( + assert.throws( function () { rq = objStore.put(record); }, { name: "DataError" }, ); - t.deepEqual(rq, undefined); + assert.deepStrictEqual(rq, undefined); resolve(); }; }); @@ -331,7 +332,7 @@ test("WPT idbobjectstore_put10.htm", (t) => { // IDBObjectStore.put() - Attempt to put a record where the record's key does not meet the constraints of a valid key test("WPT idbobjectstore_put11.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db: any, record = { key: { value: 1 }, property: "data" }; @@ -342,14 +343,14 @@ test("WPT idbobjectstore_put11.htm", (t) => { var rq, objStore = db.createObjectStore("store", { keyPath: "key" }); - t.throws( + assert.throws( function () { rq = objStore.put(record); }, { name: "DataError" }, ); - t.deepEqual(rq, undefined); + assert.deepStrictEqual(rq, undefined); resolve(); }; }); @@ -357,7 +358,7 @@ test("WPT idbobjectstore_put11.htm", (t) => { // IDBObjectStore.put() - Attempt to put a record where the record's in-line key is not defined test("WPT idbobjectstore_put12.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db: any, record = { property: "data" }; @@ -368,14 +369,14 @@ test("WPT idbobjectstore_put12.htm", (t) => { var rq, objStore = db.createObjectStore("store", { keyPath: "key" }); - t.throws( + assert.throws( function () { rq = objStore.put(record); }, { name: "DataError" }, ); - t.deepEqual(rq, undefined); + assert.deepStrictEqual(rq, undefined); resolve(); }; }); @@ -383,7 +384,7 @@ test("WPT idbobjectstore_put12.htm", (t) => { // IDBObjectStore.put() - Attempt to put a record where the out of line key provided does not meet the constraints of a valid key test("WPT idbobjectstore_put13.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db: any, record = { property: "data" }; @@ -394,7 +395,7 @@ test("WPT idbobjectstore_put13.htm", (t) => { var rq, objStore = db.createObjectStore("store"); - t.throws( + assert.throws( function () { rq = objStore.put(record, { value: 1 }); }, @@ -403,7 +404,7 @@ test("WPT idbobjectstore_put13.htm", (t) => { }, ); - t.deepEqual(rq, undefined); + assert.deepStrictEqual(rq, undefined); resolve(); }; }); @@ -411,7 +412,7 @@ test("WPT idbobjectstore_put13.htm", (t) => { // IDBObjectStore.put() - Put a record where a value being indexed does not meet the constraints of a valid key test("WPT idbobjectstore_put14.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db: any, record = { key: 1, indexedProperty: { property: "data" } }; @@ -426,7 +427,7 @@ test("WPT idbobjectstore_put14.htm", (t) => { rq = objStore.put(record); - t.true(rq instanceof BridgeIDBRequest); + assert.ok(rq instanceof BridgeIDBRequest); rq.onsuccess = function () { resolve(); }; @@ -436,7 +437,7 @@ test("WPT idbobjectstore_put14.htm", (t) => { // IDBObjectStore.put() - If the transaction this IDBObjectStore belongs to has its mode set to readonly, throw ReadOnlyError test("WPT idbobjectstore_put15.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db: any; var open_rq = createdb(t); @@ -448,7 +449,7 @@ test("WPT idbobjectstore_put15.htm", (t) => { open_rq.onsuccess = function (event: any) { var txn = db.transaction("store"); var ostore = txn.objectStore("store"); - t.throws( + assert.throws( function () { ostore.put({ pKey: "primaryKey_0" }); }, @@ -463,7 +464,7 @@ test("WPT idbobjectstore_put15.htm", (t) => { // IDBObjectStore.put() - If the object store has been deleted, the implementation must throw a DOMException of type InvalidStateError test("WPT idbobjectstore_put16.htm", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { var db: any, ostore: any; var open_rq = createdb(t); @@ -471,7 +472,7 @@ test("WPT idbobjectstore_put16.htm", (t) => { db = event.target.result; ostore = db.createObjectStore("store", { keyPath: "pKey" }); db.deleteObjectStore("store"); - t.throws( + assert.throws( function () { ostore.put({ pKey: "primaryKey_0" }); }, diff --git a/packages/idb-bridge/src/idb-wpt-ported/idbobjectstore-rename-store.test.ts b/packages/idb-bridge/src/idb-wpt-ported/idbobjectstore-rename-store.test.ts @@ -1,4 +1,5 @@ -import test, { ExecutionContext } from "ava"; +import { test, before } from "node:test"; +import assert from "node:assert"; import { checkStoreContents, checkStoreGenerator, @@ -10,7 +11,7 @@ import { migrateDatabase, } from "./wptsupport.js"; -test.before("test DB initialization", initTestIndexedDB); +before(initTestIndexedDB); // IndexedDB: object store renaming support // IndexedDB object store rename in new transaction @@ -23,7 +24,7 @@ test("WPT idbobjectstore-rename-store.html (subtest 1)", async (t) => { bookStore = createBooksStore(t, database); }) .then((database) => { - t.deepEqual( + assert.deepStrictEqual( database.objectStoreNames as any, ["books"], 'Test setup should have created a "books" object store', @@ -41,31 +42,31 @@ test("WPT idbobjectstore-rename-store.html (subtest 1)", async (t) => { renamedBookStore = transaction.objectStore("books"); renamedBookStore.name = "renamed_books"; - t.deepEqual( + assert.deepStrictEqual( renamedBookStore.name, "renamed_books", "IDBObjectStore name should change immediately after a rename", ); - t.deepEqual( + assert.deepStrictEqual( database.objectStoreNames as any, ["renamed_books"], "IDBDatabase.objectStoreNames should immediately reflect the " + "rename", ); - t.deepEqual( + assert.deepStrictEqual( transaction.objectStoreNames as any, ["renamed_books"], "IDBTransaction.objectStoreNames should immediately reflect the " + "rename", ); - t.deepEqual( + assert.deepStrictEqual( transaction.objectStore("renamed_books"), renamedBookStore, "IDBTransaction.objectStore should return the renamed object " + "store when queried using the new name immediately after the " + "rename", ); - t.throws( + assert.throws( () => transaction.objectStore("books"), { name: "NotFoundError" }, "IDBTransaction.objectStore should throw when queried using the " + @@ -74,7 +75,7 @@ test("WPT idbobjectstore-rename-store.html (subtest 1)", async (t) => { }), ) .then((database) => { - t.deepEqual( + assert.deepStrictEqual( database.objectStoreNames as any, ["renamed_books"], "IDBDatabase.objectStoreNames should still reflect the rename " + @@ -89,25 +90,25 @@ test("WPT idbobjectstore-rename-store.html (subtest 1)", async (t) => { ).then(() => database.close()); }) .then(() => { - t.deepEqual( + assert.deepStrictEqual( bookStore.name, "books", "IDBObjectStore obtained before the rename transaction should " + "not reflect the rename", ); - t.deepEqual( + assert.deepStrictEqual( bookStore2.name, "books", "IDBObjectStore obtained before the rename transaction should " + "not reflect the rename", ); - t.deepEqual( + assert.deepStrictEqual( renamedBookStore.name, "renamed_books", "IDBObjectStore used in the rename transaction should keep " + "reflecting the new name after the transaction is committed", ); - t.deepEqual( + assert.deepStrictEqual( renamedBookStore2.name, "renamed_books", "IDBObjectStore obtained after the rename transaction should " + @@ -125,30 +126,30 @@ test("WPT idbobjectstore-rename-store.html (subtest 2)", async (t) => { renamedBookStore = createBooksStore(t, database); renamedBookStore.name = "renamed_books"; - t.deepEqual( + assert.deepStrictEqual( renamedBookStore.name, "renamed_books", "IDBObjectStore name should change immediately after a rename", ); - t.deepEqual( + assert.deepStrictEqual( database.objectStoreNames as any, ["renamed_books"], "IDBDatabase.objectStoreNames should immediately reflect the " + "rename", ); - t.deepEqual( + assert.deepStrictEqual( transaction.objectStoreNames as any, ["renamed_books"], "IDBTransaction.objectStoreNames should immediately reflect the " + "rename", ); - t.deepEqual( + assert.deepStrictEqual( transaction.objectStore("renamed_books"), renamedBookStore, "IDBTransaction.objectStore should return the renamed object " + "store when queried using the new name immediately after the " + "rename", ); - t.throws( + assert.throws( () => transaction.objectStore("books"), { name: "NotFoundError" }, "IDBTransaction.objectStore should throw when queried using the " + @@ -156,7 +157,7 @@ test("WPT idbobjectstore-rename-store.html (subtest 2)", async (t) => { ); }) .then((database) => { - t.deepEqual( + assert.deepStrictEqual( database.objectStoreNames as any, ["renamed_books"], "IDBDatabase.objectStoreNames should still reflect the rename " + @@ -171,13 +172,13 @@ test("WPT idbobjectstore-rename-store.html (subtest 2)", async (t) => { ).then(() => database.close()); }) .then(() => { - t.deepEqual( + assert.deepStrictEqual( renamedBookStore.name, "renamed_books", "IDBObjectStore used in the rename transaction should keep " + "reflecting the new name after the transaction is committed", ); - t.deepEqual( + assert.deepStrictEqual( renamedBookStore2.name, "renamed_books", "IDBObjectStore obtained after the rename transaction should " + @@ -190,7 +191,7 @@ test("WPT idbobjectstore-rename-store.html (subtest 2)", async (t) => { // // Returns a promise that resolves to an IndexedDB database. The caller must // close the database. -const renameBooksStore = (testCase: ExecutionContext) => { +const renameBooksStore = (testCase: any) => { return migrateDatabase(testCase, 2, (database, transaction) => { const store = transaction.objectStore("books"); store.name = "renamed_books"; @@ -225,7 +226,6 @@ test("WPT idbobjectstore-rename-store.html (subtest 3)", async (t) => { ); return database.close(); }); - t.pass(); }); // IndexedDB: object store renaming support @@ -257,7 +257,6 @@ test("WPT idbobjectstore-rename-store.html (subtest 4)", async (t) => { "generator", ).then(() => database.close()); }); - t.pass(); }); // IndexedDB: object store renaming support @@ -275,7 +274,7 @@ test("WPT idbobjectstore-rename-store.html (subtest 5)", async (t) => { const store = transaction.objectStore("books"); database.deleteObjectStore("not_books"); store.name = "not_books"; - t.deepEqual( + assert.deepStrictEqual( database.objectStoreNames as any, ["not_books"], "IDBDatabase.objectStoreNames should immediately reflect the " + @@ -284,7 +283,7 @@ test("WPT idbobjectstore-rename-store.html (subtest 5)", async (t) => { }), ) .then((database) => { - t.deepEqual( + assert.deepStrictEqual( database.objectStoreNames as any, ["not_books"], "IDBDatabase.objectStoreNames should still reflect the rename " + @@ -298,7 +297,6 @@ test("WPT idbobjectstore-rename-store.html (subtest 5)", async (t) => { "Renaming an object store should not change its records", ).then(() => database.close()); }); - t.pass(); }); // IndexedDB: object store renaming support @@ -319,19 +317,19 @@ test("WPT idbobjectstore-rename-store.html (IndexedDB object store swapping via transaction.objectStore("not_books").name = "books"; transaction.objectStore("tmp").name = "not_books"; - t.deepEqual( + assert.deepStrictEqual( database.objectStoreNames as any, ["books", "not_books"], "IDBDatabase.objectStoreNames should immediately reflect the swap", ); - t.is( + assert.strictEqual( transaction.objectStore("books"), notBookStore, 'IDBTransaction.objectStore should return the original "books" ' + 'store when queried with "not_books" after the swap', ); - t.is( + assert.strictEqual( transaction.objectStore("not_books"), bookStore, "IDBTransaction.objectStore should return the original " + @@ -340,7 +338,7 @@ test("WPT idbobjectstore-rename-store.html (IndexedDB object store swapping via }), ) .then((database) => { - t.deepEqual( + assert.deepStrictEqual( database.objectStoreNames as any, ["books", "not_books"], "IDBDatabase.objectStoreNames should still reflect the swap " + @@ -348,7 +346,7 @@ test("WPT idbobjectstore-rename-store.html (IndexedDB object store swapping via ); const transaction = database.transaction("not_books", "readonly"); const store = transaction.objectStore("not_books"); - t.deepEqual( + assert.deepStrictEqual( store.indexNames as any, ["by_author", "by_title"], '"not_books" index names should still reflect the swap after the ' + @@ -360,7 +358,6 @@ test("WPT idbobjectstore-rename-store.html (IndexedDB object store swapping via "Swapping two object stores should not change their records", ).then(() => database.close()); }); - t.pass(); }); // IndexedDB: object store renaming support @@ -376,13 +373,13 @@ test("WPT idbobjectstore-rename-store.html (IndexedDB object store rename string const store = transaction.objectStore("books"); // @ts-expect-error store.name = 42; - t.deepEqual( + assert.deepStrictEqual( store.name, "42", "IDBObjectStore name should change immediately after a " + "rename to a number", ); - t.deepEqual( + assert.deepStrictEqual( database.objectStoreNames as any, ["42"], "IDBDatabase.objectStoreNames should immediately reflect the " + @@ -391,7 +388,7 @@ test("WPT idbobjectstore-rename-store.html (IndexedDB object store rename string // @ts-expect-error store.name = true; - t.deepEqual( + assert.deepStrictEqual( store.name, "true", "IDBObjectStore name should change immediately after a " + @@ -400,7 +397,7 @@ test("WPT idbobjectstore-rename-store.html (IndexedDB object store rename string // @ts-expect-error store.name = {}; - t.deepEqual( + assert.deepStrictEqual( store.name, "[object Object]", "IDBObjectStore name should change immediately after a " + @@ -409,7 +406,7 @@ test("WPT idbobjectstore-rename-store.html (IndexedDB object store rename string // @ts-expect-error store.name = () => null; - t.deepEqual( + assert.deepStrictEqual( store.name, "() => null", "IDBObjectStore name should change immediately after a " + @@ -418,7 +415,7 @@ test("WPT idbobjectstore-rename-store.html (IndexedDB object store rename string // @ts-expect-error store.name = undefined; - t.deepEqual( + assert.deepStrictEqual( store.name, "undefined", "IDBObjectStore name should change immediately after a " + @@ -427,7 +424,7 @@ test("WPT idbobjectstore-rename-store.html (IndexedDB object store rename string }), ) .then((database) => { - t.deepEqual( + assert.deepStrictEqual( database.objectStoreNames as any, ["undefined"], "IDBDatabase.objectStoreNames should reflect the last rename " + @@ -441,13 +438,9 @@ test("WPT idbobjectstore-rename-store.html (IndexedDB object store rename string "Renaming an object store should not change its records", ).then(() => database.close()); }); - t.pass(); }); -function rename_test_macro( - t: ExecutionContext, - escapedName: string, -): Promise<void> { +function rename_test_macro(t: any, escapedName: string): Promise<void> { const name = JSON.parse('"' + escapedName + '"'); return createDatabase(t, (database, transaction) => { createBooksStore(t, database); @@ -460,12 +453,12 @@ function rename_test_macro( const store = transaction.objectStore("books"); store.name = name; - t.deepEqual( + assert.deepStrictEqual( store.name, name, "IDBObjectStore name should change immediately after the " + "rename", ); - t.deepEqual( + assert.deepStrictEqual( database.objectStoreNames as any, [name], "IDBDatabase.objectStoreNames should immediately reflect the " + @@ -474,7 +467,7 @@ function rename_test_macro( }), ) .then((database) => { - t.deepEqual( + assert.deepStrictEqual( database.objectStoreNames as any, [name], "IDBDatabase.objectStoreNames should reflect the rename " + @@ -491,9 +484,7 @@ function rename_test_macro( } for (let escapedName of ["", "\\u0000", "\\uDC00\\uD800"]) { - test( - 'IndexedDB object store can be renamed to "' + escapedName + '"', - rename_test_macro, - escapedName, + test('IndexedDB object store can be renamed to "' + escapedName + '"', (t) => + rename_test_macro(t, escapedName), ); } diff --git a/packages/idb-bridge/src/idb-wpt-ported/idbtransaction-oncomplete.test.ts b/packages/idb-bridge/src/idb-wpt-ported/idbtransaction-oncomplete.test.ts @@ -1,7 +1,8 @@ -import test from "ava"; +import { test, before } from "node:test"; +import assert from "node:assert"; import { createdb, initTestIndexedDB } from "./wptsupport.js"; -test.before("test DB initialization", initTestIndexedDB); +before(initTestIndexedDB); // IDBTransaction - complete event test("WPT idbtransaction-oncomplete.htm", async (t) => { @@ -28,7 +29,11 @@ test("WPT idbtransaction-oncomplete.htm", async (t) => { // Making a totally new transaction to check db.transaction("store").objectStore("store").count().onsuccess = function (e: any) { - t.deepEqual(stages, ["upgradeneeded", "complete", "success"]); + assert.deepStrictEqual(stages, [ + "upgradeneeded", + "complete", + "success", + ]); resolve(); }; // XXX: Make one with real transactions, not only open() versionchange one @@ -45,5 +50,4 @@ test("WPT idbtransaction-oncomplete.htm", async (t) => { */ }; }); - t.pass(); }); diff --git a/packages/idb-bridge/src/idb-wpt-ported/keypath.test.ts b/packages/idb-bridge/src/idb-wpt-ported/keypath.test.ts @@ -1,11 +1,12 @@ -import test from "ava"; +import { test, before } from "node:test"; +import assert from "node:assert"; import { assert_key_equals, createdb, initTestIndexedDB, } from "./wptsupport.js"; -test.before("test DB initialization", initTestIndexedDB); +before(initTestIndexedDB); test("WPT test keypath.htm", async (t) => { function keypath( @@ -190,6 +191,4 @@ test("WPT test keypath.htm", async (t) => { [[1], ["a"], [["k"]]], "array loop -> stringify becomes ['']", ); - - t.pass(); }); diff --git a/packages/idb-bridge/src/idb-wpt-ported/request-bubble-and-capture.test.ts b/packages/idb-bridge/src/idb-wpt-ported/request-bubble-and-capture.test.ts @@ -1,8 +1,9 @@ -import test from "ava"; +import { test, before } from "node:test"; +import assert from "node:assert"; import { EventTarget } from "../idbtypes.js"; import { createdb, initTestIndexedDB } from "./wptsupport.js"; -test.before("test DB initialization", initTestIndexedDB); +before(initTestIndexedDB); // Bubbling and capturing of request events test("WPT request_bubble-and-capture.htm", async (t) => { @@ -35,7 +36,7 @@ test("WPT request_bubble-and-capture.htm", async (t) => { open_rq.onsuccess = function (e: any) { log("open_rq.success")(e); - t.deepEqual( + assert.deepStrictEqual( events, [ "capture db.success", @@ -80,5 +81,4 @@ test("WPT request_bubble-and-capture.htm", async (t) => { }; } }); - t.pass(); }); diff --git a/packages/idb-bridge/src/idb-wpt-ported/transaction-requestqueue.test.ts b/packages/idb-bridge/src/idb-wpt-ported/transaction-requestqueue.test.ts @@ -1,7 +1,8 @@ -import test from "ava"; +import { test, before } from "node:test"; +import assert from "node:assert"; import { createdb, initTestIndexedDB } from "./wptsupport.js"; -test.before("test DB initialization", initTestIndexedDB); +before(initTestIndexedDB); // Transactions have a request queue test("transaction-requestqueue.htm", async (t) => { @@ -63,7 +64,7 @@ test("transaction-requestqueue.htm", async (t) => { function finish() { if (--finish_to_go) return; - t.deepEqual( + assert.deepStrictEqual( keys["txn"], [ "os1: 1", @@ -78,7 +79,7 @@ test("transaction-requestqueue.htm", async (t) => { "transaction keys", ); - t.deepEqual( + assert.deepStrictEqual( keys["txn2"], [ "os4: 1", @@ -102,5 +103,4 @@ test("transaction-requestqueue.htm", async (t) => { resolve(); } }); - t.pass(); }); diff --git a/packages/idb-bridge/src/idb-wpt-ported/value.test.ts b/packages/idb-bridge/src/idb-wpt-ported/value.test.ts @@ -1,16 +1,15 @@ -import test from "ava"; +import { test, before } from "node:test"; +import assert from "node:assert"; import { IDBVersionChangeEvent } from "../idbtypes.js"; import { createdb, initTestIndexedDB } from "./wptsupport.js"; -test.before("test DB initialization", initTestIndexedDB); +before(initTestIndexedDB); test("WPT test value.htm, array", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { const value = new Array(); const _instanceof = Array; - t.plan(1); - createdb(t).onupgradeneeded = function (e: IDBVersionChangeEvent) { (e.target as any).result.createObjectStore("store").add(value, 1); (e.target as any).onsuccess = (e: any) => { @@ -18,7 +17,7 @@ test("WPT test value.htm, array", (t) => { .transaction("store") .objectStore("store") .get(1).onsuccess = (e: any) => { - t.assert(e.target.result instanceof _instanceof, "instanceof"); + assert.ok(e.target.result instanceof _instanceof, "instanceof"); resolve(); }; }; @@ -27,12 +26,10 @@ test("WPT test value.htm, array", (t) => { }); test("WPT test value.htm, date", (t) => { - return new Promise((resolve, reject) => { + return new Promise<void>((resolve, reject) => { const value = new Date(); const _instanceof = Date; - t.plan(1); - createdb(t).onupgradeneeded = function (e: IDBVersionChangeEvent) { (e.target as any).result.createObjectStore("store").add(value, 1); (e.target as any).onsuccess = (e: any) => { @@ -40,7 +37,7 @@ test("WPT test value.htm, date", (t) => { .transaction("store") .objectStore("store") .get(1).onsuccess = (e: any) => { - t.assert(e.target.result instanceof _instanceof, "instanceof"); + assert.ok(e.target.result instanceof _instanceof, "instanceof"); resolve(); }; }; diff --git a/packages/idb-bridge/src/idb-wpt-ported/wptsupport.ts b/packages/idb-bridge/src/idb-wpt-ported/wptsupport.ts @@ -1,4 +1,5 @@ -import { ExecutionContext } from "ava"; +import { test } from "node:test"; +import assert from "node:assert"; import { BridgeIDBRequest } from "../bridge-idb.js"; import { IDBDatabase, @@ -14,7 +15,7 @@ import { compareKeys } from "../util/cmp.js"; export { initTestIndexedDB, useTestIndexedDb } from "../testingdb.js"; export function createdb( - t: ExecutionContext<unknown>, + t: any, dbname?: string, version?: number, ): IDBOpenDBRequest { @@ -46,7 +47,7 @@ function makeDatabaseName(testCase: string): string { // most cases, but insufficient for indexedDB.open(), which issues // "upgradeneded" events under normal operation. export function promiseForRequest<T = any>( - t: ExecutionContext, + t: any, request: IDBRequest<T>, ): Promise<T> { return new Promise<T>((resolve, reject) => { @@ -65,10 +66,7 @@ export function promiseForRequest<T = any>( // // The promise resolves with undefined if IDBTransaction receives the "complete" // event, and rejects with an error for any other event. -export function promiseForTransaction( - t: ExecutionContext, - request: IDBTransaction, -) { +export function promiseForTransaction(t: any, request: IDBTransaction) { return new Promise<any>((resolve, reject) => { request.addEventListener("complete", (evt: any) => { resolve(evt.target.result); @@ -85,20 +83,20 @@ type MigrationCallback = ( ) => void; export async function migrateDatabase( - t: ExecutionContext, + t: any, newVersion: number, migrationCallback: MigrationCallback, ): Promise<IDBDatabase> { return migrateNamedDatabase( t, - makeDatabaseName(t.title), + makeDatabaseName(t.name || t.title), newVersion, migrationCallback, ); } export async function migrateNamedDatabase( - t: ExecutionContext, + t: any, databaseName: string, newVersion: number, migrationCallback: MigrationCallback, @@ -152,7 +150,9 @@ export async function migrateNamedDatabase( request.onerror = (event: any) => reject(event.target.error); request.onsuccess = () => { const database = request.result; - t.teardown(() => database.close()); + if (t.after) { + t.after(() => database.close()); + } reject( new Error( "indexedDB.open should not succeed without creating a " + @@ -164,10 +164,10 @@ export async function migrateNamedDatabase( } export async function createDatabase( - t: ExecutionContext, + t: any, setupCallback: MigrationCallback, ): Promise<IDBDatabase> { - const databaseName = makeDatabaseName(t.title); + const databaseName = makeDatabaseName(t.name || t.title); const request = useTestIndexedDb().deleteDatabase(databaseName); return migrateNamedDatabase(t, databaseName, 1, setupCallback); } @@ -182,10 +182,7 @@ const BOOKS_RECORD_DATA = [ // Creates a 'books' object store whose contents closely resembles the first // example in the IndexedDB specification. -export const createBooksStore = ( - testCase: ExecutionContext, - database: IDBDatabase, -) => { +export const createBooksStore = (testCase: any, database: IDBDatabase) => { const store = database.createObjectStore("books", { keyPath: "isbn", autoIncrement: true, @@ -203,15 +200,23 @@ export const createBooksStore = ( // IndexedDB implementation being tested is incorrect, or that the testing code // is using it incorrectly. export async function checkStoreContents( - testCase: ExecutionContext, + testCase: any, store: IDBObjectStore, errorMessage: string, ) { const request = store.get(123456); const result = await promiseForRequest(testCase, request); - testCase.deepEqual(result.isbn, BOOKS_RECORD_DATA[0].isbn, errorMessage); - testCase.deepEqual(result.author, BOOKS_RECORD_DATA[0].author, errorMessage); - testCase.deepEqual(result.title, BOOKS_RECORD_DATA[0].title, errorMessage); + assert.deepStrictEqual(result.isbn, BOOKS_RECORD_DATA[0].isbn, errorMessage); + assert.deepStrictEqual( + result.author, + BOOKS_RECORD_DATA[0].author, + errorMessage, + ); + assert.deepStrictEqual( + result.title, + BOOKS_RECORD_DATA[0].title, + errorMessage, + ); } // Verifies that an object store's indexes match the indexes used to create the @@ -221,11 +226,11 @@ export async function checkStoreContents( // IndexedDB implementation being tested is incorrect, or that the testing code // is using it incorrectly. export function checkStoreIndexes( - testCase: ExecutionContext, + testCase: any, store: IDBObjectStore, errorMessage: string, ) { - testCase.deepEqual( + assert.deepStrictEqual( store.indexNames as any, ["by_author", "by_title"], errorMessage, @@ -245,14 +250,18 @@ export function checkStoreIndexes( // IndexedDB implementation being tested is incorrect, or that the testing code // is using it incorrectly. async function checkAuthorIndexContents( - testCase: ExecutionContext, + testCase: any, index: IDBIndex, errorMessage: string, ) { const request = index.get(BOOKS_RECORD_DATA[2].author); const result = await promiseForRequest(testCase, request); - testCase.deepEqual(result.isbn, BOOKS_RECORD_DATA[2].isbn, errorMessage); - testCase.deepEqual(result.title, BOOKS_RECORD_DATA[2].title, errorMessage); + assert.deepStrictEqual(result.isbn, BOOKS_RECORD_DATA[2].isbn, errorMessage); + assert.deepStrictEqual( + result.title, + BOOKS_RECORD_DATA[2].title, + errorMessage, + ); } // Verifies that an index matches the 'by_title' index used to create the books @@ -262,14 +271,18 @@ async function checkAuthorIndexContents( // IndexedDB implementation being tested is incorrect, or that the testing code // is using it incorrectly. async function checkTitleIndexContents( - testCase: ExecutionContext, + testCase: any, index: IDBIndex, errorMessage: string, ) { const request = index.get(BOOKS_RECORD_DATA[2].title); const result = await promiseForRequest(testCase, request); - testCase.deepEqual(result.isbn, BOOKS_RECORD_DATA[2].isbn, errorMessage); - testCase.deepEqual(result.author, BOOKS_RECORD_DATA[2].author, errorMessage); + assert.deepStrictEqual(result.isbn, BOOKS_RECORD_DATA[2].isbn, errorMessage); + assert.deepStrictEqual( + result.author, + BOOKS_RECORD_DATA[2].author, + errorMessage, + ); } // Verifies that an object store's key generator is in the same state as the @@ -279,7 +292,7 @@ async function checkTitleIndexContents( // IndexedDB implementation being tested is incorrect, or that the testing code // is using it incorrectly. export function checkStoreGenerator( - testCase: ExecutionContext, + testCase: any, store: IDBObjectStore, expectedKey: any, errorMessage: string, @@ -289,16 +302,13 @@ export function checkStoreGenerator( author: "Barney", }); return promiseForRequest(testCase, request).then((result) => { - testCase.deepEqual(result, expectedKey, errorMessage); + assert.deepStrictEqual(result, expectedKey, errorMessage); }); } // Creates a 'not_books' object store used to test renaming into existing or // deleted store names. -export function createNotBooksStore( - testCase: ExecutionContext, - database: IDBDatabase, -) { +export function createNotBooksStore(testCase: any, database: IDBDatabase) { const store = database.createObjectStore("not_books"); store.createIndex("not_by_author", "author"); store.createIndex("not_by_title", "title", { unique: true }); @@ -435,7 +445,7 @@ export function format_value(val: any, seen?: any): string { // }, // 'Test case description'); export function indexeddb_test( - t: ExecutionContext, + t: any, upgrade_func: ( done: () => void, db: IDBDatabase, @@ -455,25 +465,27 @@ export function indexeddb_test( const dbname = "testdb-" + new Date().getTime() + Math.random() + (dbsuffix ?? ""); var del = useTestIndexedDb().deleteDatabase(dbname); - del.onerror = () => t.fail("deleteDatabase should succeed"); + del.onerror = () => assert.fail("deleteDatabase should succeed"); var open = useTestIndexedDb().open(dbname, 1); open.onupgradeneeded = function () { var db = open.result; - t.teardown(function () { - // If open didn't succeed already, ignore the error. - open.onerror = function (e: any) { - e.preventDefault(); - }; - db.close(); - useTestIndexedDb().deleteDatabase(db.name); - }); + if (t.after) { + t.after(function () { + // If open didn't succeed already, ignore the error. + open.onerror = function (e: any) { + e.preventDefault(); + }; + db.close(); + useTestIndexedDb().deleteDatabase(db.name); + }); + } var tx = open.transaction!; upgrade_func(resolve, db, tx, open); }; if (options.upgrade_will_abort) { - open.onsuccess = () => t.fail("open should not succeed"); + open.onsuccess = () => assert.fail("open should not succeed"); } else { - open.onerror = () => t.fail("open should succeed"); + open.onerror = () => assert.fail("open should succeed"); open.onsuccess = function () { var db = open.result; if (open_func) open_func(resolve, db, open); @@ -488,11 +500,7 @@ export function indexeddb_test( * transaction has not already completed and then ends the request loop so that * the transaction may autocommit and complete. */ -export function keep_alive( - t: ExecutionContext, - tx: IDBTransaction, - store_name: string, -) { +export function keep_alive(t: any, tx: IDBTransaction, store_name: string) { let completed = false; tx.addEventListener("complete", () => { completed = true; @@ -512,8 +520,12 @@ export function keep_alive( spin(); return () => { - t.log("stopping spin"); - t.false(completed, "Transaction completed while kept alive"); + console.log("stopping spin"); + assert.strictEqual( + completed, + false, + "Transaction completed while kept alive", + ); keepSpinning = false; }; } @@ -521,7 +533,7 @@ export function keep_alive( // Checks to see if the passed transaction is active (by making // requests against the named store). export function is_transaction_active( - t: ExecutionContext, + t: any, tx: IDBTransaction, store_name: string, ) { @@ -534,7 +546,7 @@ export function is_transaction_active( return true; } catch (ex: any) { console.log(ex.stack); - t.deepEqual( + assert.deepStrictEqual( ex.name, "TransactionInactiveError", "Active check should either not throw anything, or throw " + diff --git a/packages/idb-bridge/src/node-helper-sqlite3-impl.test.ts b/packages/idb-bridge/src/node-helper-sqlite3-impl.test.ts @@ -14,11 +14,12 @@ permissions and limitations under the License. */ -import test from "ava"; +import { test } from "node:test"; +import assert from "node:assert"; import { createNodeHelperSqlite3Impl } from "./node-helper-sqlite3-impl.js"; // Serial test as it touches the FS. -test.serial("sqlite3 helper", async (t) => { +test("sqlite3 helper", async (t) => { const filename = ":memory:"; const impl = await createNodeHelperSqlite3Impl(); @@ -60,8 +61,8 @@ test.serial("sqlite3 helper", async (t) => { published: 1995, }); - t.deepEqual(r1.lastInsertRowid, 1n); - t.deepEqual(r2.lastInsertRowid, 2n); + assert.deepStrictEqual(r1.lastInsertRowid, 1n); + assert.deepStrictEqual(r2.lastInsertRowid, 2n); const r3 = await stmtCommit.run(); @@ -69,9 +70,7 @@ test.serial("sqlite3 helper", async (t) => { published: 1995, }); - t.deepEqual(getRes1.length, 2); - t.deepEqual(getRes1[0].title, "foo"); - t.deepEqual(getRes1[1].title, "foo4"); - - t.pass(); + assert.deepStrictEqual(getRes1.length, 2); + assert.deepStrictEqual(getRes1[0].title, "foo"); + assert.deepStrictEqual(getRes1[1].title, "foo4"); }); diff --git a/packages/idb-bridge/src/util/canInjectKey.test.ts b/packages/idb-bridge/src/util/canInjectKey.test.ts @@ -15,10 +15,11 @@ permissions and limitations under the License. */ -import test from "ava"; +import { test } from "node:test"; +import assert from "node:assert"; import { canInjectKey } from "./canInjectKey.js"; test("canInjectKey", (t) => { - t.false(canInjectKey("foo", null)); - t.true(canInjectKey("foo", {})); + assert.strictEqual(canInjectKey("foo", null), false); + assert.ok(canInjectKey("foo", {})); }); diff --git a/packages/idb-bridge/src/util/enforceRange.ts b/packages/idb-bridge/src/util/enforceRange.ts @@ -22,7 +22,7 @@ export const enforceRange = ( type: "MAX_SAFE_INTEGER" | "unsigned long", ) => { const min = 0; - const max = type === "unsigned long" ? 4294967295 : 9007199254740991; + const max = type === "unsigned long" ? 4294967295 : 9007199254740992; if (isNaN(num) || num < min || num > max) { throw new TypeError(); diff --git a/packages/idb-bridge/src/util/getIndexKeys.test.ts b/packages/idb-bridge/src/util/getIndexKeys.test.ts @@ -15,33 +15,38 @@ permissions and limitations under the License. */ -import test from "ava"; +import { test } from "node:test"; +import assert from "node:assert"; import { getIndexKeys } from "./getIndexKeys.js"; test("basics", (t) => { - t.deepEqual(getIndexKeys({ foo: 42 }, "foo", false), [42]); - t.deepEqual(getIndexKeys({ foo: { bar: 42 } }, "foo.bar", false), [42]); - t.deepEqual(getIndexKeys({ foo: [42, 43] }, "foo.0", false), [42]); - t.deepEqual(getIndexKeys({ foo: [42, 43] }, "foo.1", false), [43]); + assert.deepStrictEqual(getIndexKeys({ foo: 42 }, "foo", false), [42]); + assert.deepStrictEqual( + getIndexKeys({ foo: { bar: 42 } }, "foo.bar", false), + [42], + ); + assert.deepStrictEqual(getIndexKeys({ foo: [42, 43] }, "foo.0", false), [42]); + assert.deepStrictEqual(getIndexKeys({ foo: [42, 43] }, "foo.1", false), [43]); - t.deepEqual(getIndexKeys([1, 2, 3], "", false), [[1, 2, 3]]); + assert.deepStrictEqual(getIndexKeys([1, 2, 3], "", false), [[1, 2, 3]]); - t.deepEqual(getIndexKeys({ foo: 42 }, "foo.bar", false), []); + assert.deepStrictEqual(getIndexKeys({ foo: 42 }, "foo.bar", false), []); - t.deepEqual(getIndexKeys({ foo: 42 }, "foo", true), [42]); - t.deepEqual( + assert.deepStrictEqual(getIndexKeys({ foo: 42 }, "foo", true), [42]); + assert.deepStrictEqual( getIndexKeys({ foo: 42, bar: 10 }, ["foo", "bar"], true), [42, 10], ); - t.deepEqual(getIndexKeys({ foo: 42, bar: 10 }, ["foo", "bar"], false), [ - [42, 10], - ]); - t.deepEqual( + assert.deepStrictEqual( + getIndexKeys({ foo: 42, bar: 10 }, ["foo", "bar"], false), + [[42, 10]], + ); + assert.deepStrictEqual( getIndexKeys({ foo: 42, bar: 10 }, ["foo", "bar", "spam"], true), [42, 10], ); - t.throws(() => { + assert.throws(() => { getIndexKeys({ foo: 42, bar: 10 }, ["foo", "bar", "spam"], false); }); }); diff --git a/packages/idb-bridge/src/util/key-storage.test.ts b/packages/idb-bridge/src/util/key-storage.test.ts @@ -14,14 +14,15 @@ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ -import test, { ExecutionContext } from "ava"; +import { test } from "node:test"; +import assert from "node:assert"; import { deserializeKey, serializeKey } from "./key-storage.js"; import { IDBValidKey } from "../idbtypes.js"; -function checkKeySer(t: ExecutionContext, k: IDBValidKey): void { +function checkKeySer(t: any, k: IDBValidKey): void { const keyEnc = serializeKey(k); const keyDec = deserializeKey(keyEnc); - t.deepEqual(k, keyDec); + assert.deepStrictEqual(k, keyDec); } test("basics", (t) => { diff --git a/packages/idb-bridge/src/util/makeStoreKeyValue.test.ts b/packages/idb-bridge/src/util/makeStoreKeyValue.test.ts @@ -14,7 +14,8 @@ permissions and limitations under the License. */ -import test from "ava"; +import { test } from "node:test"; +import assert from "node:assert"; import { makeStoreKeyValue } from "./makeStoreKeyValue.js"; test("basics", (t) => { @@ -27,10 +28,10 @@ test("basics", (t) => { autoIncrement: true, keyPath: "id", }); - t.is(result.updatedKeyGenerator, 43); - t.is(result.key, 42); - t.is(result.value.name, "Florian"); - t.is(result.value.id, 42); + assert.strictEqual(result.updatedKeyGenerator, 43); + assert.strictEqual(result.key, 42); + assert.strictEqual(result.value.name, "Florian"); + assert.strictEqual(result.value.id, 42); result = makeStoreKeyValue({ value: { name: "Florian", id: 10 }, @@ -39,10 +40,10 @@ test("basics", (t) => { autoIncrement: true, keyPath: "id", }); - t.is(result.updatedKeyGenerator, 11); - t.is(result.key, 10); - t.is(result.value.name, "Florian"); - t.is(result.value.id, 10); + assert.strictEqual(result.updatedKeyGenerator, 11); + assert.strictEqual(result.key, 10); + assert.strictEqual(result.value.name, "Florian"); + assert.strictEqual(result.value.id, 10); result = makeStoreKeyValue({ value: { name: "Florian", id: 5 }, @@ -51,10 +52,10 @@ test("basics", (t) => { autoIncrement: true, keyPath: "id", }); - t.is(result.updatedKeyGenerator, 10); - t.is(result.key, 5); - t.is(result.value.name, "Florian"); - t.is(result.value.id, 5); + assert.strictEqual(result.updatedKeyGenerator, 10); + assert.strictEqual(result.key, 5); + assert.strictEqual(result.value.name, "Florian"); + assert.strictEqual(result.value.id, 5); result = makeStoreKeyValue({ value: { name: "Florian", id: "foo" }, @@ -63,10 +64,10 @@ test("basics", (t) => { autoIncrement: true, keyPath: "id", }); - t.is(result.updatedKeyGenerator, 10); - t.is(result.key, "foo"); - t.is(result.value.name, "Florian"); - t.is(result.value.id, "foo"); + assert.strictEqual(result.updatedKeyGenerator, 10); + assert.strictEqual(result.key, "foo"); + assert.strictEqual(result.value.name, "Florian"); + assert.strictEqual(result.value.id, "foo"); result = makeStoreKeyValue({ value: { name: "Florian" }, @@ -75,10 +76,10 @@ test("basics", (t) => { autoIncrement: true, keyPath: null, }); - t.is(result.updatedKeyGenerator, 10); - t.is(result.key, "foo"); - t.is(result.value.name, "Florian"); - t.is(result.value.id, undefined); + assert.strictEqual(result.updatedKeyGenerator, 10); + assert.strictEqual(result.key, "foo"); + assert.strictEqual(result.value.name, "Florian"); + assert.strictEqual(result.value.id, undefined); result = makeStoreKeyValue({ value: { name: "Florian" }, @@ -87,8 +88,8 @@ test("basics", (t) => { autoIncrement: true, keyPath: null, }); - t.is(result.updatedKeyGenerator, 11); - t.is(result.key, 10); - t.is(result.value.name, "Florian"); - t.is(result.value.id, undefined); + assert.strictEqual(result.updatedKeyGenerator, 11); + assert.strictEqual(result.key, 10); + assert.strictEqual(result.value.name, "Florian"); + assert.strictEqual(result.value.id, undefined); }); diff --git a/packages/idb-bridge/src/util/structuredClone.test.ts b/packages/idb-bridge/src/util/structuredClone.test.ts @@ -14,15 +14,16 @@ permissions and limitations under the License. */ -import test, { ExecutionContext } from "ava"; +import { test } from "node:test"; +import assert from "node:assert"; import { structuredClone, structuredEncapsulate, structuredRevive, } from "./structuredClone.js"; -function checkClone(t: ExecutionContext, x: any): void { - t.deepEqual(structuredClone(x), x); +function checkClone(t: any, x: any): void { + assert.deepStrictEqual(structuredClone(x), x); } test("structured clone", (t) => { @@ -37,16 +38,16 @@ test("structured clone", (t) => { checkClone(t, undefined); checkClone(t, [undefined]); - t.throws(() => { + assert.throws(() => { structuredClone({ foo: () => {} }); }); - t.throws(() => { + assert.throws(() => { structuredClone(Promise); }); - t.throws(() => { - structuredClone(Promise.resolve()); + assert.throws(() => { + structuredClone(Promise.resolve(undefined)); }); }); @@ -54,30 +55,36 @@ test("structured clone (array cycles)", (t) => { const obj1: any[] = [1, 2]; obj1.push(obj1); const obj1Clone = structuredClone(obj1); - t.is(obj1Clone, obj1Clone[2]); + assert.strictEqual(obj1Clone, obj1Clone[2]); }); test("structured clone (object cycles)", (t) => { const obj1: any = { a: 1, b: 2 }; obj1.c = obj1; const obj1Clone = structuredClone(obj1); - t.is(obj1Clone, obj1Clone.c); + assert.strictEqual(obj1Clone, obj1Clone.c); }); test("encapsulate", (t) => { - t.deepEqual(structuredEncapsulate(42), 42); - t.deepEqual(structuredEncapsulate(true), true); - t.deepEqual(structuredEncapsulate(false), false); - t.deepEqual(structuredEncapsulate(null), null); - - t.deepEqual(structuredEncapsulate(undefined), { $: "undef" }); - t.deepEqual(structuredEncapsulate(42n), { $: "bigint", val: "42" }); + assert.deepStrictEqual(structuredEncapsulate(42), 42); + assert.deepStrictEqual(structuredEncapsulate(true), true); + assert.deepStrictEqual(structuredEncapsulate(false), false); + assert.deepStrictEqual(structuredEncapsulate(null), null); + + assert.deepStrictEqual(structuredEncapsulate(undefined), { $: "undef" }); + assert.deepStrictEqual(structuredEncapsulate(42n), { + $: "bigint", + val: "42", + }); - t.deepEqual(structuredEncapsulate(new Date(42)), { $: "date", val: 42 }); + assert.deepStrictEqual(structuredEncapsulate(new Date(42)), { + $: "date", + val: 42, + }); - t.deepEqual(structuredEncapsulate({ x: 42 }), { x: 42 }); + assert.deepStrictEqual(structuredEncapsulate({ x: 42 }), { x: 42 }); - t.deepEqual(structuredEncapsulate({ $: "bla", x: 42 }), { + assert.deepStrictEqual(structuredEncapsulate({ $: "bla", x: 42 }), { $: "obj", val: { $: "bla", x: 42 }, }); @@ -85,7 +92,7 @@ test("encapsulate", (t) => { const x = { foo: 42, bar: {} } as any; x.bar.baz = x; - t.deepEqual(structuredEncapsulate(x), { + assert.deepStrictEqual(structuredEncapsulate(x), { foo: 42, bar: { baz: { $: "ref", d: 2, p: [] }, @@ -94,15 +101,20 @@ test("encapsulate", (t) => { }); test("revive", (t) => { - t.deepEqual(structuredRevive(42), 42); - t.deepEqual(structuredRevive([1, 2, 3]), [1, 2, 3]); - t.deepEqual(structuredRevive(true), true); - t.deepEqual(structuredRevive(false), false); - t.deepEqual(structuredRevive(null), null); - t.deepEqual(structuredRevive({ $: "undef" }), undefined); - t.deepEqual(structuredRevive({ x: { $: "undef" } }), { x: undefined }); + assert.deepStrictEqual(structuredRevive(42), 42); + assert.deepStrictEqual(structuredRevive([1, 2, 3]), [1, 2, 3]); + assert.deepStrictEqual(structuredRevive(true), true); + assert.deepStrictEqual(structuredRevive(false), false); + assert.deepStrictEqual(structuredRevive(null), null); + assert.deepStrictEqual(structuredRevive({ $: "undef" }), undefined); + assert.deepStrictEqual(structuredRevive({ x: { $: "undef" } }), { + x: undefined, + }); - t.deepEqual(structuredRevive({ $: "date", val: 42 }), new Date(42)); + assert.deepStrictEqual( + structuredRevive({ $: "date", val: 42 }), + new Date(42), + ); { const x = { foo: 42, bar: {} } as any; @@ -115,6 +127,6 @@ test("revive", (t) => { }, }; - t.deepEqual(structuredRevive(r), x); + assert.deepStrictEqual(structuredRevive(r), x); } }); diff --git a/packages/idb-bridge/src/util/structuredClone.ts b/packages/idb-bridge/src/util/structuredClone.ts @@ -214,7 +214,7 @@ export function mkDeepCloneCheckOnly() { } else { var index = refs.indexOf(cur); if (index !== -1) { - // do nothing + throw new DataCloneError(); } else { clone(cur); } @@ -248,7 +248,7 @@ export function mkDeepCloneCheckOnly() { } else { var i = refs.indexOf(cur); if (i !== -1) { - // do nothing + throw new DataCloneError(); } else { clone(cur); } diff --git a/packages/idb-bridge/tsconfig.json b/packages/idb-bridge/tsconfig.json @@ -1,10 +1,16 @@ { "extends": "../../tsconfig.defaults.json", "compilerOptions": { - "lib": ["ES2020"], - "types": ["node"], + "lib": [ + "ES2020" + ], + "types": [ + "node" + ], "outDir": "lib", "rootDir": "./src" }, - "include": ["src/**/*"] + "include": [ + "src/**/*" + ] } diff --git a/packages/pogen/package.json b/packages/pogen/package.json @@ -8,13 +8,12 @@ "license": "GPL-2.0+", "scripts": { "clean": "rm -rf lib", - "test": "tsc && ava", + "test": "tsc && node --test lib/*.test.js lib/**/*.test.js", "compile": "tsc" }, "type": "module", "devDependencies": { "@types/gettext-parser": "^4.0.3", - "ava": "^8.0.0", "typescript": "^6.0.3" }, "dependencies": { @@ -22,10 +21,5 @@ "gettext-parser": "^8.0.0", "glob": "^13.0.6", "tslib": "^2.8.1" - }, - "ava": { - "files": [ - "lib/**/*test.*" - ] } } diff --git a/packages/pogen/src/potextract.test.ts b/packages/pogen/src/potextract.test.ts @@ -14,7 +14,8 @@ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ -import test from "ava"; +import { test } from "node:test"; +import assert from "node:assert"; import * as ts from "typescript"; import { processFileForTesting } from "./potextract.js"; @@ -37,7 +38,7 @@ function process(src: string): string { } test("should extract the key from inner body", (t) => { - t.deepEqual( + assert.deepStrictEqual( process(`<i18n.Translate>something</i18n.Translate>`), `#. screenid: 5 #: test.tsx:4 @@ -48,7 +49,7 @@ msgstr ""`, }); test("should support context on tags", (t) => { - t.deepEqual( + assert.deepStrictEqual( process( `return <div> <i18n.Translate context="some_context" anotherkey="not the context" asd={"asd"} zxc={asd()}>something</i18n.Translate> @@ -64,7 +65,7 @@ msgstr ""`, }); test("should support context on string template", (t) => { - t.deepEqual( + assert.deepStrictEqual( process(`return i18n.context("wire transfer")\`send\`;`), `#. screenid: 5 #: test.tsx:4 @@ -76,7 +77,7 @@ msgstr ""`, }); test("should support same message id with different context", (t) => { - t.deepEqual( + assert.deepStrictEqual( process( `return i18n.context("wire transfer")\`send\` + i18n.context("gift")\`send\`;`, ), @@ -97,7 +98,7 @@ msgstr ""`, }); test("should support on string template", (t) => { - t.deepEqual( + assert.deepStrictEqual( process(` // comment of the translation return i18n.str\`another key\`;`), @@ -111,7 +112,7 @@ msgstr ""`, }); test("should override screen id", (t) => { - t.deepEqual( + assert.deepStrictEqual( process(` { const TALER_SCREEN_ID = 6; @@ -130,7 +131,7 @@ msgstr ""`, test("should support nested tags", (t) => { - t.deepEqual( + assert.deepStrictEqual( process(` <p class="warning"> <i18n.Translate> diff --git a/packages/pogen/tsconfig.json b/packages/pogen/tsconfig.json @@ -3,8 +3,14 @@ "compilerOptions": { "outDir": "lib", "rootDir": "./src", - "lib": ["ES2020"], - "types": ["node"] + "lib": [ + "ES2020" + ], + "types": [ + "node" + ] }, - "include": ["src/**/*.ts"] + "include": [ + "src/**/*.ts" + ] } diff --git a/packages/taler-harness/src/lint.ts b/packages/taler-harness/src/lint.ts @@ -112,7 +112,7 @@ export async function sh( } }); proc.stderr.on("data", (x) => { - if (x instanceof Uint8Array) { + if (x instanceof Uint8Array) { stderrChunks.push(x); } else { throw Error("unexpected data chunk type"); diff --git a/packages/taler-util/package.json b/packages/taler-util/package.json @@ -62,8 +62,8 @@ }, "scripts": { "compile": "tsc", - "test": "tsc && ava", - "coverage": "tsc && c8 --src src --all ava", + "test": "tsc && node --test lib/*.test.js lib/**/*.test.js", + "coverage": "tsc && c8 --src src --all node --test lib/*.test.js lib/**/*.test.js", "clean": "rm -rf dist lib tsconfig.tsbuildinfo", "typedoc": "typedoc --out dist/typedoc ./src/", "pretty": "prettier --write src" @@ -71,7 +71,6 @@ "devDependencies": { "@types/follow-redirects": "^1.14.4", "@types/node": "^18.11.17", - "ava": "^8.0.0", "c8": "^11.0.0", "esbuild": "^0.28.0", "typescript": "^6.0.3" @@ -83,10 +82,5 @@ "hash-wasm": "^4.11.0", "jed": "^1.1.1", "tslib": "^2.6.2" - }, - "ava": { - "files": [ - "lib/**/*test.js" - ] } } diff --git a/packages/taler-util/src/aml/events.test.ts b/packages/taler-util/src/aml/events.test.ts @@ -14,12 +14,13 @@ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ -import test from "ava"; +import { test } from "node:test"; +import assert from "node:assert"; import { deriveTopsAmlEvents } from "./events.js"; test("AML event derivation for TOPS, unknown form", (t) => { const events = deriveTopsAmlEvents("some_unknown_form", {}, {}, {}); - t.deepEqual([...events], []); + assert.deepStrictEqual([...events], []); }); test("AML event derivation for TOPS, vqf_902_1_officer", (t) => { @@ -32,7 +33,7 @@ test("AML event derivation for TOPS, vqf_902_1_officer", (t) => { ACCOUNT_OPEN: true, }, ); - t.deepEqual([...events], ["INCR_ACCOUNT_OPEN"]); + assert.deepStrictEqual([...events], ["INCR_ACCOUNT_OPEN"]); } { @@ -47,7 +48,7 @@ test("AML event derivation for TOPS, vqf_902_1_officer", (t) => { ACCOUNT_OPEN: true, }, ); - t.deepEqual([...events], []); + assert.deepStrictEqual([...events], []); } { @@ -60,7 +61,7 @@ test("AML event derivation for TOPS, vqf_902_1_officer", (t) => { PEP_FOREIGN: true, }, ); - t.deepEqual( + assert.deepStrictEqual( [...events], ["INCR_ACCOUNT_OPEN", "INCR_PEP", "INCR_PEP_FOREIGN"], ); @@ -78,7 +79,7 @@ test("AML event derivation for TOPS, vqf_902_4", (t) => { PEP_FOREIGN: true, }, ); - t.deepEqual([...events], []); + assert.deepStrictEqual([...events], []); } { const events = deriveTopsAmlEvents( @@ -91,7 +92,7 @@ test("AML event derivation for TOPS, vqf_902_4", (t) => { PEP_FOREIGN: true, }, ); - t.deepEqual([...events], ["INCR_PEP", "INCR_PEP_FOREIGN"]); + assert.deepStrictEqual([...events], ["INCR_PEP", "INCR_PEP_FOREIGN"]); } { const events = deriveTopsAmlEvents( @@ -105,6 +106,6 @@ test("AML event derivation for TOPS, vqf_902_4", (t) => { PEP_FOREIGN: false, }, ); - t.deepEqual([...events], ["DECR_PEP", "DECR_PEP_FOREIGN"]); + assert.deepStrictEqual([...events], ["DECR_PEP", "DECR_PEP_FOREIGN"]); } }); diff --git a/packages/taler-util/src/aml/properties.test.ts b/packages/taler-util/src/aml/properties.test.ts @@ -14,7 +14,8 @@ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ -import test from "ava"; +import { test } from "node:test"; +import assert from "node:assert"; import { TalerAmlProperties } from "../taler-account-properties.js"; import { TalerFormAttributes } from "../taler-form-attributes.js"; import { deriveTopsAmlProperties } from "./properties.js"; @@ -22,7 +23,7 @@ import { deriveTopsAmlProperties } from "./properties.js"; test("AML prop derivation for TOPS, unknown form", (t) => { { const props = deriveTopsAmlProperties("custom_does_not_exist132", {}, {}); - t.deepEqual(props, {}); + assert.deepStrictEqual(props, {}); } }); @@ -37,7 +38,7 @@ test("AML prop derivation for TOPS, vqf_902_4", (t) => { PEP_FOREIGN: true, }, ); - t.deepEqual(props, { + assert.deepStrictEqual(props, { [TalerAmlProperties.PEP_DOMESTIC]: false, [TalerAmlProperties.PEP_INTERNATIONAL_ORGANIZATION]: false, [TalerAmlProperties.HIGH_RISK_CUSTOMER]: true, @@ -51,7 +52,7 @@ test("AML prop derivation for TOPS, vqf_902_4", (t) => { test("AML prop derivation for TOPS, vqf_902_1_officer", (t) => { { const props = deriveTopsAmlProperties("vqf_902_1_officer", {}, {}); - t.deepEqual(props, { + assert.deepStrictEqual(props, { [TalerAmlProperties.ACCOUNT_OPEN]: true, }); } diff --git a/packages/taler-util/src/amounts.test.ts b/packages/taler-util/src/amounts.test.ts @@ -14,7 +14,8 @@ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ -import test from "ava"; +import { test } from "node:test"; +import assert from "node:assert"; import { Amounts, AmountJson, amountMaxValue } from "./amounts.js"; import { AmountString } from "./types-taler-common.js"; @@ -31,160 +32,158 @@ test("amount addition (simple)", (t) => { const a1 = jAmt(1, 0, "EUR"); const a2 = jAmt(1, 0, "EUR"); const a3 = jAmt(2, 0, "EUR"); - t.true(0 === Amounts.cmp(Amounts.add(a1, a2).amount, a3)); - t.pass(); + assert.ok(0 === Amounts.cmp(Amounts.add(a1, a2).amount, a3)); }); test("amount addition (saturation)", (t) => { const a1 = jAmt(1, 0, "EUR"); const res = Amounts.add(jAmt(amountMaxValue, 0, "EUR"), a1); - t.true(res.saturated); - t.pass(); + assert.ok(res.saturated); }); test("amount subtraction (simple)", (t) => { const a1 = jAmt(2, 5, "EUR"); const a2 = jAmt(1, 0, "EUR"); const a3 = jAmt(1, 5, "EUR"); - t.true(0 === Amounts.cmp(Amounts.sub(a1, a2).amount, a3)); - t.pass(); + assert.ok(0 === Amounts.cmp(Amounts.sub(a1, a2).amount, a3)); }); test("amount subtraction (saturation)", (t) => { const a1 = jAmt(0, 0, "EUR"); const a2 = jAmt(1, 0, "EUR"); let res = Amounts.sub(a1, a2); - t.true(res.saturated); + assert.ok(res.saturated); res = Amounts.sub(a1, a1); - t.true(!res.saturated); - t.pass(); + assert.ok(!res.saturated); }); test("amount comparison", (t) => { - t.is(Amounts.cmp(jAmt(1, 0, "EUR"), jAmt(1, 0, "EUR")), 0); - t.is(Amounts.cmp(jAmt(1, 1, "EUR"), jAmt(1, 0, "EUR")), 1); - t.is(Amounts.cmp(jAmt(1, 1, "EUR"), jAmt(1, 2, "EUR")), -1); - t.is(Amounts.cmp(jAmt(1, 0, "EUR"), jAmt(0, 0, "EUR")), 1); - t.is(Amounts.cmp(jAmt(0, 0, "EUR"), jAmt(1, 0, "EUR")), -1); - t.is(Amounts.cmp(jAmt(1, 0, "EUR"), jAmt(0, 100000000, "EUR")), 0); - t.throws(() => Amounts.cmp(jAmt(1, 0, "FOO"), jAmt(1, 0, "BAR"))); - t.pass(); + assert.strictEqual(Amounts.cmp(jAmt(1, 0, "EUR"), jAmt(1, 0, "EUR")), 0); + assert.strictEqual(Amounts.cmp(jAmt(1, 1, "EUR"), jAmt(1, 0, "EUR")), 1); + assert.strictEqual(Amounts.cmp(jAmt(1, 1, "EUR"), jAmt(1, 2, "EUR")), -1); + assert.strictEqual(Amounts.cmp(jAmt(1, 0, "EUR"), jAmt(0, 0, "EUR")), 1); + assert.strictEqual(Amounts.cmp(jAmt(0, 0, "EUR"), jAmt(1, 0, "EUR")), -1); + assert.strictEqual( + Amounts.cmp(jAmt(1, 0, "EUR"), jAmt(0, 100000000, "EUR")), + 0, + ); + assert.throws(() => Amounts.cmp(jAmt(1, 0, "FOO"), jAmt(1, 0, "BAR"))); }); test("amount parsing", (t) => { - t.is( + assert.strictEqual( Amounts.cmp(Amounts.parseOrThrow("TESTKUDOS:0"), jAmt(0, 0, "TESTKUDOS")), 0, ); - t.is( + assert.strictEqual( Amounts.cmp(Amounts.parseOrThrow("TESTKUDOS:10"), jAmt(10, 0, "TESTKUDOS")), 0, ); - t.is( + assert.strictEqual( Amounts.cmp( Amounts.parseOrThrow("TESTKUDOS:0.1"), jAmt(0, 10000000, "TESTKUDOS"), ), 0, ); - t.is( + assert.strictEqual( Amounts.cmp( Amounts.parseOrThrow("TESTKUDOS:0.00000001"), jAmt(0, 1, "TESTKUDOS"), ), 0, ); - t.is( + assert.strictEqual( Amounts.cmp( Amounts.parseOrThrow("TESTKUDOS:4503599627370496.99999999"), jAmt(4503599627370496, 99999999, "TESTKUDOS"), ), 0, ); - t.throws(() => Amounts.parseOrThrow("foo:")); - t.throws(() => Amounts.parseOrThrow("1.0")); - t.throws(() => Amounts.parseOrThrow("42")); - t.throws(() => Amounts.parseOrThrow(":1.0")); - t.throws(() => Amounts.parseOrThrow(":42")); - t.throws(() => Amounts.parseOrThrow("EUR:.42")); - t.throws(() => Amounts.parseOrThrow("EUR:42.")); - t.throws(() => Amounts.parseOrThrow("TESTKUDOS:4503599627370497.99999999")); - t.is( + assert.throws(() => Amounts.parseOrThrow("foo:")); + assert.throws(() => Amounts.parseOrThrow("1.0")); + assert.throws(() => Amounts.parseOrThrow("42")); + assert.throws(() => Amounts.parseOrThrow(":1.0")); + assert.throws(() => Amounts.parseOrThrow(":42")); + assert.throws(() => Amounts.parseOrThrow("EUR:.42")); + assert.throws(() => Amounts.parseOrThrow("EUR:42.")); + assert.throws(() => + Amounts.parseOrThrow("TESTKUDOS:4503599627370497.99999999"), + ); + assert.strictEqual( Amounts.cmp( Amounts.parseOrThrow("TESTKUDOS:0.99999999"), jAmt(0, 99999999, "TESTKUDOS"), ), 0, ); - t.throws(() => Amounts.parseOrThrow("TESTKUDOS:0.999999991")); - t.pass(); + assert.throws(() => Amounts.parseOrThrow("TESTKUDOS:0.999999991")); }); test("amount stringification", (t) => { - t.is( + assert.strictEqual( Amounts.stringify(jAmt(0, 0, "TESTKUDOS")), "TESTKUDOS:0" as AmountString, ); - t.is( + assert.strictEqual( Amounts.stringify(jAmt(4, 94000000, "TESTKUDOS")), "TESTKUDOS:4.94" as AmountString, ); - t.is( + assert.strictEqual( Amounts.stringify(jAmt(0, 10000000, "TESTKUDOS")), "TESTKUDOS:0.1" as AmountString, ); - t.is( + assert.strictEqual( Amounts.stringify(jAmt(0, 1, "TESTKUDOS")), "TESTKUDOS:0.00000001" as AmountString, ); - t.is( + assert.strictEqual( Amounts.stringify(jAmt(5, 0, "TESTKUDOS")), "TESTKUDOS:5" as AmountString, ); // denormalized - t.is( + assert.strictEqual( Amounts.stringify(jAmt(1, 100000000, "TESTKUDOS")), "TESTKUDOS:2" as AmountString, ); - t.pass(); }); test("amount multiplication", (t) => { - t.is( + assert.strictEqual( Amounts.stringify(Amounts.mult(sAmt("EUR:1.11"), 0).amount), "EUR:0" as AmountString, ); - t.is( + assert.strictEqual( Amounts.stringify(Amounts.mult(sAmt("EUR:1.11"), 1).amount), "EUR:1.11" as AmountString, ); - t.is( + assert.strictEqual( Amounts.stringify(Amounts.mult(sAmt("EUR:1.11"), 2).amount), "EUR:2.22" as AmountString, ); - t.is( + assert.strictEqual( Amounts.stringify(Amounts.mult(sAmt("EUR:1.11"), 3).amount), "EUR:3.33" as AmountString, ); - t.is( + assert.strictEqual( Amounts.stringify(Amounts.mult(sAmt("EUR:1.11"), 4).amount), "EUR:4.44" as AmountString, ); - t.is( + assert.strictEqual( Amounts.stringify(Amounts.mult(sAmt("EUR:1.11"), 5).amount), "EUR:5.55" as AmountString, ); }); test("amount division", (t) => { - t.is(Amounts.divmod("EUR:5", "EUR:1").quotient, 5); - t.is( + assert.strictEqual(Amounts.divmod("EUR:5", "EUR:1").quotient, 5); + assert.strictEqual( Amounts.stringify(Amounts.divmod("EUR:5", "EUR:1").remainder), "EUR:0" as AmountString, ); - t.is(Amounts.divmod("EUR:5", "EUR:2").quotient, 2); - t.is( + assert.strictEqual(Amounts.divmod("EUR:5", "EUR:2").quotient, 2); + assert.strictEqual( Amounts.stringify(Amounts.divmod("EUR:5", "EUR:2").remainder), "EUR:1" as AmountString, ); diff --git a/packages/taler-util/src/bitcoin.test.ts b/packages/taler-util/src/bitcoin.test.ts @@ -18,7 +18,8 @@ * Type-safe codecs for converting from/to JSON. */ -import test from "ava"; +import { test } from "node:test"; +import assert from "node:assert"; import { generateFakeSegwitAddress } from "./bitcoin.js"; import { Paytos } from "./payto.js"; import { Result } from "./result.js"; @@ -35,8 +36,8 @@ test("generate testnet", (t) => { ), ); - t.assert(addr1 === "tb1qtfwqwaj6tsrhdtvuyhflr6nklm8ldqxpf0lfjw"); - t.assert(addr2 === "tb1qmfwqwa5vr5vdac6wr20ts76aewakzpmns40yuf"); + assert.ok(addr1 === "tb1qtfwqwaj6tsrhdtvuyhflr6nklm8ldqxpf0lfjw"); + assert.ok(addr2 === "tb1qmfwqwa5vr5vdac6wr20ts76aewakzpmns40yuf"); }); test("generate mainnet", (t) => { @@ -51,8 +52,8 @@ test("generate mainnet", (t) => { ), ); //bc - t.assert(addr1 === "bc1qtfwqwaj6tsrhdtvuyhflr6nklm8ldqxprfy6fa"); - t.assert(addr2 === "bc1qmfwqwa5vr5vdac6wr20ts76aewakzpmn6n5h86"); + assert.ok(addr1 === "bc1qtfwqwaj6tsrhdtvuyhflr6nklm8ldqxprfy6fa"); + assert.ok(addr2 === "bc1qmfwqwa5vr5vdac6wr20ts76aewakzpmn6n5h86"); }); test("generate Regtest", (t) => { @@ -67,12 +68,12 @@ test("generate Regtest", (t) => { ), ); - t.assert(addr1 === "bcrt1qtfwqwaj6tsrhdtvuyhflr6nklm8ldqxptxxy98"); - t.assert(addr2 === "bcrt1qmfwqwa5vr5vdac6wr20ts76aewakzpmnjukftq"); + assert.ok(addr1 === "bcrt1qtfwqwaj6tsrhdtvuyhflr6nklm8ldqxptxxy98"); + assert.ok(addr2 === "bcrt1qmfwqwa5vr5vdac6wr20ts76aewakzpmnjukftq"); }); test("unknown net", (t) => { - t.throws(() => { + assert.throws(() => { Result.unpack( generateFakeSegwitAddress( Result.unpack( @@ -90,71 +91,71 @@ test("invalid or no reserve", (t) => { let result = undefined; { const result = Paytos.parseReservePub(""); - t.assert(!Result.isOk(result)); + assert.ok(!Result.isOk(result)); } // empty // result = generateFakeSegwitAddress( // "", // "bcrtqhxrhccqexg0dv4nltgkuw4fg2ce7muplmjsn0v", // ); - // t.deepEqual(result, []); + // assert.deepStrictEqual(result, []); { const result = Paytos.parseReservePub("s"); - t.assert(!Result.isOk(result)); + assert.ok(!Result.isOk(result)); } // small // result = generateFakeSegwitAddress( // "s", // "bcrtqhxrhccqexg0dv4nltgkuw4fg2ce7muplmjsn0v", // ); - // t.deepEqual(result, []); + // assert.deepStrictEqual(result, []); { const result = Paytos.parseReservePub("asdsad"); - t.assert(!Result.isOk(result)); + assert.ok(!Result.isOk(result)); } // result = generateFakeSegwitAddress( // "asdsad", // "bcrtqhxrhccqexg0dv4nltgkuw4fg2ce7muplmjsn0v", // ); - // t.deepEqual(result, []); + // assert.deepStrictEqual(result, []); { const result = Paytos.parseReservePub("asdasdasdasdasdasd"); - t.assert(!Result.isOk(result)); + assert.ok(!Result.isOk(result)); } // result = generateFakeSegwitAddress( // "asdasdasdasdasdasd", // "bcrtqhxrhccqexg0dv4nltgkuw4fg2ce7muplmjsn0v", // ); - // t.deepEqual(result, []); + // assert.deepStrictEqual(result, []); { const result = Paytos.parseReservePub( "B9E0EXNDKGJX7WFAEVZCZXM0R661T66YWD71N7NRFDEWQEV10XS", ); - t.assert(!Result.isOk(result)); + assert.ok(!Result.isOk(result)); } // result = generateFakeSegwitAddress( // "B9E0EXNDKGJX7WFAEVZCZXM0R661T66YWD71N7NRFDEWQEV10XS", // "bcrtqhxrhccqexg0dv4nltgkuw4fg2ce7muplmjsn0v", // ); - // t.deepEqual(result, []); + // assert.deepStrictEqual(result, []); { const result = Paytos.parseReservePub( "B9E0EXNDKGJX7WFAEVZCZXM0R661T66YWD71N7NRFDEWQEV10XSSSS", ); - t.assert(!Result.isOk(result)); + assert.ok(!Result.isOk(result)); } // result = generateFakeSegwitAddress( // "B9E0EXNDKGJX7WFAEVZCZXM0R661T66YWD71N7NRFDEWQEV10XSSSS", // "bcrtqhxrhccqexg0dv4nltgkuw4fg2ce7muplmjsn0v", // ); - // t.deepEqual(result, []); + // assert.deepStrictEqual(result, []); { const result = Paytos.parseReservePub(undefined); - t.assert(!Result.isOk(result)); + assert.ok(!Result.isOk(result)); } // no reserve @@ -162,17 +163,17 @@ test("invalid or no reserve", (t) => { // undefined, // "bcrtqhxrhccqexg0dv4nltgkuw4fg2ce7muplmjsn0v", // ); - // t.deepEqual(result, []); + // assert.deepStrictEqual(result, []); { const result = Paytos.parseReservePub( "B9E0EXNDKGJX7WFAEVZCZXM0R661T66YWD71N7NRFDEWQEV10XS-", ); - t.assert(!Result.isOk(result)); + assert.ok(!Result.isOk(result)); } // result = generateFakeSegwitAddress( // "B9E0EXNDKGJX7WFAEVZCZXM0R661T66YWD71N7NRFDEWQEV10XS-", // "bcrtqhxrhccqexg0dv4nltgkuw4fg2ce7muplmjsn0v", // ); - // t.deepEqual(result, []); + // assert.deepStrictEqual(result, []); }); diff --git a/packages/taler-util/src/clk.test.ts b/packages/taler-util/src/clk.test.ts @@ -18,7 +18,8 @@ * Type-safe codecs for converting from/to JSON. */ -import test from "ava"; +import { test } from "node:test"; +import assert from "node:assert"; import { clk } from "./clk.js"; test("bla", (t) => { @@ -30,10 +31,10 @@ test("bla", (t) => { prog.maybeOption("opt1", ["-o", "--opt1"], clk.INT).action((args) => { success = true; - t.deepEqual(args.foo.opt1, 42); + assert.deepStrictEqual(args.foo.opt1, 42); }); prog.run(["bla", "-o", "42"]); - t.true(success); + assert.ok(success); }); diff --git a/packages/taler-util/src/codec.test.ts b/packages/taler-util/src/codec.test.ts @@ -18,7 +18,8 @@ * Type-safe codecs for converting from/to JSON. */ -import test from "ava"; +import { test } from "node:test"; +import assert from "node:assert"; import { Codec, buildCodecForObject, @@ -48,9 +49,9 @@ test("basic codec", (t) => { .property("foo", codecForString()) .build("MyObj"); const res = myObjCodec.decode({ foo: "hello" }); - t.assert(res.foo === "hello"); + assert.ok(res.foo === "hello"); - t.throws(() => { + assert.throws(() => { myObjCodec.decode({ foo: 123 }); }); }); @@ -71,8 +72,8 @@ test("union", (t) => { .build<MyUnion>("MyUnion"); const res = myUnionCodec.decode({ type: "one", foo: "bla" }); - t.is(res.type, "one"); + assert.strictEqual(res.type, "one"); if (res.type == "one") { - t.is(res.foo, "bla"); + assert.strictEqual(res.foo, "bla"); } }); diff --git a/packages/taler-util/src/contract-terms.test.ts b/packages/taler-util/src/contract-terms.test.ts @@ -17,7 +17,8 @@ /** * Imports. */ -import test from "ava"; +import { test } from "node:test"; +import assert from "node:assert"; import { initNodePrng } from "./prng-node.js"; import { ContractTermsUtil } from "./contract-terms.js"; @@ -36,20 +37,20 @@ test("contract terms canon hashing", (t) => { const c1 = ContractTermsUtil.saltForgettable(cReq); const c2 = ContractTermsUtil.saltForgettable(cReq); - t.assert(typeof cReq.$forgettable.foo === "boolean"); - t.assert(typeof c1.$forgettable.foo === "string"); - t.assert(c1.$forgettable.foo !== c2.$forgettable.foo); + assert.ok(typeof cReq.$forgettable.foo === "boolean"); + assert.ok(typeof c1.$forgettable.foo === "string"); + assert.ok(c1.$forgettable.foo !== c2.$forgettable.foo); const h1 = ContractTermsUtil.hashContractTerms(c1); const c3 = ContractTermsUtil.scrub(JSON.parse(JSON.stringify(c1))); - t.assert(c3.foo === undefined); - t.assert(c3.bar === cReq.bar); + assert.ok(c3.foo === undefined); + assert.ok(c3.bar === cReq.bar); const h2 = ContractTermsUtil.hashContractTerms(c3); - t.deepEqual(h1, h2); + assert.deepStrictEqual(h1, h2); }); test("contract terms canon hashing (nested)", (t) => { @@ -68,8 +69,8 @@ test("contract terms canon hashing (nested)", (t) => { const c1 = ContractTermsUtil.saltForgettable(cReq); - t.is(typeof c1.$forgettable.bar, "string"); - t.is(typeof c1.bar.$forgettable.prop1, "string"); + assert.strictEqual(typeof c1.$forgettable.bar, "string"); + assert.strictEqual(typeof c1.bar.$forgettable.prop1, "string"); const forgetPath = (x: any, s: string) => ContractTermsUtil.forgetAll(x, (p) => p.join(".") === s); @@ -88,17 +89,17 @@ test("contract terms canon hashing (nested)", (t) => { const h3 = ContractTermsUtil.hashContractTerms(c3); const h4 = ContractTermsUtil.hashContractTerms(c4); - t.is(h1, h2); - t.is(h1, h3); - t.is(h1, h4); + assert.strictEqual(h1, h2); + assert.strictEqual(h1, h3); + assert.strictEqual(h1, h4); // Doesn't contain salt - t.false(ContractTermsUtil.validateForgettable(cReq)); + assert.strictEqual(ContractTermsUtil.validateForgettable(cReq), false); - t.true(ContractTermsUtil.validateForgettable(c1)); - t.true(ContractTermsUtil.validateForgettable(c2)); - t.true(ContractTermsUtil.validateForgettable(c3)); - t.true(ContractTermsUtil.validateForgettable(c4)); + assert.ok(ContractTermsUtil.validateForgettable(c1)); + assert.ok(ContractTermsUtil.validateForgettable(c2)); + assert.ok(ContractTermsUtil.validateForgettable(c3)); + assert.ok(ContractTermsUtil.validateForgettable(c4)); }); test("contract terms reference vector", (t) => { @@ -120,7 +121,7 @@ test("contract terms reference vector", (t) => { const h = ContractTermsUtil.hashContractTerms(j); - t.deepEqual( + assert.deepStrictEqual( h, "VDE8JPX0AEEE3EX1K8E11RYEWSZQKGGZCV6BWTE4ST1C8711P7H850Z7F2Q2HSSYETX87ERC2JNHWB7GTDWTDWMM716VKPSRBXD7SRR", ); diff --git a/packages/taler-util/src/helpers.test.ts b/packages/taler-util/src/helpers.test.ts @@ -14,33 +14,32 @@ TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ -import test from "ava"; +import { test } from "node:test"; +import assert from "node:assert"; import * as helpers from "./helpers.js"; test("URL canonicalization", (t) => { // converts to relative, adds https - t.is( + assert.strictEqual( "https://alice.example.com/exchange/", helpers.canonicalizeBaseUrl("alice.example.com/exchange"), ); // keeps http, adds trailing slash - t.is( + assert.strictEqual( "http://alice.example.com/exchange/", helpers.canonicalizeBaseUrl("http://alice.example.com/exchange"), ); // keeps http, adds trailing slash - t.is( + assert.strictEqual( "http://alice.example.com/exchange/", helpers.canonicalizeBaseUrl("http://alice.example.com/exchange#foobar"), ); // Remove search component - t.is( + assert.strictEqual( "http://alice.example.com/exchange/", helpers.canonicalizeBaseUrl("http://alice.example.com/exchange?foo=bar"), ); - - t.pass(); }); diff --git a/packages/taler-util/src/iban.test.ts b/packages/taler-util/src/iban.test.ts @@ -14,16 +14,17 @@ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ -import test from "ava"; +import { test } from "node:test"; +import assert from "node:assert"; import { generateIban, validateIban } from "./iban.js"; test("iban validation", (t) => { - t.assert(validateIban("foo").type === "invalid"); - t.assert(validateIban("NL71RABO9996666778").type === "valid"); - t.assert(validateIban("NL71RABO9996666779").type === "invalid"); + assert.ok(validateIban("foo").type === "invalid"); + assert.ok(validateIban("NL71RABO9996666778").type === "valid"); + assert.ok(validateIban("NL71RABO9996666779").type === "invalid"); }); test("iban generation", (t) => { let iban1 = generateIban("DE", 10); - t.assert(validateIban(iban1).type === "valid"); + assert.ok(validateIban(iban1).type === "valid"); }); diff --git a/packages/taler-util/src/libtool-version.test.ts b/packages/taler-util/src/libtool-version.test.ts @@ -16,35 +16,36 @@ import { LibtoolVersion } from "./libtool-version.js"; -import test from "ava"; +import { test } from "node:test"; +import assert from "node:assert"; test("version comparison", (t) => { - t.deepEqual(LibtoolVersion.compare("0:0:0", "0:0:0"), { + assert.deepStrictEqual(LibtoolVersion.compare("0:0:0", "0:0:0"), { compatible: true, currentCmp: 0, }); - t.deepEqual(LibtoolVersion.compare("0:0:0", ""), undefined); - t.deepEqual(LibtoolVersion.compare("foo", "0:0:0"), undefined); - t.deepEqual(LibtoolVersion.compare("0:0:0", "1:0:1"), { + assert.deepStrictEqual(LibtoolVersion.compare("0:0:0", ""), undefined); + assert.deepStrictEqual(LibtoolVersion.compare("foo", "0:0:0"), undefined); + assert.deepStrictEqual(LibtoolVersion.compare("0:0:0", "1:0:1"), { compatible: true, currentCmp: -1, }); - t.deepEqual(LibtoolVersion.compare("0:0:0", "1:5:1"), { + assert.deepStrictEqual(LibtoolVersion.compare("0:0:0", "1:5:1"), { compatible: true, currentCmp: -1, }); - t.deepEqual(LibtoolVersion.compare("0:0:0", "1:5:0"), { + assert.deepStrictEqual(LibtoolVersion.compare("0:0:0", "1:5:0"), { compatible: false, currentCmp: -1, }); - t.deepEqual(LibtoolVersion.compare("1:0:0", "0:5:0"), { + assert.deepStrictEqual(LibtoolVersion.compare("1:0:0", "0:5:0"), { compatible: false, currentCmp: 1, }); - t.deepEqual(LibtoolVersion.compare("1:0:1", "1:5:1"), { + assert.deepStrictEqual(LibtoolVersion.compare("1:0:1", "1:5:1"), { compatible: true, currentCmp: 0, }); - t.true(LibtoolVersion.compare("42:0:1", "41:0:0")?.compatible); - t.true(LibtoolVersion.compare("41:0:0", "42:0:1")?.compatible); + assert.ok(LibtoolVersion.compare("42:0:1", "41:0:0")?.compatible); + assert.ok(LibtoolVersion.compare("41:0:0", "42:0:1")?.compatible); }); diff --git a/packages/taler-util/src/payto.test.ts b/packages/taler-util/src/payto.test.ts @@ -14,7 +14,8 @@ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ -import test from "ava"; +import { test } from "node:test"; +import assert from "node:assert"; import { PaytoString, @@ -26,61 +27,61 @@ import { test("basic payto parsing", (t) => { const r1 = parsePaytoUri("https://example.com/"); - t.is(r1, undefined); + assert.strictEqual(r1, undefined); const r2 = parsePaytoUri("payto:blabla"); - t.is(r2, undefined); + assert.strictEqual(r2, undefined); const r3 = parsePaytoUri("payto://x-taler-bank/123"); - t.is(r3?.targetType, "x-taler-bank"); - t.is(r3?.targetPath, "123"); + assert.strictEqual(r3?.targetType, "x-taler-bank"); + assert.strictEqual(r3?.targetPath, "123"); }); test("basic x-taler-bank payto string", (t) => { const result = parsePaytoUri( "payto://x-taler-bank/bank.demo.taler.net/asd/accountName", ); - t.is(result?.targetType, "x-taler-bank"); - t.is(result?.targetPath, "bank.demo.taler.net/asd/accountName"); + assert.strictEqual(result?.targetType, "x-taler-bank"); + assert.strictEqual(result?.targetPath, "bank.demo.taler.net/asd/accountName"); if (!result) { - t.fail(); + assert.fail(); throw Error(); } if (!result.isKnown) { - t.fail(); + assert.fail(); throw Error(); } if (result.targetType !== "x-taler-bank") { - t.fail(); + assert.fail(); throw Error(); } - t.is(result.host, "bank.demo.taler.net"); - t.is(result.account, "accountName"); + assert.strictEqual(result.host, "bank.demo.taler.net"); + assert.strictEqual(result.account, "accountName"); }); test("parsing payto and stringify again", (t) => { const payto1 = "payto://iban/DE1231231231?reciever-name=John%20Doe" as PaytoString; - t.is(stringifyPaytoUri(parsePaytoUri(payto1)!), payto1); + assert.strictEqual(stringifyPaytoUri(parsePaytoUri(payto1)!), payto1); }); test("parsing payto with % carh", (t) => { const payto1 = "payto://iban/DE7763544441436?receiver-name=Test%20123%2B-%24%25%5E%3Cem%3Ehi%3C%2Fem%3E" as PaytoString; - t.is(stringifyPaytoUri(parsePaytoUri(payto1)!), payto1); + assert.strictEqual(stringifyPaytoUri(parsePaytoUri(payto1)!), payto1); }); test("adding payto query params", (t) => { const payto1 = "payto://iban/DE1231231231?receiver-name=John%20Doe" as PaytoString; const out1 = addPaytoQueryParams(payto1, {}); - t.deepEqual(payto1, out1); + assert.deepStrictEqual(payto1, out1); const out2 = addPaytoQueryParams(payto1, { foo: "42", }); - t.deepEqual( + assert.deepStrictEqual( out2, "payto://iban/DE1231231231?receiver-name=John%20Doe&foo=42", ); @@ -90,27 +91,30 @@ test("parsing payto and stringify again but with cyclos", (t) => { const payto1 = "payto://cyclos/communities.cyclos.org/utrecht/31000163100000000?reciever-name=John%20Doe" as PaytoString; - t.is(stringifyPaytoUri(parsePaytoUri(payto1)!), payto1); + assert.strictEqual(stringifyPaytoUri(parsePaytoUri(payto1)!), payto1); }); test("basic cyclos payto string", (t) => { const result = parsePaytoUri( "payto://cyclos/communities.cyclos.org/utrecht/31000163100000000", ); - t.is(result?.targetType, "cyclos"); - t.is(result?.targetPath, "communities.cyclos.org/utrecht/31000163100000000"); + assert.strictEqual(result?.targetType, "cyclos"); + assert.strictEqual( + result?.targetPath, + "communities.cyclos.org/utrecht/31000163100000000", + ); if (!result) { - t.fail(); + assert.fail(); throw Error(); } if (!result.isKnown) { - t.fail(); + assert.fail(); throw Error(); } if (result.targetType !== "cyclos") { - t.fail(); + assert.fail(); throw Error(); } - t.is(result.host, "communities.cyclos.org"); - t.is(result.account, "31000163100000000"); + assert.strictEqual(result.host, "communities.cyclos.org"); + assert.strictEqual(result.account, "31000163100000000"); }); diff --git a/packages/taler-util/src/paytos.test.ts b/packages/taler-util/src/paytos.test.ts @@ -14,32 +14,33 @@ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ -import test from "ava"; +import { test } from "node:test"; +import assert from "node:assert"; import { HostPortPath, PaytoType, Paytos } from "./payto.js"; import { Result } from "./result.js"; test("basic payto parsing", (t) => { const r1 = Paytos.fromString("https://example.com/"); - t.is(r1.tag, "error"); + assert.strictEqual(r1.tag, "error"); const r2 = Paytos.fromString("payto:blabla"); - t.is(r2.tag, "error"); + assert.strictEqual(r2.tag, "error"); // this doesn't work because x-taler-bank requires host and account const r3 = Paytos.fromString("payto:://x-taler-bank/12"); - t.is(r3.tag, "error"); + assert.strictEqual(r3.tag, "error"); const r4 = Paytos.fromString("payto://x-taler-bank/host/account"); if (r4.tag === "error") { - t.fail(); + assert.fail(); throw Error(); } if (r4.value.targetType !== PaytoType.TalerBank) { - t.fail(r4.value.targetType); + assert.fail(r4.value.targetType); throw Error(); } - t.is(r4.value.normalizedPath, "host/account"); + assert.strictEqual(r4.value.normalizedPath, "host/account"); }); test("basic x-taler-bank payto string", (t) => { @@ -48,24 +49,27 @@ test("basic x-taler-bank payto string", (t) => { ); if (result.targetType !== PaytoType.TalerBank) { - t.fail(); + assert.fail(); throw Error(); } - t.is(result.normalizedPath, "bank.demo.taler.net/accountName"); - t.is(result.host, "bank.demo.taler.net"); - t.is(result.url, "https://bank.demo.taler.net/" as HostPortPath); - t.is(result.account, "accountName"); + assert.strictEqual(result.normalizedPath, "bank.demo.taler.net/accountName"); + assert.strictEqual(result.host, "bank.demo.taler.net"); + assert.strictEqual( + result.url, + "https://bank.demo.taler.net/" as HostPortPath, + ); + assert.strictEqual(result.account, "accountName"); }); test("parsing payto and stringify again on normalized strings are unchanged", (t) => { const payto1 = "payto://iban/DE1231231231?reciever-name=John%20Doe"; - t.is( + assert.strictEqual( Paytos.toFullString(Result.unpack(Paytos.fromString(payto1))), payto1 as Paytos.FullPaytoString, ); const normalized = "payto://iban/DE1231231231"; - t.is( + assert.strictEqual( Paytos.toNormalizedString(Result.unpack(Paytos.fromString(payto1))), normalized as Paytos.NormalizedPaytoString, ); @@ -76,7 +80,7 @@ test("parsing payto and stringify again converts to the normal form", (t) => { // after normalization the country code is uppercased const fullPayto_normalized = "payto://iban/DE1231231231?reciever-name=John%20Doe" as Paytos.FullPaytoString; - t.is( + assert.strictEqual( Paytos.toFullString( Result.unpack(Paytos.fromString(fullPayto_not_normalized)), ), @@ -86,7 +90,7 @@ test("parsing payto and stringify again converts to the normal form", (t) => { const normalized_lowercase = "payto://iban/DE1231231231"; const normalized_uppercase = "payto://iban/DE1231231231" as Paytos.NormalizedPaytoString; - t.is( + assert.strictEqual( Paytos.toNormalizedString( Result.unpack(Paytos.fromString(normalized_lowercase)), ), @@ -97,7 +101,10 @@ test("parsing payto with % carh", (t) => { const payto1 = "payto://iban/DE7763544441436?receiver-name=Test%20123%2B-%24%25%5E%3Cem%3Ehi%3C%2Fem%3E" as Paytos.FullPaytoString; - t.is(Paytos.toFullString(Result.unpack(Paytos.fromString(payto1))), payto1); + assert.strictEqual( + Paytos.toFullString(Result.unpack(Paytos.fromString(payto1))), + payto1, + ); }); test("adding payto query params", (t) => { @@ -107,7 +114,7 @@ test("adding payto query params", (t) => { p.params["foo"] = "42"; - t.deepEqual( + assert.deepStrictEqual( Paytos.toFullString(p), "payto://iban/DE1231231231?receiver-name=John%20Doe&foo=42", ); @@ -122,13 +129,16 @@ test("basic cyclos payto string", (t) => { ); if (result.targetType !== PaytoType.Cyclos) { - t.fail(); + assert.fail(); throw Error(); } - t.is(result.normalizedPath, "demo.cyclos.org/31000163100000000"); - t.is(result.url, "https://demo.cyclos.org/" as HostPortPath); - t.is(result.account, "31000163100000000"); - t.is(result.params["receiver-name"], "John Doe"); + assert.strictEqual( + result.normalizedPath, + "demo.cyclos.org/31000163100000000", + ); + assert.strictEqual(result.url, "https://demo.cyclos.org/" as HostPortPath); + assert.strictEqual(result.account, "31000163100000000"); + assert.strictEqual(result.params["receiver-name"], "John Doe"); } { @@ -139,15 +149,18 @@ test("basic cyclos payto string", (t) => { ); if (result.targetType !== PaytoType.Cyclos) { - t.fail(); + assert.fail(); throw Error(); } - t.is( + assert.strictEqual( result.normalizedPath, "communities.cyclos.org/utrecht/31000163100000000", ); - t.is(result.url, "https://communities.cyclos.org/utrecht/" as HostPortPath); - t.is(result.account, "31000163100000000"); - t.is(result.params["receiver-name"], "John Doe"); + assert.strictEqual( + result.url, + "https://communities.cyclos.org/utrecht/" as HostPortPath, + ); + assert.strictEqual(result.account, "31000163100000000"); + assert.strictEqual(result.params["receiver-name"], "John Doe"); } }); diff --git a/packages/taler-util/src/taler-crypto.test.ts b/packages/taler-util/src/taler-crypto.test.ts @@ -17,7 +17,8 @@ /** * Imports */ -import test from "ava"; +import { test } from "node:test"; +import assert from "node:assert"; import { encodeCrock, decodeCrock, @@ -78,7 +79,7 @@ test("encoding", (t) => { const encStr = encodeCrock(stringToBytes(s)); const outBuf = decodeCrock(encStr); const sOut = bytesToString(outBuf); - t.deepEqual(s, sOut); + assert.deepStrictEqual(s, sOut); }); test("taler-exchange-tvg hash code", (t) => { @@ -88,7 +89,7 @@ test("taler-exchange-tvg hash code", (t) => { const myOutput = encodeCrock(sha512(decodeCrock(input))); - t.deepEqual(myOutput, output); + assert.deepStrictEqual(myOutput, output); }); test("taler-exchange-tvg ecdhe key", (t) => { @@ -99,12 +100,12 @@ test("taler-exchange-tvg ecdhe key", (t) => { "NXRY2YCY7H9B6KM928ZD55WG964G59YR0CPX041DYXKBZZ85SAWNPQ8B30QRM5FMHYCXJAN0EAADJYWEF1X3PAC2AJN28626TR5A6AR"; const myPub1 = nacl.scalarMult_base(decodeCrock(priv1)); - t.deepEqual(encodeCrock(myPub1), pub1); + assert.deepStrictEqual(encodeCrock(myPub1), pub1); const mySkm = nacl.hash( nacl.scalarMult(decodeCrock(priv2), decodeCrock(pub1)), ); - t.deepEqual(encodeCrock(mySkm), skm); + assert.deepStrictEqual(encodeCrock(mySkm), skm); }); test("taler-exchange-tvg eddsa key", (t) => { @@ -112,7 +113,7 @@ test("taler-exchange-tvg eddsa key", (t) => { const pub = "8GSJZ649T2PXMKZC01Y4ANNBE7MF14QVK9SQEC4E46ZHKCVG8AS0"; const pair = nacl.crypto_sign_keyPair_fromSeed(decodeCrock(priv)); - t.deepEqual(encodeCrock(pair.publicKey), pub); + assert.deepStrictEqual(encodeCrock(pair.publicKey), pub); }); test("taler-exchange-tvg kdf", (t) => { @@ -131,7 +132,7 @@ test("taler-exchange-tvg kdf", (t) => { decodeCrock(ctx), ); - t.deepEqual(encodeCrock(myOut), out); + assert.deepStrictEqual(encodeCrock(myOut), out); }); test("taler-exchange-tvg eddsa_ecdh", (t) => { @@ -143,22 +144,22 @@ test("taler-exchange-tvg eddsa_ecdh", (t) => { "PKZ42Z56SVK2796HG1QYBRJ6ZQM2T9QGA3JA4AAZ8G7CWK9FPX175Q9JE5P0ZAX3HWWPHAQV4DPCK10R9X3SAXHRV0WF06BHEC2ZTKR"; const myEcdhePub = ecdhGetPublic(decodeCrock(priv_ecdhe)); - t.deepEqual(encodeCrock(myEcdhePub), pub_ecdhe); + assert.deepStrictEqual(encodeCrock(myEcdhePub), pub_ecdhe); const myEddsaPub = eddsaGetPublic(decodeCrock(priv_eddsa)); - t.deepEqual(encodeCrock(myEddsaPub), pub_eddsa); + assert.deepStrictEqual(encodeCrock(myEddsaPub), pub_eddsa); const myKm1 = keyExchangeEddsaEcdh( decodeCrock(priv_eddsa), decodeCrock(pub_ecdhe), ); - t.deepEqual(encodeCrock(myKm1), key_material); + assert.deepStrictEqual(encodeCrock(myKm1), key_material); const myKm2 = keyExchangeEcdhEddsa( decodeCrock(priv_ecdhe), decodeCrock(pub_eddsa), ); - t.deepEqual(encodeCrock(myKm2), key_material); + assert.deepStrictEqual(encodeCrock(myKm2), key_material); }); test("incremental hashing #1", (t) => { @@ -177,8 +178,8 @@ test("incremental hashing #1", (t) => { const h3 = s.finish(); - t.deepEqual(encodeCrock(h1), encodeCrock(h2)); - t.deepEqual(encodeCrock(h1), encodeCrock(h3)); + assert.deepStrictEqual(encodeCrock(h1), encodeCrock(h2)); + assert.deepStrictEqual(encodeCrock(h1), encodeCrock(h3)); }); test("incremental hashing #2", (t) => { @@ -196,8 +197,8 @@ test("incremental hashing #2", (t) => { const h3 = s.finish(); - t.deepEqual(encodeCrock(h1), encodeCrock(h3)); - t.deepEqual(encodeCrock(h1), encodeCrock(h2)); + assert.deepStrictEqual(encodeCrock(h1), encodeCrock(h3)); + assert.deepStrictEqual(encodeCrock(h1), encodeCrock(h2)); }); test("taler-exchange-tvg eddsa_ecdh #2", (t) => { @@ -209,22 +210,22 @@ test("taler-exchange-tvg eddsa_ecdh #2", (t) => { "G6RA58N61K7MT3WA13Q7VRTE1FQS6H43RX9HK8Z5TGAB61601GEGX51JRHHQMNKNM2R9AVC1STSGQDRHGKWVYP584YGBCTVMMJYQF30"; const myEcdhePub = ecdhGetPublic(decodeCrock(priv_ecdhe)); - t.deepEqual(encodeCrock(myEcdhePub), pub_ecdhe); + assert.deepStrictEqual(encodeCrock(myEcdhePub), pub_ecdhe); const myEddsaPub = eddsaGetPublic(decodeCrock(priv_eddsa)); - t.deepEqual(encodeCrock(myEddsaPub), pub_eddsa); + assert.deepStrictEqual(encodeCrock(myEddsaPub), pub_eddsa); const myKm1 = keyExchangeEddsaEcdh( decodeCrock(priv_eddsa), decodeCrock(pub_ecdhe), ); - t.deepEqual(encodeCrock(myKm1), key_material); + assert.deepStrictEqual(encodeCrock(myKm1), key_material); const myKm2 = keyExchangeEcdhEddsa( decodeCrock(priv_ecdhe), decodeCrock(pub_eddsa), ); - t.deepEqual(encodeCrock(myKm2), key_material); + assert.deepStrictEqual(encodeCrock(myKm2), key_material); }); test("taler CS blind c", async (t) => { @@ -269,7 +270,7 @@ test("taler CS blind c", async (t) => { const priv = "K43QAMEPE9KJJTX6AJZD6N4SN1N3ARVAXZ2MRNPT85FHD4QD2C60"; const pub_cmp = "1903SZ7QE1K8T4BHTJ32KDJ153SBXT22DGNQDY5NKJE535J72H2G"; const pub = await scalarMultBase25519(decodeCrock(priv)); - t.deepEqual(decodeCrock(pub_cmp), pub); + assert.deepStrictEqual(decodeCrock(pub_cmp), pub); const nonce = "GWPVFP9160XNADYQZ4T6S7RACB2482KG1JCY0X2Z5R52W74YXY3G"; const msg_hash = @@ -285,11 +286,11 @@ test("taler CS blind c", async (t) => { const rPub: [Uint8Array, Uint8Array] = [rPub0, rPub1]; - t.deepEqual( + assert.deepStrictEqual( rPub[0], decodeCrock("J5XFBKFP9T6BM02H6ZV6Y568PQ2K398MD339036F25XTSP1A7T3G"), ); - t.deepEqual( + assert.deepStrictEqual( rPub[1], decodeCrock("GA2CZKJ6CWFS81ZN1T5R4GQFHF7XJV6HWHDR1JA9VATKKXQN89J0"), ); @@ -303,7 +304,7 @@ test("taler CS blind c", async (t) => { // const pub_eddsa = eddsaGetPublic(decodeCrock(priv_eddsa)); const bseed1 = deriveBSeed(decodeCrock(priv_eddsa), rPub); const bseed2 = deriveBSeed(decodeCrock(priv_eddsa), rPub); - t.deepEqual(bseed1, bseed2); + assert.deepStrictEqual(bseed1, bseed2); /** * In this scenario the nonce from the test vectors is used as b-seed and refresh. @@ -314,39 +315,39 @@ test("taler CS blind c", async (t) => { */ const bseed = decodeCrock(nonce); const secrets = deriveSecrets(bseed); - t.deepEqual( + assert.deepStrictEqual( secrets.alpha[0], decodeCrock("R06FWJ4XEK4JKKKA03JARGD0PD5JAX8DK2N6J0K8CAZZMVQEJ1T0"), ); - t.deepEqual( + assert.deepStrictEqual( secrets.alpha[1], decodeCrock("13NXE2FEHJS0Q5XCWNRF4V1NC3BSAHN6BW02WZ07PG6967156HYG"), ); - t.deepEqual( + assert.deepStrictEqual( secrets.beta[0], decodeCrock("T3EZP42RJQXRTJ4FTDWF18Z422VX7KFGN8GJ3QCCM1QV3N456HD0"), ); - t.deepEqual( + assert.deepStrictEqual( secrets.beta[1], decodeCrock("P3MECYGCCR58QVEDSW443699CDXVT8C8W5ZT22PPNRJ363M72H6G"), ); const rBlind = await calcRBlind(pub, secrets, rPub); - t.deepEqual( + assert.deepStrictEqual( rBlind[0], decodeCrock("CHK7JC4SXZ4Y9RDA3881S82F7BP99H35Q361WR6RBXN5YN2ZM1M0"), ); - t.deepEqual( + assert.deepStrictEqual( rBlind[1], decodeCrock("4C65R74GA9PPDX4DC2B948W96T3Z6QEENK2NDJQPNB9QBTKCT590"), ); const c = await csBlind(bseed, rPub, pub, decodeCrock(msg_hash)); - t.deepEqual( + assert.deepStrictEqual( c[0], decodeCrock("F288QXT67TR36E6DHE399G8J24RM6C3DP16HGMH74B6WZ1DETR10"), ); - t.deepEqual( + assert.deepStrictEqual( c[1], decodeCrock("EFK5WTN01NCVS3DZCG20MQDHRHBATRG8589BA0XSZDZ6D0HFR470"), ); @@ -371,26 +372,26 @@ test("taler CS blind c", async (t) => { }; const sig = await csUnblind(bseed, rPub, pub, b, blindsig); - t.deepEqual( + assert.deepStrictEqual( sig.s, decodeCrock("F4ZKMFW3Q7DFN0N94KAMG2JFFHAC362T0QZ6ZCVZ73RS8P91CR70"), ); - t.deepEqual( + assert.deepStrictEqual( sig.rPub, decodeCrock("CHK7JC4SXZ4Y9RDA3881S82F7BP99H35Q361WR6RBXN5YN2ZM1M0"), ); const res = await csVerify(decodeCrock(msg_hash), sig, pub); - t.deepEqual(res, true); + assert.deepStrictEqual(res, true); }); test("bigint/nacl conversion", async (t) => { const b1 = BigInteger(42); const n1 = bigintToNaclArr(b1, 32); - t.is(n1[0], 42); - t.is(n1.length, 32); + assert.strictEqual(n1[0], 42); + assert.strictEqual(n1.length, 32); const b2 = bigintFromNaclArr(n1); - t.true(b1.eq(b2)); + assert.ok(b1.eq(b2)); }); test("taler age restriction crypto", async (t) => { @@ -404,7 +405,7 @@ test("taler age restriction crypto", async (t) => { const pub2Ref = await Edx25519.getPublic(priv2); - t.deepEqual(pub2, pub2Ref); + assert.deepStrictEqual(pub2, pub2Ref); }); test("edx signing", async (t) => { @@ -415,11 +416,14 @@ test("edx signing", async (t) => { const sig = nacl.crypto_edx25519_sign_detached(msg, priv1, pub1); - t.true(nacl.crypto_edx25519_sign_detached_verify(msg, sig, pub1)); + assert.ok(nacl.crypto_edx25519_sign_detached_verify(msg, sig, pub1)); sig[0]++; - t.false(nacl.crypto_edx25519_sign_detached_verify(msg, sig, pub1)); + assert.strictEqual( + nacl.crypto_edx25519_sign_detached_verify(msg, sig, pub1), + false, + ); }); test("edx test vector", async (t) => { @@ -437,20 +441,20 @@ test("edx test vector", async (t) => { { const pub1Prime = await Edx25519.getPublic(decodeCrock(tv.priv1_edx)); - t.deepEqual(pub1Prime, decodeCrock(tv.pub1_edx)); + assert.deepStrictEqual(pub1Prime, decodeCrock(tv.pub1_edx)); } const pub2Prime = await Edx25519.publicKeyDerive( decodeCrock(tv.pub1_edx), decodeCrock(tv.seed), ); - t.deepEqual(pub2Prime, decodeCrock(tv.pub2_edx)); + assert.deepStrictEqual(pub2Prime, decodeCrock(tv.pub2_edx)); const priv2Prime = await Edx25519.privateKeyDerive( decodeCrock(tv.priv1_edx), decodeCrock(tv.seed), ); - t.deepEqual(priv2Prime, decodeCrock(tv.priv2_edx)); + assert.deepStrictEqual(priv2Prime, decodeCrock(tv.priv2_edx)); }); test("chacha20 test vector", async (t) => { @@ -484,7 +488,7 @@ test("chacha20 test vector", async (t) => { const plaintext = chacha20_ietf_xor(key, nonce, ciphertext, 1); const decoder = new TextDecoder(); const plaintextStr = decoder.decode(plaintextBytes); - t.deepEqual( + assert.deepStrictEqual( plaintextStr, "Ladies and Gentlemen of the class of '99: If I could offer you only one tip for the future, sunscreen would be it.", ); @@ -531,7 +535,7 @@ test("chacha20poly1305 test vector", async (t) => { 0x16, 0x69, 0xa4, 0x32, ]); const block0 = chacha20_ietf(64, key, nonce); - t.deepEqual(block0.slice(0, 32), polyKey); + assert.deepStrictEqual(block0.slice(0, 32), polyKey); // encrypt const ciphertext = chacha20poly1305_ietf_encrypt( plaintextBytes, @@ -542,10 +546,10 @@ test("chacha20poly1305 test vector", async (t) => { // decrypt const plaintext = chacha20poly1305_ietf_decrypt(ciphertext, aad, nonce, key); - t.false(plaintext === undefined); + assert.strictEqual(plaintext === undefined, false); const decoder = new TextDecoder(); const plaintextStr = decoder.decode(plaintext); - t.deepEqual( + assert.deepStrictEqual( plaintextStr, "Ladies and Gentlemen of the class of '99: If I could offer you only one tip for the future, sunscreen would be it.", ); @@ -604,15 +608,15 @@ test("rfc9180 HPKE DHKEM(X25519, HKDF-SHA256), HKDF-SHA256, ChaCha20Poly1305 tes 0xab, 0xb6, 0x52, 0x44, 0x93, 0x0d, 0x69, 0xa7, ]); const [enc_cand, ss_cand] = hpkeKemEncapsNorand(pkRm, skEm); - t.deepEqual(enc_cand, enc); + assert.deepStrictEqual(enc_cand, enc); const [enc_cand_setup, ctx_cand] = hpkeSenderSetupNorand(pkRm, skEm, info); - t.deepEqual(ctx_cand.key, key); - t.deepEqual(enc_cand_setup, enc); - t.deepEqual(ss_cand, ss); + assert.deepStrictEqual(ctx_cand.key, key); + assert.deepStrictEqual(enc_cand_setup, enc); + assert.deepStrictEqual(ss_cand, ss); const nonce_cand = hpkeComputeNonce(ctx_cand); - t.deepEqual(nonce_cand, nonce); + assert.deepStrictEqual(nonce_cand, nonce); const ct_cand = hpkeSealOneshotNorand(pkRm, skEm, info, aad, pt); - t.deepEqual(ct_cand.slice(enc.length), ct); + assert.deepStrictEqual(ct_cand.slice(enc.length), ct); const m_cand = hpkeOpenOneshot(skRm, info, aad, ct_cand); - t.deepEqual(m_cand, pt); + assert.deepStrictEqual(m_cand, pt); }); diff --git a/packages/taler-util/src/talerconfig.test.ts b/packages/taler-util/src/talerconfig.test.ts @@ -17,13 +17,14 @@ /** * Imports */ -import test from "ava"; +import { test } from "node:test"; +import assert from "node:assert"; import { pathsub, Configuration } from "./talerconfig.js"; test("pathsub", (t) => { - t.assert("foo" === pathsub("foo", () => undefined)); + assert.ok("foo" === pathsub("foo", () => undefined)); - t.assert("fo${bla}o" === pathsub("fo${bla}o", () => undefined)); + assert.ok("fo${bla}o" === pathsub("fo${bla}o", () => undefined)); const d: Record<string, string> = { w: "world", @@ -32,62 +33,62 @@ test("pathsub", (t) => { foo_bar: "quux", }; - t.is( + assert.strictEqual( pathsub("hello ${w}!", (v) => d[v]), "hello world!", ); - t.is( + assert.strictEqual( pathsub("hello ${w} ${w}!", (v) => d[v]), "hello world world!", ); - t.is( + assert.strictEqual( pathsub("hello ${x:-blabla}!", (v) => d[v]), "hello blabla!", ); // No braces - t.is( + assert.strictEqual( pathsub("hello $w!", (v) => d[v]), "hello world!", ); - t.is( + assert.strictEqual( pathsub("hello $foo!", (v) => d[v]), "hello $foo!", ); - t.is( + assert.strictEqual( pathsub("hello $1foo!", (v) => d[v]), "hello $1foo!", ); - t.is( + assert.strictEqual( pathsub("hello $$ world!", (v) => d[v]), "hello $$ world!", ); - t.is( + assert.strictEqual( pathsub("hello $$ world!", (v) => d[v]), "hello $$ world!", ); - t.is( + assert.strictEqual( pathsub("hello $foo_bar!", (v) => d[v]), "hello quux!", ); // Recursive lookup in default - t.is( + assert.strictEqual( pathsub("hello ${x:-${w}}!", (v) => d[v]), "hello world!", ); // No variables in variable name part - t.is( + assert.strictEqual( pathsub("hello ${${w}:-x}!", (v) => d[v]), "hello ${${w}:-x}!", ); // Missing closing brace - t.is( + assert.strictEqual( pathsub("hello ${w!", (v) => d[v]), "hello ${w!", ); @@ -106,7 +107,7 @@ test("path expansion", (t) => { "master_priv_file", "${TALER_DATA_HOME}/exchange/offline-keys/master.priv", ); - t.is( + assert.strictEqual( config.getPath("exchange", "MaStER_priv_file").required(), "foo/bar/.local/share/taler//exchange/offline-keys/master.priv", ); @@ -117,7 +118,7 @@ test("recursive path resolution", (t) => { config.setString("paths", "a", "x${b}"); config.setString("paths", "b", "y${a}"); config.setString("foo", "x", "z${a}"); - t.throws(() => { + assert.throws(() => { config.getPath("foo", "a").required(); }); }); diff --git a/packages/taler-util/src/taleruri.test.ts b/packages/taler-util/src/taleruri.test.ts @@ -14,7 +14,8 @@ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ -import test from "ava"; +import { test } from "node:test"; +import assert from "node:assert"; // import { AmountString } from "./types-taler-common.js"; import { HostPortPath } from "./payto.js"; import { @@ -52,11 +53,11 @@ import { AmountString } from "./types-taler-common.js"; const url1 = "taler://withdraw/bank.example.com/12345"; const r1 = parseWithdrawUri(url1); if (!r1) { - t.fail(); + assert.fail(); return; } - t.is(r1.withdrawalOperationId, "12345"); - t.is( + assert.strictEqual(r1.withdrawalOperationId, "12345"); + assert.strictEqual( r1.bankIntegrationApiBaseUrl, "https://bank.example.com/" as HostPortPath, ); @@ -67,12 +68,12 @@ import { AmountString } from "./types-taler-common.js"; "taler://withdraw/bank.example.com/12345?external-confirmation=1"; const r1 = parseWithdrawUri(url1); if (!r1) { - t.fail(); + assert.fail(); return; } - t.is(r1.externalConfirmation, true); - t.is(r1.withdrawalOperationId, "12345"); - t.is( + assert.strictEqual(r1.externalConfirmation, true); + assert.strictEqual(r1.withdrawalOperationId, "12345"); + assert.strictEqual( r1.bankIntegrationApiBaseUrl, "https://bank.example.com/" as HostPortPath, ); @@ -82,11 +83,11 @@ import { AmountString } from "./types-taler-common.js"; const url1 = "taler+http://withdraw/bank.example.com/12345"; const r1 = parseWithdrawUri(url1); if (!r1) { - t.fail(); + assert.fail(); return; } - t.is(r1.withdrawalOperationId, "12345"); - t.is( + assert.strictEqual(r1.withdrawalOperationId, "12345"); + assert.strictEqual( r1.bankIntegrationApiBaseUrl, "http://bank.example.com/" as HostPortPath, ); @@ -98,7 +99,10 @@ import { AmountString } from "./types-taler-common.js"; "https://bank.taler.test/integration-api/" as HostPortPath, withdrawalOperationId: "123", }); - t.deepEqual(url, "taler://withdraw/bank.taler.test/integration-api/123"); + assert.deepStrictEqual( + url, + "taler://withdraw/bank.taler.test/integration-api/123", + ); }); /** @@ -108,70 +112,78 @@ import { AmountString } from "./types-taler-common.js"; const url1 = "taler://pay/example.com/myorder/"; const r1 = parsePayUri(url1); if (!r1) { - t.fail(); + assert.fail(); return; } - t.is(r1.merchantBaseUrl, "https://example.com/" as HostPortPath); - t.is(r1.sessionId, ""); + assert.strictEqual( + r1.merchantBaseUrl, + "https://example.com/" as HostPortPath, + ); + assert.strictEqual(r1.sessionId, ""); const url2 = "taler://pay/example.com/myorder/mysession"; const r2 = parsePayUri(url2); if (!r2) { - t.fail(); + assert.fail(); return; } - t.is(r2.merchantBaseUrl, "https://example.com/" as HostPortPath); - t.is(r2.sessionId, "mysession"); + assert.strictEqual( + r2.merchantBaseUrl, + "https://example.com/" as HostPortPath, + ); + assert.strictEqual(r2.sessionId, "mysession"); }); test("taler pay url parsing: instance", (t) => { const url1 = "taler://pay/example.com/instances/myinst/myorder/"; const r1 = parsePayUri(url1); if (!r1) { - t.fail(); + assert.fail(); return; } - t.is( + assert.strictEqual( r1.merchantBaseUrl, "https://example.com/instances/myinst/" as HostPortPath, ); - t.is(r1.orderId, "myorder"); + assert.strictEqual(r1.orderId, "myorder"); }); test("taler pay url parsing (claim token)", (t) => { const url1 = "taler://pay/example.com/instances/myinst/myorder/?c=ASDF"; const r1 = parsePayUri(url1); if (!r1) { - t.fail(); + assert.fail(); return; } - t.is( + assert.strictEqual( r1.merchantBaseUrl, "https://example.com/instances/myinst/" as HostPortPath, ); - t.is(r1.orderId, "myorder"); - t.is(r1.claimToken, "ASDF"); + assert.strictEqual(r1.orderId, "myorder"); + assert.strictEqual(r1.claimToken, "ASDF"); }); test("taler pay uri parsing: non-https", (t) => { const url1 = "taler+http://pay/example.com/myorder/"; const r1 = parsePayUri(url1); if (!r1) { - t.fail(); + assert.fail(); return; } - t.is(r1.merchantBaseUrl, "http://example.com/" as HostPortPath); - t.is(r1.orderId, "myorder"); + assert.strictEqual( + r1.merchantBaseUrl, + "http://example.com/" as HostPortPath, + ); + assert.strictEqual(r1.orderId, "myorder"); }); test("taler pay uri parsing: missing session component", (t) => { const url1 = "taler+http://pay/example.com/myorder"; const r1 = parsePayUri(url1); if (r1) { - t.fail(); + assert.fail(); return; } - t.pass(); }); test("taler pay URI (stringify)", (t) => { @@ -180,14 +192,14 @@ import { AmountString } from "./types-taler-common.js"; orderId: "foo", sessionId: "", }); - t.deepEqual(url1, "taler+http://pay/localhost:123/foo/"); + assert.deepStrictEqual(url1, "taler+http://pay/localhost:123/foo/"); const url2 = stringifyPayUri({ merchantBaseUrl: "http://localhost:123/" as HostPortPath, orderId: "foo", sessionId: "bla", }); - t.deepEqual(url2, "taler+http://pay/localhost:123/foo/bla"); + assert.deepStrictEqual(url2, "taler+http://pay/localhost:123/foo/bla"); }); test("taler pay URI (stringify with https)", (t) => { @@ -196,7 +208,7 @@ import { AmountString } from "./types-taler-common.js"; orderId: "foo", sessionId: "", }); - t.deepEqual(url1, "taler://pay/localhost:123/foo/"); + assert.deepStrictEqual(url1, "taler://pay/localhost:123/foo/"); const url2 = stringifyPayUri({ merchantBaseUrl: "https://localhost/" as HostPortPath, @@ -204,7 +216,7 @@ import { AmountString } from "./types-taler-common.js"; sessionId: "bla", noncePriv: "123", }); - t.deepEqual(url2, "taler://pay/localhost/foo/bla?n=123"); + assert.deepStrictEqual(url2, "taler://pay/localhost/foo/bla?n=123"); }); /** @@ -215,33 +227,39 @@ import { AmountString } from "./types-taler-common.js"; const url1 = "taler+http://refund/example.com/myorder/"; const r1 = parseRefundUri(url1); if (!r1) { - t.fail(); + assert.fail(); return; } - t.is(r1.merchantBaseUrl, "http://example.com/" as HostPortPath); - t.is(r1.orderId, "myorder"); + assert.strictEqual( + r1.merchantBaseUrl, + "http://example.com/" as HostPortPath, + ); + assert.strictEqual(r1.orderId, "myorder"); }); test("taler refund uri parsing", (t) => { const url1 = "taler://refund/merchant.example.com/1234/"; const r1 = parseRefundUri(url1); if (!r1) { - t.fail(); + assert.fail(); return; } - t.is(r1.merchantBaseUrl, "https://merchant.example.com/" as HostPortPath); - t.is(r1.orderId, "1234"); + assert.strictEqual( + r1.merchantBaseUrl, + "https://merchant.example.com/" as HostPortPath, + ); + assert.strictEqual(r1.orderId, "1234"); }); test("taler refund uri parsing with instance", (t) => { const url1 = "taler://refund/merchant.example.com/instances/myinst/1234/"; const r1 = parseRefundUri(url1); if (!r1) { - t.fail(); + assert.fail(); return; } - t.is(r1.orderId, "1234"); - t.is( + assert.strictEqual(r1.orderId, "1234"); + assert.strictEqual( r1.merchantBaseUrl, "https://merchant.example.com/instances/myinst/" as HostPortPath, ); @@ -252,7 +270,10 @@ import { AmountString } from "./types-taler-common.js"; merchantBaseUrl: "https://merchant.test/instance/pepe/" as HostPortPath, orderId: "123", }); - t.deepEqual(url, "taler://refund/merchant.test/instance/pepe/123/"); + assert.deepStrictEqual( + url, + "taler://refund/merchant.test/instance/pepe/123/", + ); }); /** @@ -263,39 +284,42 @@ import { AmountString } from "./types-taler-common.js"; const url1 = "taler://pay-push/exch.example.com/foo"; const r1 = parsePayPushUri(url1); if (!r1) { - t.fail(); + assert.fail(); return; } - t.is(r1.exchangeBaseUrl, "https://exch.example.com/" as HostPortPath); - t.is(r1.contractPriv, "foo"); + assert.strictEqual( + r1.exchangeBaseUrl, + "https://exch.example.com/" as HostPortPath, + ); + assert.strictEqual(r1.contractPriv, "foo"); }); test("taler peer to peer push URI (path)", (t) => { const url1 = "taler://pay-push/exch.example.com:123/bla/foo"; const r1 = parsePayPushUri(url1); if (!r1) { - t.fail(); + assert.fail(); return; } - t.is( + assert.strictEqual( r1.exchangeBaseUrl, "https://exch.example.com:123/bla/" as HostPortPath, ); - t.is(r1.contractPriv, "foo"); + assert.strictEqual(r1.contractPriv, "foo"); }); test("taler peer to peer push URI (http)", (t) => { const url1 = "taler+http://pay-push/exch.example.com:123/bla/foo"; const r1 = parsePayPushUri(url1); if (!r1) { - t.fail(); + assert.fail(); return; } - t.is( + assert.strictEqual( r1.exchangeBaseUrl, "http://exch.example.com:123/bla/" as HostPortPath, ); - t.is(r1.contractPriv, "foo"); + assert.strictEqual(r1.contractPriv, "foo"); }); test("taler peer to peer push URI (stringify)", (t) => { @@ -303,7 +327,7 @@ import { AmountString } from "./types-taler-common.js"; exchangeBaseUrl: "https://foo.example.com/bla/" as HostPortPath, contractPriv: "123", }); - t.deepEqual(url, "taler://pay-push/foo.example.com/bla/123"); + assert.deepStrictEqual(url, "taler://pay-push/foo.example.com/bla/123"); }); /** @@ -314,39 +338,42 @@ import { AmountString } from "./types-taler-common.js"; const url1 = "taler://pay-pull/exch.example.com/foo"; const r1 = parsePayPullUri(url1); if (!r1) { - t.fail(); + assert.fail(); return; } - t.is(r1.exchangeBaseUrl, "https://exch.example.com/" as HostPortPath); - t.is(r1.contractPriv, "foo"); + assert.strictEqual( + r1.exchangeBaseUrl, + "https://exch.example.com/" as HostPortPath, + ); + assert.strictEqual(r1.contractPriv, "foo"); }); test("taler peer to peer pull URI (path)", (t) => { const url1 = "taler://pay-pull/exch.example.com:123/bla/foo"; const r1 = parsePayPullUri(url1); if (!r1) { - t.fail(); + assert.fail(); return; } - t.is( + assert.strictEqual( r1.exchangeBaseUrl, "https://exch.example.com:123/bla/" as HostPortPath, ); - t.is(r1.contractPriv, "foo"); + assert.strictEqual(r1.contractPriv, "foo"); }); test("taler peer to peer pull URI (http)", (t) => { const url1 = "taler+http://pay-pull/exch.example.com:123/bla/foo"; const r1 = parsePayPullUri(url1); if (!r1) { - t.fail(); + assert.fail(); return; } - t.is( + assert.strictEqual( r1.exchangeBaseUrl, "http://exch.example.com:123/bla/" as HostPortPath, ); - t.is(r1.contractPriv, "foo"); + assert.strictEqual(r1.contractPriv, "foo"); }); test("taler peer to peer pull URI (stringify)", (t) => { @@ -354,7 +381,7 @@ import { AmountString } from "./types-taler-common.js"; exchangeBaseUrl: "https://foo.example.com/bla/" as HostPortPath, contractPriv: "123", }); - t.deepEqual(url, "taler://pay-pull/foo.example.com/bla/123"); + assert.deepStrictEqual(url, "taler://pay-pull/foo.example.com/bla/123"); }); /** @@ -366,14 +393,14 @@ import { AmountString } from "./types-taler-common.js"; "taler://pay-template/merchant.example.com/FEGHYJY48FEGU6WETYIOIDEDE2QW3OCZVY"; const r1 = parsePayTemplateUri(url1); if (!r1) { - t.fail(); + assert.fail(); return; } - t.deepEqual( + assert.deepStrictEqual( r1.merchantBaseUrl, "https://merchant.example.com/" as HostPortPath, ); - t.deepEqual(r1.templateId, "FEGHYJY48FEGU6WETYIOIDEDE2QW3OCZVY"); + assert.deepStrictEqual(r1.templateId, "FEGHYJY48FEGU6WETYIOIDEDE2QW3OCZVY"); }); test("taler pay template URI (parsing, case-sensitive)", (t) => { @@ -381,14 +408,14 @@ import { AmountString } from "./types-taler-common.js"; "taler://pay-template/merchant.example.com/InstanceName/FEGHYJY48FEGU6WETYIOIDEDE2QW3OCZVY"; const r1 = parsePayTemplateUri(url1); if (!r1) { - t.fail(); + assert.fail(); return; } - t.deepEqual( + assert.deepStrictEqual( r1.merchantBaseUrl, "https://merchant.example.com/InstanceName/" as HostPortPath, ); - t.deepEqual(r1.templateId, "FEGHYJY48FEGU6WETYIOIDEDE2QW3OCZVY"); + assert.deepStrictEqual(r1.templateId, "FEGHYJY48FEGU6WETYIOIDEDE2QW3OCZVY"); }); test("taler pay template URI (parsing, http with port)", (t) => { @@ -396,14 +423,14 @@ import { AmountString } from "./types-taler-common.js"; "taler+http://pay-template/merchant.example.com:1234/FEGHYJY48FEGU6WETYIOIDEDE2QW3OCZVY"; const r1 = parsePayTemplateUri(url1); if (!r1) { - t.fail(); + assert.fail(); return; } - t.deepEqual( + assert.deepStrictEqual( r1.merchantBaseUrl, "http://merchant.example.com:1234/" as HostPortPath, ); - t.deepEqual(r1.templateId, "FEGHYJY48FEGU6WETYIOIDEDE2QW3OCZVY"); + assert.deepStrictEqual(r1.templateId, "FEGHYJY48FEGU6WETYIOIDEDE2QW3OCZVY"); }); test("taler pay template URI (stringify)", (t) => { @@ -411,7 +438,7 @@ import { AmountString } from "./types-taler-common.js"; merchantBaseUrl: "http://merchant.example.com:1234/" as HostPortPath, templateId: "FEGHYJY48FEGU6WETYIOIDEDE2QW3OCZVY", }); - t.deepEqual( + assert.deepStrictEqual( url1, "taler+http://pay-template/merchant.example.com:1234/FEGHYJY48FEGU6WETYIOIDEDE2QW3OCZVY", ); @@ -423,7 +450,7 @@ import { AmountString } from "./types-taler-common.js"; "http://merchant.example.com:1234/InstanceName/" as HostPortPath, templateId: "FEGHYJY48FEGU6WETYIOIDEDE2QW3OCZVY", }); - t.deepEqual( + assert.deepStrictEqual( url1, "taler+http://pay-template/merchant.example.com:1234/InstanceName/FEGHYJY48FEGU6WETYIOIDEDE2QW3OCZVY", ); @@ -437,30 +464,30 @@ import { AmountString } from "./types-taler-common.js"; "taler+http://restore/GJKG23V4ZBHEH45YRK7TWQE8ZTY7JWTY5094TQJSRZN5DSDBX8E0/prov1.example.com,prov2.example.com:123", ); if (!r1) { - t.fail(); + assert.fail(); return; } - t.deepEqual( + assert.deepStrictEqual( r1.walletRootPriv, "GJKG23V4ZBHEH45YRK7TWQE8ZTY7JWTY5094TQJSRZN5DSDBX8E0", ); - t.deepEqual(r1.providers[0], "http://prov1.example.com/"); - t.deepEqual(r1.providers[1], "http://prov2.example.com:123/"); + assert.deepStrictEqual(r1.providers[0], "http://prov1.example.com/"); + assert.deepStrictEqual(r1.providers[1], "http://prov2.example.com:123/"); }); test("taler restore URI (parsing, https with port)", (t) => { const r1 = parseRestoreUri( "taler://restore/GJKG23V4ZBHEH45YRK7TWQE8ZTY7JWTY5094TQJSRZN5DSDBX8E0/prov1.example.com,prov2.example.com:234,https%3A%2F%2Fprov1.example.com%2F", ); if (!r1) { - t.fail(); + assert.fail(); return; } - t.deepEqual( + assert.deepStrictEqual( r1.walletRootPriv, "GJKG23V4ZBHEH45YRK7TWQE8ZTY7JWTY5094TQJSRZN5DSDBX8E0", ); - t.deepEqual(r1.providers[0], "https://prov1.example.com/"); - t.deepEqual(r1.providers[1], "https://prov2.example.com:234/"); + assert.deepStrictEqual(r1.providers[0], "https://prov1.example.com/"); + assert.deepStrictEqual(r1.providers[1], "https://prov2.example.com:234/"); }); test("taler restore URI (stringify)", (t) => { @@ -472,7 +499,7 @@ import { AmountString } from "./types-taler-common.js"; "https://prov2.example.com:234/" as HostPortPath, ], }); - t.deepEqual( + assert.deepStrictEqual( url, "taler://restore/GJKG23V4ZBHEH45YRK7TWQE8ZTY7JWTY5094TQJSRZN5DSDBX8E0/http%3A%2F%2Fprov1.example.com%2F,https%3A%2F%2Fprov2.example.com%3A234%2F", ); @@ -486,17 +513,17 @@ import { AmountString } from "./types-taler-common.js"; const url1 = "taler://dev-experiment/123"; const r1 = parseDevExperimentUri(url1); if (!r1) { - t.fail(); + assert.fail(); return; } - t.deepEqual(r1.devExperimentId, "123"); + assert.deepStrictEqual(r1.devExperimentId, "123"); }); test("taler dev exp URI (stringify)", (t) => { const url1 = stringifyDevExperimentUri({ devExperimentId: "123", }); - t.deepEqual(url1, "taler://dev-experiment/123"); + assert.deepStrictEqual(url1, "taler://dev-experiment/123"); }); /** @@ -510,7 +537,7 @@ import { AmountString } from "./types-taler-common.js"; "taler://withdraw-exchange/exchange.demo.taler.net/someroot/GJKG23V4ZBHEH45YRK7TWQE8ZTY7JWTY5094TQJSRZN5DSDBX8E0?a=KUDOS%3A2", ); if (rx1) { - t.fail(); + assert.fail(); return; } } @@ -519,7 +546,7 @@ import { AmountString } from "./types-taler-common.js"; "taler://withdraw-exchange/exchange.demo.taler.net/GJKG23V4ZBHEH45YRK7TWQE8ZTY7JWTY5094TQJSRZN5DSDBX8E0", ); if (rx2) { - t.fail(); + assert.fail(); return; } } @@ -530,11 +557,11 @@ import { AmountString } from "./types-taler-common.js"; "taler://withdraw-exchange/exchange.demo.taler.net/someroot/", ); if (!r2) { - t.fail(); + assert.fail(); return; } - t.deepEqual(r2.amount, undefined); - t.deepEqual( + assert.deepStrictEqual(r2.amount, undefined); + assert.deepStrictEqual( r2.exchangeBaseUrl, "https://exchange.demo.taler.net/someroot/", ); @@ -545,11 +572,11 @@ import { AmountString } from "./types-taler-common.js"; "taler://withdraw-exchange/exchange.demo.taler.net/", ); if (!r3) { - t.fail(); + assert.fail(); return; } - t.deepEqual(r3.amount, undefined); - t.deepEqual( + assert.deepStrictEqual(r3.amount, undefined); + assert.deepStrictEqual( r3.exchangeBaseUrl, "https://exchange.demo.taler.net/" as HostPortPath, ); @@ -562,11 +589,11 @@ import { AmountString } from "./types-taler-common.js"; "taler://withdraw-exchange/exchange.demo.taler.net", ); if (!r4) { - t.fail(); + assert.fail(); return; } - t.deepEqual(r4.amount, undefined); - t.deepEqual( + assert.deepStrictEqual(r4.amount, undefined); + assert.deepStrictEqual( r4.exchangeBaseUrl, "https://exchange.demo.taler.net/" as HostPortPath, ); @@ -577,7 +604,10 @@ import { AmountString } from "./types-taler-common.js"; const url = stringifyWithdrawExchange({ exchangeBaseUrl: "https://exchange.demo.taler.net" as HostPortPath, }); - t.deepEqual(url, "taler://withdraw-exchange/exchange.demo.taler.net/"); + assert.deepStrictEqual( + url, + "taler://withdraw-exchange/exchange.demo.taler.net/", + ); }); test("taler withdraw exchange URI with amount (stringify)", (t) => { @@ -585,7 +615,7 @@ import { AmountString } from "./types-taler-common.js"; exchangeBaseUrl: "https://exchange.demo.taler.net" as HostPortPath, amount: "KUDOS:19" as AmountString, }); - t.deepEqual( + assert.deepStrictEqual( url, "taler://withdraw-exchange/exchange.demo.taler.net/?a=KUDOS%3A19", ); @@ -601,10 +631,10 @@ import { AmountString } from "./types-taler-common.js"; "taler://add-exchange/exchange.example.com/", ); if (!r1) { - t.fail(); + assert.fail(); return; } - t.deepEqual( + assert.deepStrictEqual( r1.exchangeBaseUrl, "https://exchange.example.com/" as HostPortPath, ); @@ -614,10 +644,10 @@ import { AmountString } from "./types-taler-common.js"; "taler://add-exchange/exchanges.example.com/api/", ); if (!r2) { - t.fail(); + assert.fail(); return; } - t.deepEqual( + assert.deepStrictEqual( r2.exchangeBaseUrl, "https://exchanges.example.com/api/" as HostPortPath, ); @@ -628,7 +658,10 @@ import { AmountString } from "./types-taler-common.js"; const url = stringifyAddExchange({ exchangeBaseUrl: "https://exchange.demo.taler.net" as HostPortPath, }); - t.deepEqual(url, "taler://add-exchange/exchange.demo.taler.net/"); + assert.deepStrictEqual( + url, + "taler://add-exchange/exchange.demo.taler.net/", + ); }); /** @@ -642,7 +675,7 @@ import { AmountString } from "./types-taler-common.js"; mailboxBaseUri: "https://mailbox.example.com/mb", mailboxIdentity: "SOMEHASHOFPUBKEY", }); - t.deepEqual( + assert.deepStrictEqual( url, "taler://add-contact/email/bob@example.com/mailbox.example.com/mb/SOMEHASHOFPUBKEY?sourceBaseUrl=https%3A%2F%2Ftaldir.example.com", ); @@ -654,10 +687,10 @@ import { AmountString } from "./types-taler-common.js"; test("taler pay url parsing: wrong scheme", (t) => { const url1 = "talerfoo://"; const r1 = parsePayUri(url1); - t.is(r1, undefined); + assert.strictEqual(r1, undefined); const url2 = "taler://refund/a/b/c/d/e/f"; const r2 = parsePayUri(url2); - t.is(r2, undefined); + assert.strictEqual(r2, undefined); }); } diff --git a/packages/taler-util/src/taleruris.test.ts b/packages/taler-util/src/taleruris.test.ts @@ -14,7 +14,8 @@ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ -import test from "ava"; +import { test } from "node:test"; +import assert from "node:assert"; import { HostPortPath } from "./payto.js"; import { Result } from "./result.js"; import { TalerUriAction, TalerUriParseError, TalerUris } from "./taleruri.js"; @@ -37,11 +38,11 @@ test("taler-new withdraw uri parsing", (t) => { const url1 = "taler://withdraw/bank.example.com/12345"; const r1 = Result.unpack(TalerUris.fromString(url1)); if (r1.type !== TalerUriAction.Withdraw) { - t.fail(); + assert.fail(); return; } - t.is(r1.withdrawalOperationId, "12345"); - t.is( + assert.strictEqual(r1.withdrawalOperationId, "12345"); + assert.strictEqual( r1.bankIntegrationApiBaseUrl, "https://bank.example.com/" as HostPortPath, ); @@ -52,12 +53,12 @@ test("taler-new withdraw uri parsing with external confirmation", (t) => { "taler://withdraw/bank.example.com/12345?external-confirmation=1"; const r1 = Result.unpack(TalerUris.fromString(url1)); if (r1.type !== TalerUriAction.Withdraw) { - t.fail(); + assert.fail(); return; } - t.is(r1.externalConfirmation, true); - t.is(r1.withdrawalOperationId, "12345"); - t.is( + assert.strictEqual(r1.externalConfirmation, true); + assert.strictEqual(r1.withdrawalOperationId, "12345"); + assert.strictEqual( r1.bankIntegrationApiBaseUrl, "https://bank.example.com/" as HostPortPath, ); @@ -67,11 +68,11 @@ test("taler-new withdraw uri parsing (http)", (t) => { const url1 = "taler+http://withdraw/bank.example.com/12345"; const r1 = Result.unpack(TalerUris.fromString(url1)); if (r1.type !== TalerUriAction.Withdraw) { - t.fail(); + assert.fail(); return; } - t.is(r1.withdrawalOperationId, "12345"); - t.is( + assert.strictEqual(r1.withdrawalOperationId, "12345"); + assert.strictEqual( r1.bankIntegrationApiBaseUrl, "http://bank.example.com/" as HostPortPath, ); @@ -84,7 +85,10 @@ test("taler-new withdraw URI (stringify)", (t) => { "https://bank.taler.test/integration-api/" as HostPortPath, withdrawalOperationId: "123", }); - t.deepEqual(url, "taler://withdraw/bank.taler.test/integration-api/123"); + assert.deepStrictEqual( + url, + "taler://withdraw/bank.taler.test/integration-api/123", + ); }); /** @@ -94,66 +98,71 @@ test("taler-new pay url parsing: defaults", (t) => { const url1 = "taler://pay/example.com/myorder/"; const r1 = Result.unpack(TalerUris.fromString(url1)); if (r1.type !== TalerUriAction.Pay) { - t.fail(); + assert.fail(); return; } - t.is(r1.merchantBaseUrl, "https://example.com/" as HostPortPath); - t.is(r1.sessionId, ""); + assert.strictEqual( + r1.merchantBaseUrl, + "https://example.com/" as HostPortPath, + ); + assert.strictEqual(r1.sessionId, ""); const url2 = "taler://pay/example.com/myorder/mysession"; const r2 = Result.unpack(TalerUris.fromString(url2)); if (r2.type !== TalerUriAction.Pay) { - t.fail(); + assert.fail(); return; } - t.is(r2.merchantBaseUrl, "https://example.com/" as HostPortPath); - t.is(r2.sessionId, "mysession"); + assert.strictEqual( + r2.merchantBaseUrl, + "https://example.com/" as HostPortPath, + ); + assert.strictEqual(r2.sessionId, "mysession"); }); test("taler-new pay url parsing: instance", (t) => { const url1 = "taler://pay/example.com/instances/myinst/myorder/"; const r1 = Result.unpack(TalerUris.fromString(url1)); if (r1.type !== TalerUriAction.Pay) { - t.fail(); + assert.fail(); return; } - t.is( + assert.strictEqual( r1.merchantBaseUrl, "https://example.com/instances/myinst/" as HostPortPath, ); - t.is(r1.orderId, "myorder"); + assert.strictEqual(r1.orderId, "myorder"); }); test("taler-new pay url parsing (claim token)", (t) => { const url1 = "taler://pay/example.com/instances/myinst/myorder/?c=ASDF"; const r1 = Result.unpack(TalerUris.fromString(url1)); if (r1.type !== TalerUriAction.Pay) { - t.fail(); + assert.fail(); return; } - t.is( + assert.strictEqual( r1.merchantBaseUrl, "https://example.com/instances/myinst/" as HostPortPath, ); - t.is(r1.orderId, "myorder"); - t.is(r1.claimToken, "ASDF"); + assert.strictEqual(r1.orderId, "myorder"); + assert.strictEqual(r1.claimToken, "ASDF"); }); test("taler-new pay uri parsing: non-https", (t) => { const url1 = "taler+http://pay/example.com/myorder/"; const r1 = Result.unpack(TalerUris.fromString(url1)); if (r1.type !== TalerUriAction.Pay) { - t.fail(); + assert.fail(); return; } - t.is(r1.merchantBaseUrl, "http://example.com/" as HostPortPath); - t.is(r1.orderId, "myorder"); + assert.strictEqual(r1.merchantBaseUrl, "http://example.com/" as HostPortPath); + assert.strictEqual(r1.orderId, "myorder"); }); test("taler-new pay uri parsing: missing session component", (t) => { const url1 = "taler+http://pay/example.com/myorder"; failOrThrow(TalerUris.fromString(url1), TalerUriParseError.COMPONENTS_LENGTH); - t.pass(); }); test("taler-new pay URI (stringify)", (t) => { @@ -163,7 +172,7 @@ test("taler-new pay URI (stringify)", (t) => { orderId: "foo", sessionId: "", }); - t.deepEqual(url1, "taler+http://pay/localhost:123/foo/"); + assert.deepStrictEqual(url1, "taler+http://pay/localhost:123/foo/"); const url2 = TalerUris.toString({ type: TalerUriAction.Pay, @@ -171,7 +180,7 @@ test("taler-new pay URI (stringify)", (t) => { orderId: "foo", sessionId: "bla", }); - t.deepEqual(url2, "taler+http://pay/localhost:123/foo/bla"); + assert.deepStrictEqual(url2, "taler+http://pay/localhost:123/foo/bla"); }); test("taler-new pay URI (stringify with https)", (t) => { @@ -181,7 +190,7 @@ test("taler-new pay URI (stringify with https)", (t) => { orderId: "foo", sessionId: "", }); - t.deepEqual(url1, "taler://pay/localhost:123/foo/"); + assert.deepStrictEqual(url1, "taler://pay/localhost:123/foo/"); const url2 = TalerUris.toString({ type: TalerUriAction.Pay, @@ -190,7 +199,7 @@ test("taler-new pay URI (stringify with https)", (t) => { sessionId: "bla", noncePriv: "123", }); - t.deepEqual(url2, "taler://pay/localhost/foo/bla?n=123"); + assert.deepStrictEqual(url2, "taler://pay/localhost/foo/bla?n=123"); }); /** @@ -202,33 +211,36 @@ test("taler-new refund uri parsing: non-https #1", (t) => { // const r1 = parseRefundUri(url1); const r1 = Result.unpack(TalerUris.fromString(url1)); if (r1.type !== TalerUriAction.Refund) { - t.fail(); + assert.fail(); return; } - t.is(r1.merchantBaseUrl, "http://example.com/" as HostPortPath); - t.is(r1.orderId, "myorder"); + assert.strictEqual(r1.merchantBaseUrl, "http://example.com/" as HostPortPath); + assert.strictEqual(r1.orderId, "myorder"); }); test("taler-new refund uri parsing", (t) => { const url1 = "taler://refund/merchant.example.com/1234/"; const r1 = Result.unpack(TalerUris.fromString(url1)); if (r1.type !== TalerUriAction.Refund) { - t.fail(); + assert.fail(); return; } - t.is(r1.merchantBaseUrl, "https://merchant.example.com/" as HostPortPath); - t.is(r1.orderId, "1234"); + assert.strictEqual( + r1.merchantBaseUrl, + "https://merchant.example.com/" as HostPortPath, + ); + assert.strictEqual(r1.orderId, "1234"); }); test("taler-new refund uri parsing with instance", (t) => { const url1 = "taler://refund/merchant.example.com/instances/myinst/1234/"; const r1 = Result.unpack(TalerUris.fromString(url1)); if (r1.type !== TalerUriAction.Refund) { - t.fail(); + assert.fail(); return; } - t.is(r1.orderId, "1234"); - t.is( + assert.strictEqual(r1.orderId, "1234"); + assert.strictEqual( r1.merchantBaseUrl, "https://merchant.example.com/instances/myinst/" as HostPortPath, ); @@ -240,7 +252,10 @@ test("taler-new refund URI (stringify)", (t) => { merchantBaseUrl: "https://merchant.test/instance/pepe/" as HostPortPath, orderId: "123", }); - t.deepEqual(url, "taler://refund/merchant.test/instance/pepe/123/"); + assert.deepStrictEqual( + url, + "taler://refund/merchant.test/instance/pepe/123/", + ); }); /** @@ -252,33 +267,42 @@ test("taler-new peer to peer push URI", (t) => { // const r1 = parsePayPushUri(url1); const r1 = Result.unpack(TalerUris.fromString(url1)); if (r1.type !== TalerUriAction.PayPush) { - t.fail(); + assert.fail(); return; } - t.is(r1.exchangeBaseUrl, "https://exch.example.com/" as HostPortPath); - t.is(r1.contractPriv, "foo"); + assert.strictEqual( + r1.exchangeBaseUrl, + "https://exch.example.com/" as HostPortPath, + ); + assert.strictEqual(r1.contractPriv, "foo"); }); test("taler-new peer to peer push URI (path)", (t) => { const url1 = "taler://pay-push/exch.example.com:123/bla/foo"; const r1 = Result.unpack(TalerUris.fromString(url1)); if (r1.type !== TalerUriAction.PayPush) { - t.fail(); + assert.fail(); return; } - t.is(r1.exchangeBaseUrl, "https://exch.example.com:123/bla/" as HostPortPath); - t.is(r1.contractPriv, "foo"); + assert.strictEqual( + r1.exchangeBaseUrl, + "https://exch.example.com:123/bla/" as HostPortPath, + ); + assert.strictEqual(r1.contractPriv, "foo"); }); test("taler-new peer to peer push URI (http)", (t) => { const url1 = "taler+http://pay-push/exch.example.com:123/bla/foo"; const r1 = Result.unpack(TalerUris.fromString(url1)); if (r1.type !== TalerUriAction.PayPush) { - t.fail(); + assert.fail(); return; } - t.is(r1.exchangeBaseUrl, "http://exch.example.com:123/bla/" as HostPortPath); - t.is(r1.contractPriv, "foo"); + assert.strictEqual( + r1.exchangeBaseUrl, + "http://exch.example.com:123/bla/" as HostPortPath, + ); + assert.strictEqual(r1.contractPriv, "foo"); }); test("taler-new peer to peer push URI (stringify)", (t) => { @@ -287,7 +311,7 @@ test("taler-new peer to peer push URI (stringify)", (t) => { exchangeBaseUrl: "https://foo.example.com/bla/" as HostPortPath, contractPriv: "123", }); - t.deepEqual(url, "taler://pay-push/foo.example.com/bla/123"); + assert.deepStrictEqual(url, "taler://pay-push/foo.example.com/bla/123"); }); /** @@ -300,33 +324,42 @@ test("taler-new peer to peer pull URI", (t) => { const r1 = Result.unpack(TalerUris.fromString(url1)); if (r1.type !== TalerUriAction.PayPull) { - t.fail(); + assert.fail(); return; } - t.is(r1.exchangeBaseUrl, "https://exch.example.com/" as HostPortPath); - t.is(r1.contractPriv, "foo"); + assert.strictEqual( + r1.exchangeBaseUrl, + "https://exch.example.com/" as HostPortPath, + ); + assert.strictEqual(r1.contractPriv, "foo"); }); test("taler-new peer to peer pull URI (path)", (t) => { const url1 = "taler://pay-pull/exch.example.com:123/bla/foo"; const r1 = Result.unpack(TalerUris.fromString(url1)); if (r1.type !== TalerUriAction.PayPull) { - t.fail(); + assert.fail(); return; } - t.is(r1.exchangeBaseUrl, "https://exch.example.com:123/bla/" as HostPortPath); - t.is(r1.contractPriv, "foo"); + assert.strictEqual( + r1.exchangeBaseUrl, + "https://exch.example.com:123/bla/" as HostPortPath, + ); + assert.strictEqual(r1.contractPriv, "foo"); }); test("taler-new peer to peer pull URI (http)", (t) => { const url1 = "taler+http://pay-pull/exch.example.com:123/bla/foo"; const r1 = Result.unpack(TalerUris.fromString(url1)); if (r1.type !== TalerUriAction.PayPull) { - t.fail(); + assert.fail(); return; } - t.is(r1.exchangeBaseUrl, "http://exch.example.com:123/bla/" as HostPortPath); - t.is(r1.contractPriv, "foo"); + assert.strictEqual( + r1.exchangeBaseUrl, + "http://exch.example.com:123/bla/" as HostPortPath, + ); + assert.strictEqual(r1.contractPriv, "foo"); }); test("taler-new peer to peer pull URI (stringify)", (t) => { @@ -335,7 +368,7 @@ test("taler-new peer to peer pull URI (stringify)", (t) => { exchangeBaseUrl: "https://foo.example.com/bla/" as HostPortPath, contractPriv: "123", }); - t.deepEqual(url, "taler://pay-pull/foo.example.com/bla/123"); + assert.deepStrictEqual(url, "taler://pay-pull/foo.example.com/bla/123"); }); /** @@ -349,14 +382,14 @@ test("taler-new pay template URI (parsing)", (t) => { const r1 = Result.unpack(TalerUris.fromString(url1)); if (r1.type !== TalerUriAction.PayTemplate) { - t.fail(); + assert.fail(); return; } - t.deepEqual( + assert.deepStrictEqual( r1.merchantBaseUrl, "https://merchant.example.com/" as HostPortPath, ); - t.deepEqual(r1.templateId, "FEGHYJY48FEGU6WETYIOIDEDE2QW3OCZVY"); + assert.deepStrictEqual(r1.templateId, "FEGHYJY48FEGU6WETYIOIDEDE2QW3OCZVY"); }); test("taler-new pay template URI (parsing, case-sensitive)", (t) => { @@ -366,14 +399,14 @@ test("taler-new pay template URI (parsing, case-sensitive)", (t) => { const r1 = Result.unpack(TalerUris.fromString(url1)); if (r1.type !== TalerUriAction.PayTemplate) { - t.fail(); + assert.fail(); return; } - t.deepEqual( + assert.deepStrictEqual( r1.merchantBaseUrl, "https://merchant.example.com/InstaceName/" as HostPortPath, ); - t.deepEqual(r1.templateId, "FEGHYJY48FEGU6WETYIOIDEDE2QW3OCZVY"); + assert.deepStrictEqual(r1.templateId, "FEGHYJY48FEGU6WETYIOIDEDE2QW3OCZVY"); }); test("taler-new pay template URI (parsing, http with port)", (t) => { @@ -381,14 +414,14 @@ test("taler-new pay template URI (parsing, http with port)", (t) => { "taler+http://pay-template/merchant.example.com:1234/FEGHYJY48FEGU6WETYIOIDEDE2QW3OCZVY"; const r1 = Result.unpack(TalerUris.fromString(url1)); if (r1.type !== TalerUriAction.PayTemplate) { - t.fail(); + assert.fail(); return; } - t.deepEqual( + assert.deepStrictEqual( r1.merchantBaseUrl, "http://merchant.example.com:1234/" as HostPortPath, ); - t.deepEqual(r1.templateId, "FEGHYJY48FEGU6WETYIOIDEDE2QW3OCZVY"); + assert.deepStrictEqual(r1.templateId, "FEGHYJY48FEGU6WETYIOIDEDE2QW3OCZVY"); }); test("taler-new pay template URI (stringify)", (t) => { @@ -397,7 +430,7 @@ test("taler-new pay template URI (stringify)", (t) => { merchantBaseUrl: "http://merchant.example.com:1234/" as HostPortPath, templateId: "FEGHYJY48FEGU6WETYIOIDEDE2QW3OCZVY", }); - t.deepEqual( + assert.deepStrictEqual( url1, "taler+http://pay-template/merchant.example.com:1234/FEGHYJY48FEGU6WETYIOIDEDE2QW3OCZVY", ); @@ -410,7 +443,7 @@ test("taler-new pay template URI (stringify, case-sensitive)", (t) => { "http://merchant.example.com:1234/InstanceName/" as HostPortPath, templateId: "FEGHYJY48FEGU6WETYIOIDEDE2QW3OCZVY", }); - t.deepEqual( + assert.deepStrictEqual( url1, "taler+http://pay-template/merchant.example.com:1234/InstanceName/FEGHYJY48FEGU6WETYIOIDEDE2QW3OCZVY", ); @@ -427,15 +460,15 @@ test("taler-new restore URI (parsing, http with port)", (t) => { // , // ); if (r1.type !== TalerUriAction.Restore) { - t.fail(); + assert.fail(); return; } - t.deepEqual( + assert.deepStrictEqual( r1.walletRootPriv, "GJKG23V4ZBHEH45YRK7TWQE8ZTY7JWTY5094TQJSRZN5DSDBX8E0", ); - t.deepEqual(r1.providers[0], "http://prov1.example.com/"); - t.deepEqual(r1.providers[1], "http://prov2.example.com:123/"); + assert.deepStrictEqual(r1.providers[0], "http://prov1.example.com/"); + assert.deepStrictEqual(r1.providers[1], "http://prov2.example.com:123/"); }); test("taler-new restore URI (parsing, https with port)", (t) => { const url1 = @@ -443,15 +476,15 @@ test("taler-new restore URI (parsing, https with port)", (t) => { const r1 = Result.unpack(TalerUris.fromString(url1)); if (r1.type !== TalerUriAction.Restore) { - t.fail(); + assert.fail(); return; } - t.deepEqual( + assert.deepStrictEqual( r1.walletRootPriv, "GJKG23V4ZBHEH45YRK7TWQE8ZTY7JWTY5094TQJSRZN5DSDBX8E0", ); - t.deepEqual(r1.providers[0], "https://prov1.example.com/"); - t.deepEqual(r1.providers[1], "https://prov2.example.com:234/"); + assert.deepStrictEqual(r1.providers[0], "https://prov1.example.com/"); + assert.deepStrictEqual(r1.providers[1], "https://prov2.example.com:234/"); }); test("taler-new restore URI (stringify)", (t) => { @@ -463,7 +496,7 @@ test("taler-new restore URI (stringify)", (t) => { "https://prov2.example.com:234/" as HostPortPath, ], }); - t.deepEqual( + assert.deepStrictEqual( url, "taler://restore/GJKG23V4ZBHEH45YRK7TWQE8ZTY7JWTY5094TQJSRZN5DSDBX8E0/http%3A%2F%2Fprov1.example.com%2F,https%3A%2F%2Fprov2.example.com%3A234%2F", ); @@ -479,10 +512,10 @@ test("taler-new dev exp URI (parsing)", (t) => { const r1 = Result.unpack(TalerUris.fromString(url1)); if (r1.type !== TalerUriAction.DevExperiment) { - t.fail(); + assert.fail(); return; } - t.deepEqual(r1.devExperimentId, "123"); + assert.deepStrictEqual(r1.devExperimentId, "123"); }); test("taler-new dev exp URI (stringify)", (t) => { @@ -490,7 +523,7 @@ test("taler-new dev exp URI (stringify)", (t) => { type: TalerUriAction.DevExperiment, devExperimentId: "123", }); - t.deepEqual(url1, "taler://dev-experiment/123"); + assert.deepStrictEqual(url1, "taler://dev-experiment/123"); }); /** @@ -508,7 +541,7 @@ test("taler-new withdraw exchange URI (parse)", (t) => { ); // if (r1.type !== TalerUriAction.WithdrawExchange) { - // t.fail(); + // assert.fail(); // return; // } } @@ -526,11 +559,11 @@ test("taler-new withdraw exchange URI (parse)", (t) => { const url1 = "taler://withdraw-exchange/exchange.demo.taler.net/someroot/"; const r1 = Result.unpack(TalerUris.fromString(url1)); if (r1.type !== TalerUriAction.WithdrawExchange) { - t.fail(); + assert.fail(); return; } - t.deepEqual(r1.amount, undefined); - t.deepEqual( + assert.deepStrictEqual(r1.amount, undefined); + assert.deepStrictEqual( r1.exchangeBaseUrl, "https://exchange.demo.taler.net/someroot/", ); @@ -540,11 +573,11 @@ test("taler-new withdraw exchange URI (parse)", (t) => { const url1 = "taler://withdraw-exchange/exchange.demo.taler.net/"; const r1 = Result.unpack(TalerUris.fromString(url1)); if (r1.type !== TalerUriAction.WithdrawExchange) { - t.fail(); + assert.fail(); return; } - t.deepEqual(r1.amount, undefined); - t.deepEqual( + assert.deepStrictEqual(r1.amount, undefined); + assert.deepStrictEqual( r1.exchangeBaseUrl, "https://exchange.demo.taler.net/" as HostPortPath, ); @@ -555,11 +588,11 @@ test("taler-new withdraw exchange URI (parse)", (t) => { // No trailing slash, no path component const r1 = Result.unpack(TalerUris.fromString(url1)); if (r1.type !== TalerUriAction.WithdrawExchange) { - t.fail(); + assert.fail(); return; } - t.deepEqual(r1.amount, undefined); - t.deepEqual( + assert.deepStrictEqual(r1.amount, undefined); + assert.deepStrictEqual( r1.exchangeBaseUrl, "https://exchange.demo.taler.net/" as HostPortPath, ); @@ -571,7 +604,10 @@ test("taler-new withdraw exchange URI (stringify)", (t) => { type: TalerUriAction.WithdrawExchange, exchangeBaseUrl: "https://exchange.demo.taler.net" as HostPortPath, }); - t.deepEqual(url, "taler://withdraw-exchange/exchange.demo.taler.net/"); + assert.deepStrictEqual( + url, + "taler://withdraw-exchange/exchange.demo.taler.net/", + ); }); test("taler-new withdraw exchange URI with amount (stringify)", (t) => { @@ -580,7 +616,7 @@ test("taler-new withdraw exchange URI with amount (stringify)", (t) => { exchangeBaseUrl: "https://exchange.demo.taler.net" as HostPortPath, amount: "KUDOS:19" as AmountString, }); - t.deepEqual( + assert.deepStrictEqual( url, "taler://withdraw-exchange/exchange.demo.taler.net/?a=KUDOS%3A19", ); @@ -595,10 +631,10 @@ test("taler-new add exchange URI (parse)", (t) => { const url1 = "taler://add-exchange/exchange.example.com/"; const r1 = Result.unpack(TalerUris.fromString(url1)); if (r1.type !== TalerUriAction.AddExchange) { - t.fail(); + assert.fail(); return; } - t.deepEqual( + assert.deepStrictEqual( r1.exchangeBaseUrl, "https://exchange.example.com/" as HostPortPath, ); @@ -607,10 +643,10 @@ test("taler-new add exchange URI (parse)", (t) => { const url1 = "taler://add-exchange/exchanges.example.com/api/"; const r1 = Result.unpack(TalerUris.fromString(url1)); if (r1.type !== TalerUriAction.AddExchange) { - t.fail(); + assert.fail(); return; } - t.deepEqual( + assert.deepStrictEqual( r1.exchangeBaseUrl, "https://exchanges.example.com/api/" as HostPortPath, ); @@ -622,7 +658,7 @@ test("taler-new add exchange URI (stringify)", (t) => { type: TalerUriAction.AddExchange, exchangeBaseUrl: "https://exchange.demo.taler.net" as HostPortPath, }); - t.deepEqual(url, "taler://add-exchange/exchange.demo.taler.net/"); + assert.deepStrictEqual(url, "taler://add-exchange/exchange.demo.taler.net/"); }); test("taler-new add contact URI (stringify)", (t) => { @@ -634,7 +670,7 @@ test("taler-new add contact URI (stringify)", (t) => { mailboxIdentity: "SOMEHADDR", sourceBaseUrl: "https://taldir.example.com", }); - t.deepEqual( + assert.deepStrictEqual( url, "taler://add-contact/email/bob@example.com/mailbox.example.com/mb/SOMEHADDR?sourceBaseUrl=https%3A%2F%2Ftaldir.example.com", ); @@ -650,7 +686,7 @@ test("taler-new pay url parsing: wrong scheme", (t) => { TalerUriParseError.WRONG_PREFIX, ); // const r1 = parsePayUri(url1); - t.is(r1, undefined); + assert.strictEqual(r1, undefined); const url2 = "taler://refund/a/b/c/d/e/f"; const r2 = failOrThrow( @@ -658,5 +694,5 @@ test("taler-new pay url parsing: wrong scheme", (t) => { TalerUriParseError.INVALID_TARGET_PATH, ); // const r2 = parsePayUri(url2); - t.is(r2, undefined); + assert.strictEqual(r2, undefined); }); diff --git a/packages/taler-util/src/time.test.ts b/packages/taler-util/src/time.test.ts @@ -14,26 +14,27 @@ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ -import test from "ava"; +import { test } from "node:test"; +import assert from "node:assert"; import { Duration } from "./time.js"; test("duration parsing", (t) => { const d1 = Duration.fromPrettyString("1h"); - t.deepEqual(d1.d_ms, 60 * 60 * 1000); + assert.deepStrictEqual(d1.d_ms, 60 * 60 * 1000); const d2 = Duration.fromPrettyString(" 2h 1s 3m"); - t.deepEqual(d2.d_ms, 2 * 60 * 60 * 1000 + 3 * 60 * 1000 + 1000); + assert.deepStrictEqual(d2.d_ms, 2 * 60 * 60 * 1000 + 3 * 60 * 1000 + 1000); - t.throws(() => { + assert.throws(() => { Duration.fromPrettyString("5g"); }); - t.throws(() => { + assert.throws(() => { Duration.fromPrettyString("s"); }); - t.throws(() => { + assert.throws(() => { Duration.fromPrettyString("s5"); }); - t.throws(() => { + assert.throws(() => { Duration.fromPrettyString("5 5 s"); }); }); diff --git a/packages/taler-util/src/types.test.ts b/packages/taler-util/src/types.test.ts @@ -14,7 +14,8 @@ TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ -import test from "ava"; +import { test } from "node:test"; +import assert from "node:assert"; import { codecForMerchantContractTerms, EddsaPublicKeyString, @@ -52,11 +53,10 @@ test("contract terms validation", (t) => { try { codecForMerchantContractTerms().decode(c1); } catch (e) { - t.pass(); return; } - t.fail(); + assert.fail(); }); test("contract terms validation (locations)", (t) => { @@ -93,7 +93,7 @@ test("contract terms validation (locations)", (t) => { const r = codecForMerchantContractTerms().decode(c); - t.assert(r.merchant.address?.country === "DE"); - t.assert(r.delivery_location?.country === "FR"); - t.assert(r.delivery_location?.town === "Rennes"); + assert.ok(r.merchant.address?.country === "DE"); + assert.ok(r.delivery_location?.country === "FR"); + assert.ok(r.delivery_location?.town === "Rennes"); }); diff --git a/packages/taler-wallet-core/package.json b/packages/taler-wallet-core/package.json @@ -14,10 +14,10 @@ "scripts": { "compile": "tsc", "pretty": "prettier --write src", - "test": "tsc && ava", + "test": "tsc && node --test lib/*.test.js lib/**/*.test.js", "typedoc": "typedoc --out dist/typedoc ./src/", - "coverage": "tsc && c8 --src src --all ava", - "coverage:html": "tsc && c8 -r html --src src --all ava", + "coverage": "tsc && c8 --src src --all node --test lib/*.test.js lib/**/*.test.js", + "coverage:html": "tsc && c8 -r html --src src --all node --test lib/*.test.js lib/**/*.test.js", "clean": "rm -rf dist lib tsconfig.tsbuildinfo" }, "files": [ @@ -53,14 +53,13 @@ } }, "devDependencies": { - "@ava/typescript": "^4.1.0", "@gnu-taler/pogen": "workspace:*", - "ava": "^8.0.0", "c8": "^11.0.0", "jed": "^1.1.1", "prettier": "^3.8.3", "typedoc": "^0.28.19", - "typescript": "^6.0.3" + "typescript": "^6.0.3", + "@types/node": "^18.11.17" }, "dependencies": { "@gnu-taler/idb-bridge": "workspace:*", @@ -69,10 +68,5 @@ "big-integer": "^1.6.52", "fflate": "^0.8.1", "tslib": "^2.6.2" - }, - "ava": { - "files": [ - "lib/**/*test.*" - ] } } diff --git a/packages/taler-wallet-core/src/coinSelection.test.ts b/packages/taler-wallet-core/src/coinSelection.test.ts @@ -24,7 +24,8 @@ import { TalerProtocolTimestamp, j2s, } from "@gnu-taler/taler-util"; -import test from "ava"; +import { test } from "node:test"; +import assert from "node:assert"; import { AvailableCoinsOfDenom, CoinSelectionTally, @@ -49,7 +50,7 @@ test("p2p: should select the coin", (t) => { const tally = emptyTallyForPeerPayment({ instructedAmount, }); - t.log(`tally before: ${j2s(tally)}`); + console.log(`tally before: ${j2s(tally)}`); const coins = testing_selectGreedy( { wireFeesPerExchange: {}, @@ -66,12 +67,12 @@ test("p2p: should select the coin", (t) => { tally, ); - t.log(`coins: ${j2s(coins)}`); - t.log(`tally: ${j2s(tally)}`); + console.log(`coins: ${j2s(coins)}`); + console.log(`tally: ${j2s(tally)}`); - t.assert(coins != null); + assert.ok(coins != null); - t.deepEqual(coins, { + assert.deepStrictEqual(coins, { "hash0;32;http://exchange.localhost/": { exchangeBaseUrl: "http://exchange.localhost/", denomPubHash: "hash0", @@ -102,7 +103,7 @@ test("p2p: should select 3 coins", (t) => { tally, ); - t.deepEqual(coins, { + assert.deepStrictEqual(coins, { "hash0;32;http://exchange.localhost/": { exchangeBaseUrl: "http://exchange.localhost/", denomPubHash: "hash0", @@ -137,7 +138,7 @@ test("p2p: can't select since the instructed amount is too high", (t) => { tally, ); - t.is(coins, undefined); + assert.strictEqual(coins, undefined); }); test("pay: select one coin to pay with fee", (t) => { @@ -168,7 +169,7 @@ test("pay: select one coin to pay with fee", (t) => { tally, ); - t.deepEqual(coins, { + assert.deepStrictEqual(coins, { "hash0;32;http://exchange.localhost/": { exchangeBaseUrl: "http://exchange.localhost/", denomPubHash: "hash0", @@ -177,7 +178,7 @@ test("pay: select one coin to pay with fee", (t) => { }, }); - t.deepEqual(tally, { + assert.deepStrictEqual(tally, { amountPayRemaining: Amounts.parseOrThrow("LOCAL:0"), amountDepositFeeLimitRemaining: zero, customerDepositFees: Amounts.parse("LOCAL:0.1"), @@ -298,7 +299,7 @@ test("p2p: regression STATER", (t) => { candidates as any, tally, ); - t.assert(!!res); + assert.ok(!!res); }); function makeCurrencyHelper(currency: string) { @@ -354,8 +355,8 @@ test("deposit max 35", (t) => { }, }, ); - t.is(Amounts.stringifyValue(result.rawAmount), "34.9"); - t.is(Amounts.stringifyValue(result.effectiveAmount), "35"); + assert.strictEqual(Amounts.stringifyValue(result.rawAmount), "34.9"); + assert.strictEqual(Amounts.stringifyValue(result.effectiveAmount), "35"); }); test("deposit max 35 with wirefee", (t) => { @@ -374,8 +375,8 @@ test("deposit max 35 with wirefee", (t) => { }, }, ); - t.is(Amounts.stringifyValue(result.rawAmount), "33.9"); - t.is(Amounts.stringifyValue(result.effectiveAmount), "35"); + assert.strictEqual(Amounts.stringifyValue(result.rawAmount), "33.9"); + assert.strictEqual(Amounts.stringifyValue(result.effectiveAmount), "35"); }); test("deposit max repeated denom", (t) => { @@ -395,8 +396,8 @@ test("deposit max repeated denom", (t) => { }, }, ); - t.is(Amounts.stringifyValue(result.rawAmount), "8.97"); - t.is(Amounts.stringifyValue(result.effectiveAmount), "9"); + assert.strictEqual(Amounts.stringifyValue(result.rawAmount), "8.97"); + assert.strictEqual(Amounts.stringifyValue(result.effectiveAmount), "9"); }); test("demo: deposit max after withdraw raw 25", (t) => { @@ -418,8 +419,8 @@ test("demo: deposit max after withdraw raw 25", (t) => { }, }, ); - t.is(Amounts.stringifyValue(result.effectiveAmount), "24.8"); - t.is(Amounts.stringifyValue(result.rawAmount), "24.67"); + assert.strictEqual(Amounts.stringifyValue(result.effectiveAmount), "24.8"); + assert.strictEqual(Amounts.stringifyValue(result.rawAmount), "24.67"); // 8 x 0.1 // 2 x 0.2 @@ -451,8 +452,8 @@ test("demo: deposit max after withdraw raw 13", (t) => { }, }, ); - t.is(Amounts.stringifyValue(result.effectiveAmount), "12.8"); - t.is(Amounts.stringifyValue(result.rawAmount), "12.69"); + assert.strictEqual(Amounts.stringifyValue(result.effectiveAmount), "12.8"); + assert.strictEqual(Amounts.stringifyValue(result.rawAmount), "12.69"); // 8 x 0.1 // 1 x 0.2 @@ -495,9 +496,9 @@ test("overpay when remaining < depositFee", (t) => { tally, ); - t.assert(coins != null); + assert.ok(coins != null); - t.deepEqual(coins, { + assert.deepStrictEqual(coins, { "hash0;32;http://exchange.localhost/": { exchangeBaseUrl: "http://exchange.localhost/", denomPubHash: "hash0", @@ -550,9 +551,9 @@ test("prefer exact denom", (t) => { tally, ); - t.assert(coins != null); + assert.ok(coins != null); - t.deepEqual(coins, { + assert.deepStrictEqual(coins, { "hash1;32;http://exchange.localhost/": { exchangeBaseUrl: "http://exchange.localhost/", denomPubHash: "hash1", diff --git a/packages/taler-wallet-core/src/crypto/workers/crypto-dispatcher.test.ts b/packages/taler-wallet-core/src/crypto/workers/crypto-dispatcher.test.ts @@ -15,7 +15,8 @@ */ import { AbsoluteTime, TalerErrorCode } from "@gnu-taler/taler-util"; -import test from "ava"; +import { test } from "node:test"; +import assert from "node:assert"; import { CryptoDispatcher, CryptoWorkerFactory } from "./crypto-dispatcher.js"; import { CryptoWorker, @@ -113,16 +114,16 @@ export class MyCryptoWorkerFactory implements CryptoWorkerFactory { test("continues after error", async (t) => { const cryptoDisp = new CryptoDispatcher(new MyCryptoWorkerFactory()); const resp1 = await cryptoDisp.doRpc("testSuccess", 0, {}); - t.assert((resp1 as any).testResult === 42); - const exc = await t.throwsAsync(async () => { + assert.ok((resp1 as any).testResult === 42); + const exc = await await assert.rejects(async () => { const resp2 = await cryptoDisp.doRpc("testError", 0, {}); }); // Check that it still works after one error. const resp2 = await cryptoDisp.doRpc("testSuccess", 0, {}); - t.assert((resp2 as any).testResult === 42); + assert.ok((resp2 as any).testResult === 42); // Check that it still works after timeout. const resp3 = await cryptoDisp.doRpc("testSuccess", 0, {}); - t.assert((resp3 as any).testResult === 42); + assert.ok((resp3 as any).testResult === 42); }); diff --git a/packages/taler-wallet-core/src/denominations.test.ts b/packages/taler-wallet-core/src/denominations.test.ts @@ -33,7 +33,8 @@ import { createTimeline, selectBestForOverlappingDenominations, } from "./denominations.js"; -import test, { ExecutionContext } from "ava"; +import { test } from "node:test"; +import assert from "node:assert"; /** * Create some constants to be used as reference in the tests @@ -56,11 +57,11 @@ function normalize( //Avoiding to make an error-prone/time-consuming refactor //this function calls AVA's deepEqual from a chai interface -function expect(t: ExecutionContext, thing: any): any { +function expect(t: any, thing: any): any { return { deep: { - equal: (another: any) => t.deepEqual(thing, another), - equals: (another: any) => t.deepEqual(thing, another), + equal: (another: any) => assert.deepStrictEqual(thing, another), + equals: (another: any) => assert.deepStrictEqual(thing, another), }, }; } diff --git a/packages/taler-wallet-core/src/instructedAmountConversion.test.ts b/packages/taler-wallet-core/src/instructedAmountConversion.test.ts @@ -21,7 +21,8 @@ import { Duration, TransactionAmountMode, } from "@gnu-taler/taler-util"; -import test, { ExecutionContext } from "ava"; +import { test } from "node:test"; +import assert from "node:assert"; import { CoinInfo, convertDepositAmountForAvailableCoins, @@ -72,8 +73,8 @@ test("deposit effective 2", (t) => { kudos`2`, TransactionAmountMode.Effective, ); - t.is(Amounts.stringifyValue(result.effective), "2"); - t.is(Amounts.stringifyValue(result.raw), "1.99"); + assert.strictEqual(Amounts.stringifyValue(result.effective), "2"); + assert.strictEqual(Amounts.stringifyValue(result.raw), "1.99"); }); test("deposit effective 10", (t) => { @@ -89,8 +90,8 @@ test("deposit effective 10", (t) => { kudos`10`, TransactionAmountMode.Effective, ); - t.is(Amounts.stringifyValue(result.effective), "10"); - t.is(Amounts.stringifyValue(result.raw), "9.98"); + assert.strictEqual(Amounts.stringifyValue(result.effective), "10"); + assert.strictEqual(Amounts.stringifyValue(result.raw), "9.98"); }); test("deposit effective 24", (t) => { @@ -106,8 +107,8 @@ test("deposit effective 24", (t) => { kudos`24`, TransactionAmountMode.Effective, ); - t.is(Amounts.stringifyValue(result.effective), "24"); - t.is(Amounts.stringifyValue(result.raw), "23.94"); + assert.strictEqual(Amounts.stringifyValue(result.effective), "24"); + assert.strictEqual(Amounts.stringifyValue(result.raw), "23.94"); }); test("deposit effective 40", (t) => { @@ -123,8 +124,8 @@ test("deposit effective 40", (t) => { kudos`40`, TransactionAmountMode.Effective, ); - t.is(Amounts.stringifyValue(result.effective), "35"); - t.is(Amounts.stringifyValue(result.raw), "34.9"); + assert.strictEqual(Amounts.stringifyValue(result.effective), "35"); + assert.strictEqual(Amounts.stringifyValue(result.raw), "34.9"); }); test("deposit with wire fee effective 2", (t) => { @@ -147,8 +148,8 @@ test("deposit with wire fee effective 2", (t) => { kudos`2`, TransactionAmountMode.Effective, ); - t.is(Amounts.stringifyValue(result.effective), "2"); - t.is(Amounts.stringifyValue(result.raw), "1.89"); + assert.strictEqual(Amounts.stringifyValue(result.effective), "2"); + assert.strictEqual(Amounts.stringifyValue(result.raw), "1.89"); }); /** @@ -169,8 +170,8 @@ test("deposit raw 1.99 (effective 2)", (t) => { kudos`1.99`, TransactionAmountMode.Raw, ); - t.is(Amounts.stringifyValue(result.effective), "2"); - t.is(Amounts.stringifyValue(result.raw), "1.99"); + assert.strictEqual(Amounts.stringifyValue(result.effective), "2"); + assert.strictEqual(Amounts.stringifyValue(result.raw), "1.99"); }); test("deposit raw 9.98 (effective 10)", (t) => { @@ -186,8 +187,8 @@ test("deposit raw 9.98 (effective 10)", (t) => { kudos`9.98`, TransactionAmountMode.Raw, ); - t.is(Amounts.stringifyValue(result.effective), "10"); - t.is(Amounts.stringifyValue(result.raw), "9.98"); + assert.strictEqual(Amounts.stringifyValue(result.effective), "10"); + assert.strictEqual(Amounts.stringifyValue(result.raw), "9.98"); }); test("deposit raw 23.94 (effective 24)", (t) => { @@ -203,8 +204,8 @@ test("deposit raw 23.94 (effective 24)", (t) => { kudos`23.94`, TransactionAmountMode.Raw, ); - t.is(Amounts.stringifyValue(result.effective), "24"); - t.is(Amounts.stringifyValue(result.raw), "23.94"); + assert.strictEqual(Amounts.stringifyValue(result.effective), "24"); + assert.strictEqual(Amounts.stringifyValue(result.raw), "23.94"); }); test("deposit raw 34.9 (effective 40)", (t) => { @@ -220,8 +221,8 @@ test("deposit raw 34.9 (effective 40)", (t) => { kudos`34.9`, TransactionAmountMode.Raw, ); - t.is(Amounts.stringifyValue(result.effective), "35"); - t.is(Amounts.stringifyValue(result.raw), "34.9"); + assert.strictEqual(Amounts.stringifyValue(result.effective), "35"); + assert.strictEqual(Amounts.stringifyValue(result.raw), "34.9"); }); test("deposit with wire fee raw 2", (t) => { @@ -244,8 +245,8 @@ test("deposit with wire fee raw 2", (t) => { kudos`2`, TransactionAmountMode.Effective, ); - t.is(Amounts.stringifyValue(result.effective), "2"); - t.is(Amounts.stringifyValue(result.raw), "1.89"); + assert.strictEqual(Amounts.stringifyValue(result.effective), "2"); + assert.strictEqual(Amounts.stringifyValue(result.raw), "1.89"); }); /** @@ -271,8 +272,8 @@ test("withdraw effective 2", (t) => { kudos`2`, TransactionAmountMode.Effective, ); - t.is(Amounts.stringifyValue(result.effective), "2"); - t.is(Amounts.stringifyValue(result.raw), "2.01"); + assert.strictEqual(Amounts.stringifyValue(result.effective), "2"); + assert.strictEqual(Amounts.stringifyValue(result.raw), "2.01"); }); test("withdraw effective 10", (t) => { @@ -288,8 +289,8 @@ test("withdraw effective 10", (t) => { kudos`10`, TransactionAmountMode.Effective, ); - t.is(Amounts.stringifyValue(result.effective), "10"); - t.is(Amounts.stringifyValue(result.raw), "10.02"); + assert.strictEqual(Amounts.stringifyValue(result.effective), "10"); + assert.strictEqual(Amounts.stringifyValue(result.raw), "10.02"); }); test("withdraw effective 24", (t) => { @@ -305,8 +306,8 @@ test("withdraw effective 24", (t) => { kudos`24`, TransactionAmountMode.Effective, ); - t.is(Amounts.stringifyValue(result.effective), "24"); - t.is(Amounts.stringifyValue(result.raw), "24.06"); + assert.strictEqual(Amounts.stringifyValue(result.effective), "24"); + assert.strictEqual(Amounts.stringifyValue(result.raw), "24.06"); }); test("withdraw effective 40", (t) => { @@ -322,8 +323,8 @@ test("withdraw effective 40", (t) => { kudos`40`, TransactionAmountMode.Effective, ); - t.is(Amounts.stringifyValue(result.effective), "40"); - t.is(Amounts.stringifyValue(result.raw), "40.08"); + assert.strictEqual(Amounts.stringifyValue(result.effective), "40"); + assert.strictEqual(Amounts.stringifyValue(result.raw), "40.08"); }); /** @@ -344,8 +345,8 @@ test("withdraw raw 2.01 (effective 2)", (t) => { kudos`2.01`, TransactionAmountMode.Raw, ); - t.is(Amounts.stringifyValue(result.effective), "2"); - t.is(Amounts.stringifyValue(result.raw), "2.01"); + assert.strictEqual(Amounts.stringifyValue(result.effective), "2"); + assert.strictEqual(Amounts.stringifyValue(result.raw), "2.01"); }); test("withdraw raw 10.02 (effective 10)", (t) => { @@ -361,8 +362,8 @@ test("withdraw raw 10.02 (effective 10)", (t) => { kudos`10.02`, TransactionAmountMode.Raw, ); - t.is(Amounts.stringifyValue(result.effective), "10"); - t.is(Amounts.stringifyValue(result.raw), "10.02"); + assert.strictEqual(Amounts.stringifyValue(result.effective), "10"); + assert.strictEqual(Amounts.stringifyValue(result.raw), "10.02"); }); test("withdraw raw 24.06 (effective 24)", (t) => { @@ -378,8 +379,8 @@ test("withdraw raw 24.06 (effective 24)", (t) => { kudos`24.06`, TransactionAmountMode.Raw, ); - t.is(Amounts.stringifyValue(result.effective), "24"); - t.is(Amounts.stringifyValue(result.raw), "24.06"); + assert.strictEqual(Amounts.stringifyValue(result.effective), "24"); + assert.strictEqual(Amounts.stringifyValue(result.raw), "24.06"); }); test("withdraw raw 40.08 (effective 40)", (t) => { @@ -395,8 +396,8 @@ test("withdraw raw 40.08 (effective 40)", (t) => { kudos`40.08`, TransactionAmountMode.Raw, ); - t.is(Amounts.stringifyValue(result.effective), "40"); - t.is(Amounts.stringifyValue(result.raw), "40.08"); + assert.strictEqual(Amounts.stringifyValue(result.effective), "40"); + assert.strictEqual(Amounts.stringifyValue(result.raw), "40.08"); }); test("withdraw raw 25", (t) => { @@ -414,8 +415,8 @@ test("withdraw raw 25", (t) => { kudos`25`, TransactionAmountMode.Raw, ); - t.is(Amounts.stringifyValue(result.effective), "24.8"); - t.is(Amounts.stringifyValue(result.raw), "24.94"); + assert.strictEqual(Amounts.stringifyValue(result.effective), "24.8"); + assert.strictEqual(Amounts.stringifyValue(result.raw), "24.94"); }); test("withdraw effective 24.8 (raw 25)", (t) => { @@ -433,8 +434,8 @@ test("withdraw effective 24.8 (raw 25)", (t) => { kudos`24.8`, TransactionAmountMode.Effective, ); - t.is(Amounts.stringifyValue(result.effective), "24.8"); - t.is(Amounts.stringifyValue(result.raw), "24.94"); + assert.strictEqual(Amounts.stringifyValue(result.effective), "24.8"); + assert.strictEqual(Amounts.stringifyValue(result.raw), "24.94"); }); /** @@ -457,8 +458,8 @@ test("deposit with refresh: effective 3", (t) => { kudos`3`, TransactionAmountMode.Effective, ); - t.is(Amounts.stringifyValue(result.effective), "3.1"); - t.is(Amounts.stringifyValue(result.raw), "2.98"); + assert.strictEqual(Amounts.stringifyValue(result.effective), "3.1"); + assert.strictEqual(Amounts.stringifyValue(result.raw), "2.98"); expectDefined(t, result.refresh); //FEES //deposit 2 x 0.01 @@ -472,8 +473,8 @@ test("deposit with refresh: effective 3", (t) => { //------------------- //effective 3.10 //raw 2.98 - t.is(Amounts.stringifyValue(result.refresh.selected.id), "2"); - t.deepEqual(asCoinList(result.refresh.coins), [[kudos`0.1`, 9]]); + assert.strictEqual(Amounts.stringifyValue(result.refresh.selected.id), "2"); + assert.deepStrictEqual(asCoinList(result.refresh.coins), [[kudos`0.1`, 9]]); }); test("deposit with refresh: raw 2.98 (effective 3)", (t) => { @@ -491,8 +492,8 @@ test("deposit with refresh: raw 2.98 (effective 3)", (t) => { kudos`2.98`, TransactionAmountMode.Raw, ); - t.is(Amounts.stringifyValue(result.effective), "3.2"); - t.is(Amounts.stringifyValue(result.raw), "3.09"); + assert.strictEqual(Amounts.stringifyValue(result.effective), "3.2"); + assert.strictEqual(Amounts.stringifyValue(result.raw), "3.09"); expectDefined(t, result.refresh); //FEES //deposit 1 x 0.01 @@ -506,8 +507,8 @@ test("deposit with refresh: raw 2.98 (effective 3)", (t) => { //------------------- //effective 3.20 //raw 3.09 - t.is(Amounts.stringifyValue(result.refresh.selected.id), "2"); - t.deepEqual(asCoinList(result.refresh.coins), [[kudos`0.1`, 8]]); + assert.strictEqual(Amounts.stringifyValue(result.refresh.selected.id), "2"); + assert.deepStrictEqual(asCoinList(result.refresh.coins), [[kudos`0.1`, 8]]); }); test("deposit with refresh: effective 3.2 (raw 2.98)", (t) => { @@ -525,8 +526,8 @@ test("deposit with refresh: effective 3.2 (raw 2.98)", (t) => { kudos`3.2`, TransactionAmountMode.Effective, ); - t.is(Amounts.stringifyValue(result.effective), "3.3"); - t.is(Amounts.stringifyValue(result.raw), "3.2"); + assert.strictEqual(Amounts.stringifyValue(result.effective), "3.3"); + assert.strictEqual(Amounts.stringifyValue(result.raw), "3.2"); expectDefined(t, result.refresh); //FEES //deposit 2 x 0.01 @@ -540,15 +541,12 @@ test("deposit with refresh: effective 3.2 (raw 2.98)", (t) => { //------------------- //effective 3.30 //raw 3.20 - t.is(Amounts.stringifyValue(result.refresh.selected.id), "2"); - t.deepEqual(asCoinList(result.refresh.coins), [[kudos`0.1`, 7]]); + assert.strictEqual(Amounts.stringifyValue(result.refresh.selected.id), "2"); + assert.deepStrictEqual(asCoinList(result.refresh.coins), [[kudos`0.1`, 7]]); }); -function expectDefined<T>( - t: ExecutionContext, - v: T | undefined, -): asserts v is T { - t.assert(v !== undefined); +function expectDefined<T>(t: any, v: T | undefined): asserts v is T { + assert.ok(v !== undefined); } function asCoinList(v: { info: CoinInfo; size: number }[]): any { @@ -577,8 +575,8 @@ test("demo: withdraw raw 25", (t) => { kudos`25`, TransactionAmountMode.Raw, ); - t.is(Amounts.stringifyValue(result.effective), "24.8"); - t.is(Amounts.stringifyValue(result.raw), "24.92"); + assert.strictEqual(Amounts.stringifyValue(result.effective), "24.8"); + assert.strictEqual(Amounts.stringifyValue(result.raw), "24.92"); // coins received // 8 x 0.1 // 2 x 0.2 @@ -608,8 +606,8 @@ test("demo: withdraw raw 13", (t) => { kudos`13`, TransactionAmountMode.Raw, ); - t.is(Amounts.stringifyValue(result.effective), "12.8"); - t.is(Amounts.stringifyValue(result.raw), "12.9"); + assert.strictEqual(Amounts.stringifyValue(result.effective), "12.8"); + assert.strictEqual(Amounts.stringifyValue(result.raw), "12.9"); // coins received // 8 x 0.1 // 1 x 0.2 diff --git a/packages/taler-wallet-core/src/tokenSelection.test.ts b/packages/taler-wallet-core/src/tokenSelection.test.ts @@ -14,7 +14,8 @@ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ import { MerchantContractTokenKind } from "@gnu-taler/taler-util"; -import test from "ava"; +import { test } from "node:test"; +import assert from "node:assert"; import { TokenMerchantVerificationResult, verifyTokenMerchant, @@ -28,63 +29,63 @@ test("match trusted_domains and expected_domains against merchant", (t) => { // (merchantBaseUrl, tokenMerchantBaseUrl, tokenDetails) - t.assert( + assert.ok( verifyTokenMerchant(merchant0, merchant0, { class: MerchantContractTokenKind.Discount, expected_domains: [], }) === TokenMerchantVerificationResult.Automatic, ); - t.assert( + assert.ok( verifyTokenMerchant(merchant1, merchant0, { class: MerchantContractTokenKind.Discount, expected_domains: [], }) === TokenMerchantVerificationResult.Unexpected, ); - t.assert( + assert.ok( verifyTokenMerchant(merchant2, merchant1, { class: MerchantContractTokenKind.Discount, expected_domains: ["*.taler.Net"], }) === TokenMerchantVerificationResult.Automatic, ); - t.assert( + assert.ok( verifyTokenMerchant(merchant3, merchant1, { class: MerchantContractTokenKind.Discount, expected_domains: ["*.taler.net"], }) === TokenMerchantVerificationResult.Unexpected, ); - t.assert( + assert.ok( verifyTokenMerchant(merchant3, merchant1, { class: MerchantContractTokenKind.Discount, expected_domains: ["*"], }) === TokenMerchantVerificationResult.Automatic, ); - t.assert( + assert.ok( verifyTokenMerchant(merchant2, merchant1, { class: MerchantContractTokenKind.Subscription, trusted_domains: ["*.taler.net"], }) === TokenMerchantVerificationResult.Automatic, ); - t.assert( + assert.ok( verifyTokenMerchant(merchant3, merchant1, { class: MerchantContractTokenKind.Subscription, trusted_domains: ["*.taler.net"], }) === TokenMerchantVerificationResult.Untrusted, ); - t.assert( + assert.ok( verifyTokenMerchant(merchant3, merchant1, { class: MerchantContractTokenKind.Subscription, trusted_domains: ["*.taler.net"], }) === TokenMerchantVerificationResult.Untrusted, ); - t.assert( + assert.ok( verifyTokenMerchant(merchant3, merchant1, { class: MerchantContractTokenKind.Subscription, trusted_domains: ["*"], diff --git a/packages/taler-wallet-core/src/withdraw.test.ts b/packages/taler-wallet-core/src/withdraw.test.ts @@ -21,7 +21,8 @@ import { DenomKeyType, Duration, } from "@gnu-taler/taler-util"; -import test from "ava"; +import { test } from "node:test"; +import assert from "node:assert"; import { DenominationRecord, DenominationVerificationStatus, @@ -348,6 +349,5 @@ test("withdrawal selection bug repro", (t) => { const res = selectWithdrawalDenominations(amount, denoms); - t.assert(Amounts.cmp(res.totalWithdrawCost, amount) <= 0); - t.pass(); + assert.ok(Amounts.cmp(res.totalWithdrawCost, amount) <= 0); }); diff --git a/packages/taler-wallet-core/tsconfig.json b/packages/taler-wallet-core/tsconfig.json @@ -1,8 +1,12 @@ { "extends": "../../tsconfig.defaults.json", "compilerOptions": { - "lib": ["ES2020"], - "types": ["node"], + "lib": [ + "ES2020" + ], + "types": [ + "node" + ], "outDir": "lib", "rootDir": "./src" }, @@ -14,5 +18,8 @@ "path": "../taler-util/" } ], - "include": ["src/**/*", "src/*.json"] + "include": [ + "src/**/*", + "src/*.json" + ] } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml @@ -161,9 +161,9 @@ importers: specifier: ^2.6.2 version: 2.8.1 devDependencies: - ava: - specifier: ^8.0.0 - version: 8.0.0(@ava/typescript@4.1.0)(encoding@0.1.13) + '@types/node': + specifier: ^18.11.17 + version: 18.11.17 c8: specifier: ^11.0.0 version: 11.0.0 @@ -446,11 +446,8 @@ importers: specifier: ^7.6.8 version: 7.6.8 '@types/node': - specifier: ^20.4.1 - version: 20.11.13 - ava: - specifier: ^8.0.0 - version: 8.0.0(@ava/typescript@4.1.0)(encoding@0.1.13) + specifier: ^18.11.17 + version: 18.11.17 prettier: specifier: ^3.8.3 version: 3.8.3 @@ -668,9 +665,6 @@ importers: '@types/gettext-parser': specifier: ^4.0.3 version: 4.0.4 - ava: - specifier: ^8.0.0 - version: 8.0.0(@ava/typescript@4.1.0)(encoding@0.1.13) typescript: specifier: ^6.0.3 version: 6.0.3 @@ -736,9 +730,6 @@ importers: '@types/node': specifier: ^18.11.17 version: 18.11.17 - ava: - specifier: ^8.0.0 - version: 8.0.0(@ava/typescript@4.1.0)(encoding@0.1.13) c8: specifier: ^11.0.0 version: 11.0.0 @@ -798,15 +789,9 @@ importers: specifier: ^2.6.2 version: 2.8.1 devDependencies: - '@ava/typescript': - specifier: ^4.1.0 - version: 4.1.0 '@gnu-taler/pogen': specifier: workspace:* version: link:../pogen - ava: - specifier: ^8.0.0 - version: 8.0.0(@ava/typescript@4.1.0)(encoding@0.1.13) c8: specifier: ^11.0.0 version: 11.0.0 @@ -1006,10 +991,6 @@ packages: resolution: {integrity: sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==} engines: {node: '>=10'} - '@ava/typescript@4.1.0': - resolution: {integrity: sha512-1iWZQ/nr9iflhLK9VN8H+1oDZqe93qxNnyYUz+jTzkYPAHc5fdZXBrqmNIgIfFhWYXK5OaQ5YtC7OmLeTNhVEg==} - engines: {node: ^14.19 || ^16.15 || ^18 || ^20} - '@babel/runtime@7.29.2': resolution: {integrity: sha512-JiDShH45zKHWyGe4ZNVRrCjBz8Nh9TMmZG1kh4QTK8hCBTWBi8Da+i7s1fJw7/lYpM4ccepSNfqzZ/QvABBi5g==} engines: {node: '>=6.9.0'} @@ -1261,10 +1242,6 @@ packages: resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} engines: {node: '>=12'} - '@isaacs/fs-minipass@4.0.1': - resolution: {integrity: sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==} - engines: {node: '>=18.0.0'} - '@istanbuljs/schema@0.1.6': resolution: {integrity: sha512-+Sg6GCR/wy1oSmQDFq4LQDAhm3ETKnorxN+y5nbLULOR3P0c14f2Wurzj3/xqPXtasLFfHd5iRFQ7AJt4KH2cw==} engines: {node: '>=8'} @@ -1293,11 +1270,6 @@ packages: '@kurkle/color@0.3.4': resolution: {integrity: sha512-M5UknZPHRu3DEDWoipU6sE8PdkZ6Z/S+v4dD+Ke8IaNlpdSQah50lz1KtcFBa2vsdOnwbbnxJwVM4wty6udA5w==} - '@mapbox/node-pre-gyp@2.0.3': - resolution: {integrity: sha512-uwPAhccfFJlsfCxMYTwOdVfOz3xqyj8xYL3zJj8f0pb30tLohnnFPhLuqp4/qoEz8sNxe4SESZedcBojRefIzg==} - engines: {node: '>=18'} - hasBin: true - '@nodelib/fs.scandir@2.1.5': resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} @@ -1317,15 +1289,6 @@ packages: '@polka/url@1.0.0-next.21': resolution: {integrity: sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g==} - '@rollup/pluginutils@5.3.0': - resolution: {integrity: sha512-5EdhGZtnu3V88ces7s53hhfK5KSASnJZv8Lulpc04cWO3REESroJXg73DFsOmgbU2BhwV0E20bu2IDZb3VKW4Q==} - engines: {node: '>=14.0.0'} - peerDependencies: - rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 - peerDependenciesMeta: - rollup: - optional: true - '@rtsao/scc@1.1.0': resolution: {integrity: sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==} @@ -1344,10 +1307,6 @@ packages: '@shikijs/vscode-textmate@10.0.2': resolution: {integrity: sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg==} - '@sindresorhus/merge-streams@4.0.0': - resolution: {integrity: sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==} - engines: {node: '>=18'} - '@tailwindcss/forms@0.5.3': resolution: {integrity: sha512-y5mb86JUoiUgBjY/o6FJSFZSEttfb3Q5gllE4xoKjAAD+vBrnIhE4dViwUuow3va8mpH4s9jyUbUbrRGoRdc2Q==} peerDependencies: @@ -1523,15 +1482,6 @@ packages: resolution: {integrity: sha512-f1UQF7ggd42YiwI5wGrRaPsa+P0CINBlrkLPmGfpq/u/I/oVtecoEIfFR9ag/oa1sLOsRNZ6xehf6qMZhQGBDg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@vercel/nft@1.5.0': - resolution: {integrity: sha512-IWTDeIoWhQ7ZtRO/JRKH+jhmeQvZYhtGPmzw/QGDY+wDCQqfm25P9yIdoAFagu4fWsK4IwZXDFIjrmp5rRm/sA==} - engines: {node: '>=20'} - hasBin: true - - abbrev@3.0.1: - resolution: {integrity: sha512-AO2ac6pjRB3SJmGJo+v5/aK6Omggp6fsLrs6wN9bd35ulu4cCwaAU9+7ZhXjeqHVkaHThLuzH0nZr0YpCDhygg==} - engines: {node: ^18.17.0 || >=20.5.0} - abort-controller@3.0.0: resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==} engines: {node: '>=6.5'} @@ -1540,11 +1490,6 @@ packages: resolution: {integrity: sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==} engines: {node: '>= 0.6'} - acorn-import-attributes@1.9.5: - resolution: {integrity: sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==} - peerDependencies: - acorn: ^8 - acorn-jsx@5.3.2: resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: @@ -1559,10 +1504,6 @@ packages: engines: {node: '>=0.4.0'} hasBin: true - agent-base@7.1.4: - resolution: {integrity: sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==} - engines: {node: '>= 14'} - ajv@6.15.0: resolution: {integrity: sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==} @@ -1595,9 +1536,6 @@ packages: arg@5.0.2: resolution: {integrity: sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==} - argparse@1.0.10: - resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - argparse@2.0.1: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} @@ -1609,10 +1547,6 @@ packages: resolution: {integrity: sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==} engines: {node: '>= 0.4'} - array-find-index@1.0.2: - resolution: {integrity: sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==} - engines: {node: '>=0.10.0'} - array-includes@3.1.9: resolution: {integrity: sha512-FmeCCAenzH0KH381SPT5FZmiA/TmpndpcaShhfgEN9eCVjnFBqq3l1xrI42y8+PPLI6hypzou4GXw00WHmPBLQ==} engines: {node: '>= 0.4'} @@ -1641,14 +1575,6 @@ packages: resolution: {integrity: sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==} engines: {node: '>= 0.4'} - arrgv@1.0.2: - resolution: {integrity: sha512-a4eg4yhp7mmruZDQFqVMlxNRFGi/i1r87pt8SDHy0/I8PqSXoUTlWZRdAZo0VXgvEARcujbtTk8kiZRi1uDGRw==} - engines: {node: '>=8.0.0'} - - arrify@3.0.0: - resolution: {integrity: sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==} - engines: {node: '>=12'} - ast-types-flow@0.0.8: resolution: {integrity: sha512-OH/2E5Fg20h2aPrbe+QL8JZQFko0YZaF+j4mnQ7BGhfavO7OpSLa8a0y9sBwomHdSbkhTS8TQNayBfnW5DwbvQ==} @@ -1656,9 +1582,6 @@ packages: resolution: {integrity: sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==} engines: {node: '>= 0.4'} - async-sema@3.1.1: - resolution: {integrity: sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==} - autoprefixer@10.4.14: resolution: {integrity: sha512-FQzyfOsTlwVzjHxKEqRIAdJx9niO6VCBCoEwax/VLSoQF29ggECcPuBqUMZ+u8jCZOPSy8b8/8KnuFbp0SaFZQ==} engines: {node: ^10 || ^12 || >=14} @@ -1666,16 +1589,6 @@ packages: peerDependencies: postcss: ^8.1.0 - ava@8.0.0: - resolution: {integrity: sha512-KMUyT3LcnZ/5ipDAqnTGn6PQUvr1Jk4dex3v7ieQrGaMlAblfIpMLwK56HfPcObvJEzyhCWXfZjbM98FeAy0oQ==} - engines: {node: ^22.20 || ^24.12 || >=25} - hasBin: true - peerDependencies: - '@ava/typescript': '*' - peerDependenciesMeta: - '@ava/typescript': - optional: true - available-typed-arrays@1.0.7: resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==} engines: {node: '>= 0.4'} @@ -1706,12 +1619,6 @@ packages: resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==} engines: {node: '>=8'} - bindings@1.5.0: - resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} - - blueimp-md5@2.19.0: - resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==} - body-parser@2.2.2: resolution: {integrity: sha512-oP5VkATKlNwcgvxi0vM0p/D3n2C3EReYVX+DNYs5TjZFn/oQt2j+4sVJtSMr18pdRr8wjTcBl6LoV+FUwzPmNA==} engines: {node: '>=18'} @@ -1796,10 +1703,6 @@ packages: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} - callsites@4.2.0: - resolution: {integrity: sha512-kfzR4zzQtAE9PC7CzZsjl3aBNbXWuXiSeOCdLcPpBfGW8YuCqQHcRPFDbr/BPVmd3EEPVpuFzLyuT/cUhPr4OQ==} - engines: {node: '>=12.20'} - camelcase-css@2.0.1: resolution: {integrity: sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==} engines: {node: '>= 6'} @@ -1811,10 +1714,6 @@ packages: caniuse-lite@1.0.30001570: resolution: {integrity: sha512-+3e0ASu4sw1SWaoCtvPeyXp+5PsjigkSt8OXZbF9StH5pQWbxEjLAZE3n8Aup5udop1uRiKA7a4utUk/uoSpUw==} - cbor@10.0.12: - resolution: {integrity: sha512-exQDevYd7ZQLP4moMQcZkKCVZsXLAtUSflObr3xTh4xzFIv/xBCdvCd6L259kQOUP2kcTC0jvC6PpZIf/WmRXA==} - engines: {node: '>=20'} - chai@6.2.2: resolution: {integrity: sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==} engines: {node: '>=18'} @@ -1823,10 +1722,6 @@ packages: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} - chalk@5.6.2: - resolution: {integrity: sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - chart.js@4.5.0: resolution: {integrity: sha512-aYeC/jDgSEx8SHWZvANYMioYMZ2KX02W6f6uVfyteuCGcadDLcYVHdfdygsTQkQ4TKn5lghoojAsPj5pu0SnvQ==} engines: {pnpm: '>=8'} @@ -1845,24 +1740,6 @@ packages: resolution: {integrity: sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==} engines: {node: '>= 14.16.0'} - chownr@3.0.0: - resolution: {integrity: sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==} - engines: {node: '>=18'} - - chunkd@2.0.1: - resolution: {integrity: sha512-7d58XsFmOq0j6el67Ug9mHf9ELUXsQXYJBkyxhH/k+6Ke0qXRnv0kbemx+Twc6fRJ07C49lcbdgm9FL1Ei/6SQ==} - - ci-info@4.4.0: - resolution: {integrity: sha512-77PSwercCZU2Fc4sX94eF8k8Pxte6JAwL4/ICZLFjJLqegs7kCuAsqqj/70NQF6TvDpgFjkubQB2FW2ZZddvQg==} - engines: {node: '>=8'} - - ci-parallel-vars@1.0.1: - resolution: {integrity: sha512-uvzpYrpmidaoxvIQHM+rKSrigjOe9feHYbw4uOI2gdfe1C3xIlxO+kVXq83WQWNniTf8bAxVpy+cQeFQsMERKg==} - - cli-truncate@6.0.0: - resolution: {integrity: sha512-3+YKIUFsohD9MIoOFPFBldjAlnfCmCDcqe6aYGFqlDTRKg80p4wg35L+j83QQ63iOlKRccEkbn8IuM++HsgEjA==} - engines: {node: '>=22'} - client-only@0.0.1: resolution: {integrity: sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==} @@ -1870,14 +1747,6 @@ packages: resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} engines: {node: '>=12'} - cliui@9.0.1: - resolution: {integrity: sha512-k7ndgKhwoQveBL+/1tqGJYNz097I7WOvwbmmU2AR5+magtbjPWQTS1C5vzGkBC8Ym8UWRzfKUzUUqFLypY4Q+w==} - engines: {node: '>=20'} - - code-excerpt@4.0.0: - resolution: {integrity: sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - color-convert@2.0.1: resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} engines: {node: '>=7.0.0'} @@ -1889,20 +1758,9 @@ packages: resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==} engines: {node: '>= 6'} - common-path-prefix@3.0.0: - resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} - concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - concordance@5.0.4: - resolution: {integrity: sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==} - engines: {node: '>=10.18.0 <11 || >=12.14.0 <13 || >=14'} - - consola@3.4.2: - resolution: {integrity: sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==} - engines: {node: ^14.18.0 || >=16.10.0} - console-clear@1.1.1: resolution: {integrity: sha512-pMD+MVR538ipqkG5JXeOEbKWS5um1H4LUUccUQG68qpeqBYbzYy79Gh55jkd2TtPdRfUaLWdv6LPP//5Zt0aPQ==} engines: {node: '>=4'} @@ -1922,10 +1780,6 @@ packages: convert-source-map@2.0.0: resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} - convert-to-spaces@2.0.1: - resolution: {integrity: sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - cookie-signature@1.2.2: resolution: {integrity: sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==} engines: {node: '>=6.6.0'} @@ -1949,10 +1803,6 @@ packages: engines: {node: '>=4'} hasBin: true - currently-unhandled@0.4.1: - resolution: {integrity: sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==} - engines: {node: '>=0.10.0'} - damerau-levenshtein@1.0.8: resolution: {integrity: sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==} @@ -1976,10 +1826,6 @@ packages: resolution: {integrity: sha512-dDCnyH2WnnKusqvZZ6+jA1O51Ibt8ZMRNkDZdyAyK4YfbDwa/cEmuztzG5pk6hqlp9aSBPYcjOlktquahGwGeA==} engines: {node: '>=0.11'} - date-time@3.1.0: - resolution: {integrity: sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==} - engines: {node: '>=6'} - debug@3.2.7: resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} peerDependencies: @@ -2016,10 +1862,6 @@ packages: resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==} engines: {node: '>= 0.8'} - detect-libc@2.1.2: - resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} - engines: {node: '>=8'} - didyoumean@1.2.2: resolution: {integrity: sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==} @@ -2055,13 +1897,6 @@ packages: electron-to-chromium@1.4.613: resolution: {integrity: sha512-r4x5+FowKG6q+/Wj0W9nidx7QO31BJwmR2uEo+Qh3YLGQ8SbBAFuDFpTxzly/I2gsbrFwBuIjrMp423L3O5U3w==} - emittery@2.0.0: - resolution: {integrity: sha512-FLtgn/CGBXiX3ZtPAm5q4LWWepHChOt55J9u01WFu3dyap2U7IwptlrqoE1COR/kxwdy/DOxIBALSxIW449I1g==} - engines: {node: '>=22'} - - emoji-regex@10.6.0: - resolution: {integrity: sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==} - emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} @@ -2123,18 +1958,10 @@ packages: escape-html@1.0.3: resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==} - 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'} - escape-string-regexp@5.0.0: - resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} - engines: {node: '>=12'} - eslint-config-prettier@10.1.8: resolution: {integrity: sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==} hasBin: true @@ -2228,11 +2055,6 @@ packages: resolution: {integrity: sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} - hasBin: true - esquery@1.7.0: resolution: {integrity: sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==} engines: {node: '>=0.10'} @@ -2245,9 +2067,6 @@ packages: resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} engines: {node: '>=4.0'} - estree-walker@2.0.2: - resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - esutils@2.0.3: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} engines: {node: '>=0.10.0'} @@ -2264,10 +2083,6 @@ packages: resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==} engines: {node: '>=0.8.x'} - execa@7.2.0: - resolution: {integrity: sha512-UduyVP7TLB5IcAQl+OzLyLcS/l32W/GLg+AhHJ+ow40FOk2U3SAllPwR44v4vmdFwIWqpdwxxpQbF1n5ta9seA==} - engines: {node: ^14.18.0 || ^16.14.0 || >=18.0.0} - express@5.2.1: resolution: {integrity: sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==} engines: {node: '>= 18'} @@ -2275,9 +2090,6 @@ packages: fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} - fast-diff@1.3.0: - resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} - fast-glob@3.3.3: resolution: {integrity: sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==} engines: {node: '>=8.6.0'} @@ -2303,17 +2115,10 @@ packages: fflate@0.8.1: resolution: {integrity: sha512-/exOvEuc+/iaUm105QIiOt4LpBdMTWsXxqR0HDF35vx3fmaKzw7354gTilCh5rkzEt8WYyG//ku3h3nRmd7CHQ==} - figures@6.1.0: - resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} - engines: {node: '>=18'} - file-entry-cache@8.0.0: resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} engines: {node: '>=16.0.0'} - file-uri-to-path@1.0.0: - resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} - fill-range@7.1.1: resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} engines: {node: '>=8'} @@ -2322,10 +2127,6 @@ packages: resolution: {integrity: sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==} engines: {node: '>= 18.0.0'} - find-up-simple@1.0.1: - resolution: {integrity: sha512-afd4O7zpqHeRyg4PfDQsXmlDe2PfdHtJt6Akt8jOWaApLOZk5JXs6VMR29lz03pRe9mpykrRCYIYxaJYcfpncQ==} - engines: {node: '>=18'} - find-up@5.0.0: resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} engines: {node: '>=10'} @@ -2392,10 +2193,6 @@ packages: resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} engines: {node: 6.* || 8.* || >= 10.*} - get-east-asian-width@1.6.0: - resolution: {integrity: sha512-QRbvDIbx6YklUe6RxeTeleMR0yv3cYH6PsPZHcnVn7xv7zO1BHN8r0XETu8n6Ye3Q+ahtSarc3WgtNWmehIBfA==} - engines: {node: '>=18'} - get-intrinsic@1.3.0: resolution: {integrity: sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==} engines: {node: '>= 0.4'} @@ -2408,10 +2205,6 @@ packages: resolution: {integrity: sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==} engines: {node: '>= 0.4'} - get-stream@6.0.1: - resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} - engines: {node: '>=10'} - get-symbol-description@1.1.0: resolution: {integrity: sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==} engines: {node: '>= 0.4'} @@ -2449,17 +2242,10 @@ packages: resolution: {integrity: sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==} engines: {node: '>= 0.4'} - globby@16.2.0: - resolution: {integrity: sha512-QrJia2qDf5BB/V6HYlDTs0I0lBahyjLzpGQg3KT7FnCdTonAyPy2RtY802m2k4ALx6Dp752f82WsOczEVr3l6Q==} - engines: {node: '>=20'} - gopd@1.2.0: resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} engines: {node: '>= 0.4'} - graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - has-bigints@1.1.0: resolution: {integrity: sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==} engines: {node: '>= 0.4'} @@ -2504,14 +2290,6 @@ packages: resolution: {integrity: sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==} engines: {node: '>= 0.8'} - https-proxy-agent@7.0.6: - resolution: {integrity: sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==} - engines: {node: '>= 14'} - - human-signals@4.3.1: - resolution: {integrity: sha512-nZXjEF2nbo7lIw3mgYjItAfgQXog3OjJogSbKa2CQIIvSGWcKgeJnQlNXip6NglNzYH45nSRiEVimMvYL8DDqQ==} - engines: {node: '>=14.18.0'} - iconv-lite@0.6.3: resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} engines: {node: '>=0.10.0'} @@ -2523,10 +2301,6 @@ packages: ieee754@1.2.1: resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} - ignore-by-default@2.1.0: - resolution: {integrity: sha512-yiWd4GVmJp0Q6ghmM2B/V3oZGRmjrKLXvHR3TE1nfoXsmoggllfZUQe74EN0fJdPFZu2NIvNdrMMLm3OsV7Ohw==} - engines: {node: '>=10 <11 || >=12 <13 || >=14'} - ignore@5.3.2: resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} engines: {node: '>= 4'} @@ -2549,10 +2323,6 @@ packages: resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} engines: {node: '>=0.8.19'} - indent-string@5.0.0: - resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} - engines: {node: '>=12'} - inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} @@ -2564,10 +2334,6 @@ packages: resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==} engines: {node: '>= 0.10'} - irregular-plurals@4.2.0: - resolution: {integrity: sha512-bW9UXHL7bnUcNtTo+9ccSngbxc+V40H32IgvdVin0Xs8gbo+AVYD5g/72ce/54Kjfhq66vcZr8H8TKEvsifeOw==} - engines: {node: '>=18.20'} - is-array-buffer@3.0.5: resolution: {integrity: sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==} engines: {node: '>= 0.4'} @@ -2616,10 +2382,6 @@ packages: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} engines: {node: '>=8'} - is-fullwidth-code-point@5.1.0: - resolution: {integrity: sha512-5XHYaSyiqADb4RnZ1Bdad6cPp8Toise4TzEjcOYDHZkTCbKgiUl7WTUCpNWHuxmDt91wnsZBc9xinNzopv3JMQ==} - engines: {node: '>=18'} - is-generator-function@1.1.2: resolution: {integrity: sha512-upqt1SkGkODW9tsGNG5mtXTXtECizwtS2kA161M+gJPc1xdb/Ax629af6YrTwcOeQHbewrPNlE5Dx7kzvXTizA==} engines: {node: '>= 0.4'} @@ -2648,18 +2410,10 @@ packages: resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} engines: {node: '>=8'} - is-path-inside@4.0.0: - resolution: {integrity: sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA==} - engines: {node: '>=12'} - is-plain-obj@2.1.0: resolution: {integrity: sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==} engines: {node: '>=8'} - is-plain-object@5.0.0: - resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} - engines: {node: '>=0.10.0'} - is-promise@4.0.0: resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} @@ -2675,10 +2429,6 @@ packages: resolution: {integrity: sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==} engines: {node: '>= 0.4'} - is-stream@3.0.0: - resolution: {integrity: sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - is-string@1.1.1: resolution: {integrity: sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==} engines: {node: '>= 0.4'} @@ -2695,10 +2445,6 @@ packages: resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} engines: {node: '>=10'} - is-unicode-supported@2.1.0: - resolution: {integrity: sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==} - engines: {node: '>=18'} - is-weakmap@2.0.2: resolution: {integrity: sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==} engines: {node: '>= 0.4'} @@ -2746,17 +2492,9 @@ packages: resolution: {integrity: sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A==} hasBin: true - js-string-escape@1.0.1: - resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} - engines: {node: '>= 0.8'} - js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - js-yaml@3.14.2: - resolution: {integrity: sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==} - hasBin: true - js-yaml@4.1.1: resolution: {integrity: sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==} hasBin: true @@ -2818,10 +2556,6 @@ packages: linkify-it@5.0.0: resolution: {integrity: sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==} - load-json-file@7.0.1: - resolution: {integrity: sha512-Gnxj3ev3mB5TkVBGad0JM6dmLiQL+o0t23JPBZ9sd+yvSLk05mFoqKBw5N8gbbkU4TNXyqCgIrl/VM17OgUIgQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - local-access@1.1.0: resolution: {integrity: sha512-XfegD5pyTAfb+GY6chk283Ox5z8WexG56OvM06RWLpAc/UHozO8X6xAxEkIitZOtsSMM1Yr3DkHgW5W+onLhCw==} engines: {node: '>=6'} @@ -2833,9 +2567,6 @@ packages: lodash.merge@4.6.2: resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} - lodash@4.18.1: - resolution: {integrity: sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==} - log-symbols@4.1.0: resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} engines: {node: '>=10'} @@ -2865,18 +2596,10 @@ packages: resolution: {integrity: sha512-BuU2qnTti9YKgK5N+IeMubp14ZUKUUw7yeJbkjtosvHiP0AZ5c8IAgEMk79D0eC8F23r4Ac/q8cAIFdm2FtyoA==} hasBin: true - matcher@6.0.0: - resolution: {integrity: sha512-TzDerdcNtI79w7Av4GT57bLdElPA/VAkjqdMZv8yhuc8geU2z0ljW9anXbX/55aHEMTpYypZb1lxsA/46r9oOQ==} - engines: {node: '>=20'} - math-intrinsics@1.1.0: resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==} engines: {node: '>= 0.4'} - md5-hex@3.0.1: - resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==} - engines: {node: '>=8'} - mdurl@2.0.0: resolution: {integrity: sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==} @@ -2884,17 +2607,10 @@ packages: resolution: {integrity: sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==} engines: {node: '>= 0.8'} - memoize@11.0.0: - resolution: {integrity: sha512-cjsfZaC9b1clqPeIVMbb5dLHSXgdgGWGxdAU3oTUUkHiwWTKTBNnSmcqWJncNjYtBi3S8Rp0c5GIiyGztR8TRA==} - engines: {node: '>=22'} - merge-descriptors@2.0.0: resolution: {integrity: sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==} engines: {node: '>=18'} - 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'} @@ -2911,14 +2627,6 @@ packages: resolution: {integrity: sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==} engines: {node: '>=18'} - mimic-fn@4.0.0: - resolution: {integrity: sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==} - engines: {node: '>=12'} - - mimic-function@5.0.1: - resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} - engines: {node: '>=18'} - mini-svg-data-uri@1.4.4: resolution: {integrity: sha512-r9deDe9p5FJUPZAk3A59wGH7Ii9YrjjWw0jmw/liSbHl2CHiyXj6FcDXDu2K3TjVAXqiJdaw3xxwlZZr9E6nHg==} hasBin: true @@ -2941,10 +2649,6 @@ packages: resolution: {integrity: sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==} engines: {node: '>=16 || 14 >=14.17'} - minizlib@3.1.0: - resolution: {integrity: sha512-KZxYo1BUkWD2TVFLr0MQoM8vUUigWD3LlD83a/75BqC+4qE0Hb1Vo5v1FgcfaNXvfXzr+5EhQ6ing/CaBijTlw==} - engines: {node: '>= 18'} - mocha@11.7.5: resolution: {integrity: sha512-mTT6RgopEYABzXWFx+GcJ+ZQ32kp4fMf0xvpZIIfSq9Z8lC/++MtcCnQ9t5FP2veYEP95FIYSvW+U9fV4xrlig==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -2984,31 +2688,9 @@ packages: resolution: {integrity: sha512-pyFS63ptit/P5WqUkt+UUfe+4oevH+bFeIiPPdfb0pFeYEu/1ELnJu5l+5EcTKYL5M7zaAa7S8ddywgXypqKCw==} engines: {node: '>= 0.4'} - node-fetch@2.7.0: - resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - - node-gyp-build@4.8.4: - resolution: {integrity: sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==} - hasBin: true - node-releases@2.0.14: resolution: {integrity: sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==} - nofilter@3.1.0: - resolution: {integrity: sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==} - engines: {node: '>=12.19'} - - nopt@8.1.0: - resolution: {integrity: sha512-ieGu42u/Qsa4TFktmaKEwM6MQH0pOWnaB3htzh0JRtx84+Mebc0cbZYN5bC+6WTZ4+77xrL9Pn5m7CV6VIkV7A==} - engines: {node: ^18.17.0 || >=20.5.0} - hasBin: true - normalize-path@3.0.0: resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} engines: {node: '>=0.10.0'} @@ -3017,10 +2699,6 @@ packages: resolution: {integrity: sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==} engines: {node: '>=0.10.0'} - npm-run-path@5.1.0: - resolution: {integrity: sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - object-assign@4.1.1: resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} engines: {node: '>=0.10.0'} @@ -3064,10 +2742,6 @@ packages: once@1.4.0: resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - onetime@6.0.0: - resolution: {integrity: sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==} - engines: {node: '>=12'} - optionator@0.9.4: resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} engines: {node: '>= 0.8.0'} @@ -3084,14 +2758,6 @@ packages: resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} engines: {node: '>=10'} - p-map@7.0.4: - resolution: {integrity: sha512-tkAQEw8ysMzmkhgw8k+1U/iPhWNhykKnSk4Rd5zLoPJCuJaGRPo6YposrZgaxHKzDHdDWWZvE/Sk7hsL2X/CpQ==} - engines: {node: '>=18'} - - package-config@5.0.0: - resolution: {integrity: sha512-GYTTew2slBcYdvRHqjhwaaydVMvn/qrGC323+nKclYioNSLTDUM/lGgtGTgyHVtYcozb+XkE8CNhwcraOmZ9Mg==} - engines: {node: '>=18'} - package-json-from-dist@1.0.1: resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==} @@ -3102,10 +2768,6 @@ packages: resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} engines: {node: '>=6'} - parse-ms@4.0.0: - resolution: {integrity: sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==} - engines: {node: '>=18'} - parseurl@1.3.3: resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==} engines: {node: '>= 0.8'} @@ -3118,10 +2780,6 @@ packages: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} engines: {node: '>=8'} - path-key@4.0.0: - resolution: {integrity: sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==} - engines: {node: '>=12'} - path-parse@1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} @@ -3155,10 +2813,6 @@ packages: resolution: {integrity: sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ==} engines: {node: '>= 6'} - plur@6.0.0: - resolution: {integrity: sha512-Y9wXQivjRX0REtwpA9+n0bYYypWESn3cWtW2vazymw711qn+AQXxzZjRqhANYGBLIMC1UzVdpwe/1hHQwHfwng==} - engines: {node: '>=20'} - polished@4.2.2: resolution: {integrity: sha512-Sz2Lkdxz6F2Pgnpi9U5Ng/WdWAUZxmHrNPoVlm3aAemxoy2Qy7LGjQg4uf8qKelDAUW94F4np3iH2YPf2qefcQ==} engines: {node: '>=10'} @@ -3237,10 +2891,6 @@ packages: pretty-format@3.8.0: resolution: {integrity: sha512-WuxUnVtlWL1OfZFQFuqvnvs6MiAGk9UNsBostyBOB0Is9wb5uRESevA6rnl/rkksXaGX3GzZhPup5d6Vp1nFew==} - pretty-ms@9.3.0: - resolution: {integrity: sha512-gjVS5hOP+M3wMm5nmNOucbIrqudzs9v/57bWRHQWLYklXqoXKrVfYW2W9+glfGsqtPgpiz5WwyEEB+ksXIx3gQ==} - engines: {node: '>=18'} - process-nextick-args@2.0.1: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} @@ -3326,18 +2976,10 @@ packages: resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} engines: {node: '>=0.10.0'} - 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'} - resolve-from@5.0.0: - resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} - engines: {node: '>=8'} - resolve-pathname@3.0.0: resolution: {integrity: sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==} @@ -3415,10 +3057,6 @@ packages: resolution: {integrity: sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==} engines: {node: '>= 18'} - serialize-error@7.0.1: - resolution: {integrity: sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==} - engines: {node: '>=10'} - serialize-javascript@6.0.2: resolution: {integrity: sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==} @@ -3468,9 +3106,6 @@ packages: resolution: {integrity: sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==} engines: {node: '>= 0.4'} - 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'} @@ -3484,14 +3119,6 @@ packages: resolution: {integrity: sha512-JuLThK3TnZG1TAKDwNIqNq6QA2afLOCcm+iE8D1Kj3GA40pSPsxQjjJl0J8X3tsR7T+CP1GavpzLwYkgVLWrZQ==} engines: {node: '>= 10'} - slash@5.1.0: - resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==} - engines: {node: '>=14.16'} - - slice-ansi@9.0.0: - resolution: {integrity: sha512-SO/3iYL5S3W57LLEniscOGPZgOqZUPCx6d3dB+52B80yJ0XstzsC/eV8gnA4tM3MHDrKz+OCFSLNjswdSC+/bA==} - engines: {node: '>=22'} - source-map-js@1.2.1: resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} engines: {node: '>=0.10.0'} @@ -3503,13 +3130,6 @@ packages: resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} engines: {node: '>=0.10.0'} - sprintf-js@1.0.3: - resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - - stack-utils@2.0.6: - resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} - engines: {node: '>=10'} - statuses@2.0.2: resolution: {integrity: sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==} engines: {node: '>= 0.8'} @@ -3526,14 +3146,6 @@ packages: resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==} engines: {node: '>=12'} - string-width@7.2.0: - resolution: {integrity: sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==} - engines: {node: '>=18'} - - string-width@8.2.1: - resolution: {integrity: sha512-IIaP0g3iy9Cyy18w3M9YcaDudujEAVHKt3a3QJg1+sr/oX96TbaGUubG0hJyCjCBThFH+tFpcIyoUHUn1ogaLA==} - engines: {node: '>=20'} - string.prototype.includes@2.0.1: resolution: {integrity: sha512-o7+c9bW6zpAdJHTtujeePODAhkuicdAryFsfVKwA+wGw89wJ4GTY484WTucM9hLtDEOpOvI+aHnzqnC5lHp4Rg==} engines: {node: '>= 0.4'} @@ -3575,10 +3187,6 @@ packages: resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} engines: {node: '>=4'} - strip-final-newline@3.0.0: - resolution: {integrity: sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==} - engines: {node: '>=12'} - strip-json-comments@3.1.1: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} @@ -3588,10 +3196,6 @@ packages: engines: {node: '>=16 || 14 >=14.17'} hasBin: true - supertap@3.0.1: - resolution: {integrity: sha512-u1ZpIBCawJnO+0QePsEiOknOfCRq0yERxiAchT0i4li0WHNUJbf0evXXSXOcCAR4M8iMDoajXYmstm/qO81Isw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - supports-color@7.2.0: resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} engines: {node: '>=8'} @@ -3620,14 +3224,6 @@ packages: engines: {node: '>=14.0.0'} hasBin: true - tar@7.5.15: - resolution: {integrity: sha512-dzGK0boVlC4W5QFuQN1EFSl3bIDYsk7Tj40U6eIBnK2k/8ml7TZ5agbI5j5+qnoVcAA+rNtBml8SEiLxZpNqRQ==} - engines: {node: '>=18'} - - temp-dir@3.0.0: - resolution: {integrity: sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==} - engines: {node: '>=14.16'} - test-exclude@8.0.0: resolution: {integrity: sha512-ZOffsNrXYggvU1mDGHk54I96r26P8SyMjO5slMKSc7+IWmtB/MQKnEC2fP51imB3/pT6YK5cT5E8f+Dd9KdyOQ==} engines: {node: 20 || >=22} @@ -3639,10 +3235,6 @@ packages: thenify@3.3.1: resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==} - time-zone@1.0.0: - resolution: {integrity: sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==} - engines: {node: '>=4'} - tiny-invariant@1.3.1: resolution: {integrity: sha512-AD5ih2NlSssTCwsMznbvwMZpJ1cbhkGd2uueNxzv2jDlEeZdU04JQfRnggJQ8DrcVBGjAsCKwFBbDlVNtEMlzw==} @@ -3673,9 +3265,6 @@ packages: resolution: {integrity: sha512-gduQwd1rOdDMGxFG1gEvhV88Oirdo2p+KjoYFU7k2g+i7n6AFFbDQ5kMPUsW0pNbfQsB/cwXvT1i4Bue0s9g5g==} engines: {node: '>=6'} - tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - ts-api-utils@2.5.0: resolution: {integrity: sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA==} engines: {node: '>=18.12'} @@ -3712,10 +3301,6 @@ packages: resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} engines: {node: '>= 0.8.0'} - type-fest@0.13.1: - resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} - engines: {node: '>=10'} - type-is@2.1.0: resolution: {integrity: sha512-faYHw0anBbc/kWF3zFTEnxSFOAGUX9GFbOBthvDdLsIlEoWOFOtS0zgCiQYwIskL9iGXZL3kAXD8OoZ4GmMATA==} engines: {node: '>= 18'} @@ -3765,10 +3350,6 @@ packages: undici-types@5.26.5: resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} - unicorn-magic@0.4.0: - resolution: {integrity: sha512-wH590V9VNgYH9g3lH9wWjTrUoKsjLF6sGLjhR4sH1LWpLmCOH0Zf7PukhDA8BiS7KHe4oPNkcTHqYkj7SOGUOw==} - engines: {node: '>=20'} - unpipe@1.0.0: resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} engines: {node: '>= 0.8'} @@ -3804,16 +3385,6 @@ packages: resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} engines: {node: '>= 0.8'} - webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - - well-known-symbols@2.0.0: - resolution: {integrity: sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==} - engines: {node: '>=6'} - - whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - which-boxed-primitive@1.1.1: resolution: {integrity: sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==} engines: {node: '>= 0.4'} @@ -3850,17 +3421,9 @@ packages: resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} engines: {node: '>=12'} - wrap-ansi@9.0.2: - resolution: {integrity: sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==} - engines: {node: '>=18'} - wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - write-file-atomic@7.0.1: - resolution: {integrity: sha512-OTIk8iR8/aCRWBqvxrzxR0hgxWpnYBblY1S5hDWBQfk/VFmJwzmJgQFN3WsoUKHISv2eAwe+PpbUzyL1CKTLXg==} - engines: {node: ^20.17.0 || >=22.9.0} - ws@7.4.5: resolution: {integrity: sha512-xzyu3hFvomRfXKH8vOFMU3OguG6oOvhXMo3xsGy3xWExqaM2dxBbVxuD99O7m3ZUFMvvscsZDqxfgMaRr/Nr1g==} engines: {node: '>=8.3.0'} @@ -3889,10 +3452,6 @@ packages: resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} engines: {node: '>=10'} - yallist@5.0.0: - resolution: {integrity: sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==} - engines: {node: '>=18'} - yaml@2.9.0: resolution: {integrity: sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==} engines: {node: '>= 14.6'} @@ -3902,10 +3461,6 @@ packages: resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} engines: {node: '>=12'} - yargs-parser@22.0.0: - resolution: {integrity: sha512-rwu/ClNdSMpkSrUb+d6BRsSkLUq1fmfsY6TOpYzTwvwkg1/NRG85KBy3kq++A8LKQwX6lsu+aWad+2khvuXrqw==} - engines: {node: ^20.19.0 || ^22.12.0 || >=23} - yargs-unparser@2.0.0: resolution: {integrity: sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==} engines: {node: '>=10'} @@ -3914,10 +3469,6 @@ packages: resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} engines: {node: '>=12'} - yargs@18.0.0: - resolution: {integrity: sha512-4UEqdc2RYGHZc7Doyqkrqiln3p9X2DZVxaGbwhn2pi7MrRagKaOcIKe8L3OxYcbhXLgLFUS3zAYuQjKBQgmuNg==} - engines: {node: ^20.19.0 || ^22.12.0 || >=23} - yn@3.1.1: resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} engines: {node: '>=6'} @@ -3930,11 +3481,6 @@ snapshots: '@alloc/quick-lru@5.2.0': {} - '@ava/typescript@4.1.0': - dependencies: - escape-string-regexp: 5.0.0 - execa: 7.2.0 - '@babel/runtime@7.29.2': {} '@bazel/runfiles@6.5.0': {} @@ -4114,10 +3660,6 @@ snapshots: wrap-ansi: 8.1.0 wrap-ansi-cjs: wrap-ansi@7.0.0 - '@isaacs/fs-minipass@4.0.1': - dependencies: - minipass: 7.1.3 - '@istanbuljs/schema@0.1.6': {} '@jridgewell/gen-mapping@0.3.5': @@ -4144,19 +3686,6 @@ snapshots: '@kurkle/color@0.3.4': {} - '@mapbox/node-pre-gyp@2.0.3(encoding@0.1.13)': - dependencies: - consola: 3.4.2 - detect-libc: 2.1.2 - https-proxy-agent: 7.0.6 - node-fetch: 2.7.0(encoding@0.1.13) - nopt: 8.1.0 - semver: 7.8.0 - tar: 7.5.15 - transitivePeerDependencies: - - encoding - - supports-color - '@nodelib/fs.scandir@2.1.5': dependencies: '@nodelib/fs.stat': 2.0.5 @@ -4174,12 +3703,6 @@ snapshots: '@polka/url@1.0.0-next.21': {} - '@rollup/pluginutils@5.3.0': - dependencies: - '@types/estree': 1.0.9 - estree-walker: 2.0.2 - picomatch: 4.0.4 - '@rtsao/scc@1.1.0': {} '@shikijs/engine-oniguruma@3.23.0': @@ -4202,8 +3725,6 @@ snapshots: '@shikijs/vscode-textmate@10.0.2': {} - '@sindresorhus/merge-streams@4.0.0': {} - '@tailwindcss/forms@0.5.3(tailwindcss@3.4.17(ts-node@10.9.1(@types/node@18.11.17)(typescript@6.0.3)))': dependencies: mini-svg-data-uri: 1.4.4 @@ -4419,27 +3940,6 @@ snapshots: '@typescript-eslint/types': 8.59.3 eslint-visitor-keys: 5.0.1 - '@vercel/nft@1.5.0(encoding@0.1.13)': - dependencies: - '@mapbox/node-pre-gyp': 2.0.3(encoding@0.1.13) - '@rollup/pluginutils': 5.3.0 - acorn: 8.16.0 - acorn-import-attributes: 1.9.5(acorn@8.16.0) - async-sema: 3.1.1 - bindings: 1.5.0 - estree-walker: 2.0.2 - glob: 13.0.6 - graceful-fs: 4.2.11 - node-gyp-build: 4.8.4 - picomatch: 4.0.4 - resolve-from: 5.0.0 - transitivePeerDependencies: - - encoding - - rollup - - supports-color - - abbrev@3.0.1: {} - abort-controller@3.0.0: dependencies: event-target-shim: 5.0.1 @@ -4449,10 +3949,6 @@ snapshots: mime-types: 3.0.2 negotiator: 1.0.0 - acorn-import-attributes@1.9.5(acorn@8.16.0): - dependencies: - acorn: 8.16.0 - acorn-jsx@5.3.2(acorn@8.16.0): dependencies: acorn: 8.16.0 @@ -4463,8 +3959,6 @@ snapshots: acorn@8.16.0: {} - agent-base@7.1.4: {} - ajv@6.15.0: dependencies: fast-deep-equal: 3.1.3 @@ -4493,10 +3987,6 @@ snapshots: arg@5.0.2: {} - argparse@1.0.10: - dependencies: - sprintf-js: 1.0.3 - argparse@2.0.1: {} aria-query@5.3.2: {} @@ -4506,8 +3996,6 @@ snapshots: call-bound: 1.0.4 is-array-buffer: 3.0.5 - array-find-index@1.0.2: {} - array-includes@3.1.9: dependencies: call-bind: 1.0.9 @@ -4570,16 +4058,10 @@ snapshots: get-intrinsic: 1.3.0 is-array-buffer: 3.0.5 - arrgv@1.0.2: {} - - arrify@3.0.0: {} - ast-types-flow@0.0.8: {} async-function@1.0.0: {} - async-sema@3.1.1: {} - autoprefixer@10.4.14(postcss@8.4.49): dependencies: browserslist: 4.22.2 @@ -4590,55 +4072,6 @@ snapshots: postcss: 8.4.49 postcss-value-parser: 4.2.0 - ava@8.0.0(@ava/typescript@4.1.0)(encoding@0.1.13): - dependencies: - '@vercel/nft': 1.5.0(encoding@0.1.13) - acorn: 8.16.0 - acorn-walk: 8.3.5 - ansi-styles: 6.2.3 - arrgv: 1.0.2 - arrify: 3.0.0 - callsites: 4.2.0 - cbor: 10.0.12 - chalk: 5.6.2 - chunkd: 2.0.1 - ci-info: 4.4.0 - ci-parallel-vars: 1.0.1 - cli-truncate: 6.0.0 - code-excerpt: 4.0.0 - common-path-prefix: 3.0.0 - concordance: 5.0.4 - currently-unhandled: 0.4.1 - debug: 4.4.3(supports-color@8.1.1) - emittery: 2.0.0 - figures: 6.1.0 - globby: 16.2.0 - ignore-by-default: 2.1.0 - indent-string: 5.0.0 - is-plain-object: 5.0.0 - is-promise: 4.0.0 - matcher: 6.0.0 - memoize: 11.0.0 - ms: 2.1.3 - p-map: 7.0.4 - package-config: 5.0.0 - picomatch: 4.0.4 - plur: 6.0.0 - pretty-ms: 9.3.0 - resolve-cwd: 3.0.0 - slash: 5.1.0 - stack-utils: 2.0.6 - supertap: 3.0.1 - temp-dir: 3.0.0 - write-file-atomic: 7.0.1 - yargs: 18.0.0 - optionalDependencies: - '@ava/typescript': 4.1.0 - transitivePeerDependencies: - - encoding - - rollup - - supports-color - available-typed-arrays@1.0.7: dependencies: possible-typed-array-names: 1.1.0 @@ -4657,12 +4090,6 @@ snapshots: binary-extensions@2.2.0: {} - bindings@1.5.0: - dependencies: - file-uri-to-path: 1.0.0 - - blueimp-md5@2.19.0: {} - body-parser@2.2.2: dependencies: bytes: 3.1.2 @@ -4769,18 +4196,12 @@ snapshots: callsites@3.1.0: {} - callsites@4.2.0: {} - camelcase-css@2.0.1: {} camelcase@6.3.0: {} caniuse-lite@1.0.30001570: {} - cbor@10.0.12: - dependencies: - nofilter: 3.1.0 - chai@6.2.2: {} chalk@4.1.2: @@ -4788,8 +4209,6 @@ snapshots: ansi-styles: 4.3.0 supports-color: 7.2.0 - chalk@5.6.2: {} - chart.js@4.5.0: dependencies: '@kurkle/color': 0.3.4 @@ -4815,19 +4234,6 @@ snapshots: dependencies: readdirp: 4.1.2 - chownr@3.0.0: {} - - chunkd@2.0.1: {} - - ci-info@4.4.0: {} - - ci-parallel-vars@1.0.1: {} - - cli-truncate@6.0.0: - dependencies: - slice-ansi: 9.0.0 - string-width: 8.2.1 - client-only@0.0.1: {} cliui@8.0.1: @@ -4836,16 +4242,6 @@ snapshots: strip-ansi: 6.0.1 wrap-ansi: 7.0.0 - cliui@9.0.1: - dependencies: - string-width: 7.2.0 - strip-ansi: 7.2.0 - wrap-ansi: 9.0.2 - - code-excerpt@4.0.0: - dependencies: - convert-to-spaces: 2.0.1 - color-convert@2.0.1: dependencies: color-name: 1.1.4 @@ -4854,23 +4250,8 @@ snapshots: commander@4.1.1: {} - common-path-prefix@3.0.0: {} - concat-map@0.0.1: {} - concordance@5.0.4: - dependencies: - date-time: 3.1.0 - esutils: 2.0.3 - fast-diff: 1.3.0 - js-string-escape: 1.0.1 - lodash: 4.18.1 - md5-hex: 3.0.1 - semver: 7.8.0 - well-known-symbols: 2.0.0 - - consola@3.4.2: {} - console-clear@1.1.1: {} content-disposition@1.1.0: {} @@ -4881,8 +4262,6 @@ snapshots: convert-source-map@2.0.0: {} - convert-to-spaces@2.0.1: {} - cookie-signature@1.2.2: {} cookie@0.7.2: {} @@ -4899,10 +4278,6 @@ snapshots: cssesc@3.0.0: {} - currently-unhandled@0.4.1: - dependencies: - array-find-index: 1.0.2 - damerau-levenshtein@1.0.8: {} data-view-buffer@1.0.2: @@ -4927,10 +4302,6 @@ snapshots: date-fns@2.29.3: {} - date-time@3.1.0: - dependencies: - time-zone: 1.0.0 - debug@3.2.7: dependencies: ms: 2.1.3 @@ -4959,8 +4330,6 @@ snapshots: depd@2.0.0: {} - detect-libc@2.1.2: {} - didyoumean@1.2.2: {} diff@4.0.2: {} @@ -4987,10 +4356,6 @@ snapshots: electron-to-chromium@1.4.613: {} - emittery@2.0.0: {} - - emoji-regex@10.6.0: {} - emoji-regex@8.0.0: {} emoji-regex@9.2.2: {} @@ -5137,12 +4502,8 @@ snapshots: escape-html@1.0.3: {} - escape-string-regexp@2.0.0: {} - escape-string-regexp@4.0.0: {} - escape-string-regexp@5.0.0: {} - eslint-config-prettier@10.1.8(eslint@9.39.4(jiti@1.21.7)): dependencies: eslint: 9.39.4(jiti@1.21.7) @@ -5301,8 +4662,6 @@ snapshots: acorn-jsx: 5.3.2(acorn@8.16.0) eslint-visitor-keys: 4.2.1 - esprima@4.0.1: {} - esquery@1.7.0: dependencies: estraverse: 5.3.0 @@ -5313,8 +4672,6 @@ snapshots: estraverse@5.3.0: {} - estree-walker@2.0.2: {} - esutils@2.0.3: {} etag@1.8.1: {} @@ -5323,18 +4680,6 @@ snapshots: events@3.3.0: {} - execa@7.2.0: - dependencies: - cross-spawn: 7.0.6 - get-stream: 6.0.1 - human-signals: 4.3.1 - is-stream: 3.0.0 - merge-stream: 2.0.0 - npm-run-path: 5.1.0 - onetime: 6.0.0 - signal-exit: 3.0.7 - strip-final-newline: 3.0.0 - express@5.2.1: dependencies: accepts: 2.0.0 @@ -5370,8 +4715,6 @@ snapshots: fast-deep-equal@3.1.3: {} - fast-diff@1.3.0: {} - fast-glob@3.3.3: dependencies: '@nodelib/fs.stat': 2.0.5 @@ -5394,16 +4737,10 @@ snapshots: fflate@0.8.1: {} - figures@6.1.0: - dependencies: - is-unicode-supported: 2.1.0 - file-entry-cache@8.0.0: dependencies: flat-cache: 4.0.1 - file-uri-to-path@1.0.0: {} - fill-range@7.1.1: dependencies: to-regex-range: 5.0.1 @@ -5419,8 +4756,6 @@ snapshots: transitivePeerDependencies: - supports-color - find-up-simple@1.0.1: {} - find-up@5.0.0: dependencies: locate-path: 6.0.0 @@ -5472,8 +4807,6 @@ snapshots: get-caller-file@2.0.5: {} - get-east-asian-width@1.6.0: {} - get-intrinsic@1.3.0: dependencies: call-bind-apply-helpers: 1.0.2 @@ -5494,8 +4827,6 @@ snapshots: dunder-proto: 1.0.1 es-object-atoms: 1.1.1 - get-stream@6.0.1: {} - get-symbol-description@1.1.0: dependencies: call-bound: 1.0.4 @@ -5541,19 +4872,8 @@ snapshots: define-properties: 1.2.1 gopd: 1.2.0 - globby@16.2.0: - dependencies: - '@sindresorhus/merge-streams': 4.0.0 - fast-glob: 3.3.3 - ignore: 7.0.5 - is-path-inside: 4.0.0 - slash: 5.1.0 - unicorn-magic: 0.4.0 - gopd@1.2.0: {} - graceful-fs@4.2.11: {} - has-bigints@1.1.0: {} has-flag@4.0.0: {} @@ -5599,15 +4919,6 @@ snapshots: statuses: 2.0.2 toidentifier: 1.0.1 - https-proxy-agent@7.0.6: - dependencies: - agent-base: 7.1.4 - debug: 4.4.3(supports-color@8.1.1) - transitivePeerDependencies: - - supports-color - - human-signals@4.3.1: {} - iconv-lite@0.6.3: dependencies: safer-buffer: 2.1.2 @@ -5618,8 +4929,6 @@ snapshots: ieee754@1.2.1: {} - ignore-by-default@2.1.0: {} - ignore@5.3.2: {} ignore@7.0.5: {} @@ -5635,8 +4944,6 @@ snapshots: imurmurhash@0.1.4: {} - indent-string@5.0.0: {} - inherits@2.0.4: {} internal-slot@1.1.0: @@ -5647,8 +4954,6 @@ snapshots: ipaddr.js@1.9.1: {} - irregular-plurals@4.2.0: {} - is-array-buffer@3.0.5: dependencies: call-bind: 1.0.9 @@ -5701,10 +5006,6 @@ snapshots: is-fullwidth-code-point@3.0.0: {} - is-fullwidth-code-point@5.1.0: - dependencies: - get-east-asian-width: 1.6.0 - is-generator-function@1.1.2: dependencies: call-bound: 1.0.4 @@ -5730,12 +5031,8 @@ snapshots: is-path-inside@3.0.3: {} - is-path-inside@4.0.0: {} - is-plain-obj@2.1.0: {} - is-plain-object@5.0.0: {} - is-promise@4.0.0: {} is-regex@1.2.1: @@ -5751,8 +5048,6 @@ snapshots: dependencies: call-bound: 1.0.4 - is-stream@3.0.0: {} - is-string@1.1.1: dependencies: call-bound: 1.0.4 @@ -5770,8 +5065,6 @@ snapshots: is-unicode-supported@0.1.0: {} - is-unicode-supported@2.1.0: {} - is-weakmap@2.0.2: {} is-weakref@1.1.1: @@ -5821,15 +5114,8 @@ snapshots: jiti@1.21.7: {} - js-string-escape@1.0.1: {} - js-tokens@4.0.0: {} - js-yaml@3.14.2: - dependencies: - argparse: 1.0.10 - esprima: 4.0.1 - js-yaml@4.1.1: dependencies: argparse: 2.0.1 @@ -5891,8 +5177,6 @@ snapshots: dependencies: uc.micro: 2.1.0 - load-json-file@7.0.1: {} - local-access@1.1.0: {} locate-path@6.0.0: @@ -5901,8 +5185,6 @@ snapshots: lodash.merge@4.6.2: {} - lodash@4.18.1: {} - log-symbols@4.1.0: dependencies: chalk: 4.1.2 @@ -5933,28 +5215,14 @@ snapshots: punycode.js: 2.3.1 uc.micro: 2.1.0 - matcher@6.0.0: - dependencies: - escape-string-regexp: 5.0.0 - math-intrinsics@1.1.0: {} - md5-hex@3.0.1: - dependencies: - blueimp-md5: 2.19.0 - mdurl@2.0.0: {} media-typer@1.1.0: {} - memoize@11.0.0: - dependencies: - mimic-function: 5.0.1 - merge-descriptors@2.0.0: {} - merge-stream@2.0.0: {} - merge2@1.4.1: {} micromatch@4.0.8: @@ -5968,10 +5236,6 @@ snapshots: dependencies: mime-db: 1.54.0 - mimic-fn@4.0.0: {} - - mimic-function@5.0.1: {} - mini-svg-data-uri@1.4.4: {} minimatch@10.2.5: @@ -5990,10 +5254,6 @@ snapshots: minipass@7.1.3: {} - minizlib@3.1.0: - dependencies: - minipass: 7.1.3 - mocha@11.7.5: dependencies: browser-stdout: 1.3.1 @@ -6045,30 +5305,12 @@ snapshots: object.entries: 1.1.9 semver: 6.3.1 - node-fetch@2.7.0(encoding@0.1.13): - dependencies: - whatwg-url: 5.0.0 - optionalDependencies: - encoding: 0.1.13 - - node-gyp-build@4.8.4: {} - node-releases@2.0.14: {} - nofilter@3.1.0: {} - - nopt@8.1.0: - dependencies: - abbrev: 3.0.1 - normalize-path@3.0.0: {} normalize-range@0.1.2: {} - npm-run-path@5.1.0: - dependencies: - path-key: 4.0.0 - object-assign@4.1.1: {} object-hash@3.0.0: {} @@ -6121,10 +5363,6 @@ snapshots: dependencies: wrappy: 1.0.2 - onetime@6.0.0: - dependencies: - mimic-fn: 4.0.0 - optionator@0.9.4: dependencies: deep-is: 0.1.4 @@ -6148,13 +5386,6 @@ snapshots: dependencies: p-limit: 3.1.0 - p-map@7.0.4: {} - - package-config@5.0.0: - dependencies: - find-up-simple: 1.0.1 - load-json-file: 7.0.1 - package-json-from-dist@1.0.1: {} pako@1.0.11: {} @@ -6163,16 +5394,12 @@ snapshots: dependencies: callsites: 3.1.0 - parse-ms@4.0.0: {} - parseurl@1.3.3: {} path-exists@4.0.0: {} path-key@3.1.1: {} - path-key@4.0.0: {} - path-parse@1.0.7: {} path-scurry@1.11.1: @@ -6197,10 +5424,6 @@ snapshots: pirates@4.0.5: {} - plur@6.0.0: - dependencies: - irregular-plurals: 4.2.0 - polished@4.2.2: dependencies: '@babel/runtime': 7.29.2 @@ -6272,10 +5495,6 @@ snapshots: pretty-format@3.8.0: {} - pretty-ms@9.3.0: - dependencies: - parse-ms: 4.0.0 - process-nextick-args@2.0.1: {} process@0.11.10: {} @@ -6378,14 +5597,8 @@ snapshots: require-directory@2.1.1: {} - resolve-cwd@3.0.0: - dependencies: - resolve-from: 5.0.0 - resolve-from@4.0.0: {} - resolve-from@5.0.0: {} - resolve-pathname@3.0.0: {} resolve@1.22.8: @@ -6490,10 +5703,6 @@ snapshots: transitivePeerDependencies: - supports-color - serialize-error@7.0.1: - dependencies: - type-fest: 0.13.1 - serialize-javascript@6.0.2: dependencies: randombytes: 2.1.0 @@ -6567,8 +5776,6 @@ snapshots: side-channel-map: 1.0.1 side-channel-weakmap: 1.0.2 - signal-exit@3.0.7: {} - signal-exit@4.1.0: {} sirv-cli@1.0.14: @@ -6588,13 +5795,6 @@ snapshots: mrmime: 1.0.1 totalist: 1.1.0 - slash@5.1.0: {} - - slice-ansi@9.0.0: - dependencies: - ansi-styles: 6.2.3 - is-fullwidth-code-point: 5.1.0 - source-map-js@1.2.1: {} source-map-support@0.5.21: @@ -6604,12 +5804,6 @@ snapshots: source-map@0.6.1: {} - sprintf-js@1.0.3: {} - - stack-utils@2.0.6: - dependencies: - escape-string-regexp: 2.0.0 - statuses@2.0.2: {} stop-iteration-iterator@1.1.0: @@ -6629,17 +5823,6 @@ snapshots: emoji-regex: 9.2.2 strip-ansi: 7.2.0 - string-width@7.2.0: - dependencies: - emoji-regex: 10.6.0 - get-east-asian-width: 1.6.0 - strip-ansi: 7.2.0 - - string-width@8.2.1: - dependencies: - get-east-asian-width: 1.6.0 - strip-ansi: 7.2.0 - string.prototype.includes@2.0.1: dependencies: call-bind: 1.0.9 @@ -6708,8 +5891,6 @@ snapshots: strip-bom@3.0.0: {} - strip-final-newline@3.0.0: {} - strip-json-comments@3.1.1: {} sucrase@3.35.0: @@ -6722,13 +5903,6 @@ snapshots: pirates: 4.0.5 ts-interface-checker: 0.1.13 - supertap@3.0.1: - dependencies: - indent-string: 5.0.0 - js-yaml: 3.14.2 - serialize-error: 7.0.1 - strip-ansi: 7.2.0 - supports-color@7.2.0: dependencies: has-flag: 4.0.0 @@ -6804,16 +5978,6 @@ snapshots: transitivePeerDependencies: - ts-node - tar@7.5.15: - dependencies: - '@isaacs/fs-minipass': 4.0.1 - chownr: 3.0.0 - minipass: 7.1.3 - minizlib: 3.1.0 - yallist: 5.0.0 - - temp-dir@3.0.0: {} - test-exclude@8.0.0: dependencies: '@istanbuljs/schema': 0.1.6 @@ -6828,8 +5992,6 @@ snapshots: dependencies: any-promise: 1.3.0 - time-zone@1.0.0: {} - tiny-invariant@1.3.1: {} tiny-warning@1.0.3: {} @@ -6851,8 +6013,6 @@ snapshots: totalist@1.1.0: {} - tr46@0.0.3: {} - ts-api-utils@2.5.0(typescript@6.0.3): dependencies: typescript: 6.0.3 @@ -6911,8 +6071,6 @@ snapshots: dependencies: prelude-ls: 1.2.1 - type-fest@0.13.1: {} - type-is@2.1.0: dependencies: content-type: 2.0.0 @@ -6985,8 +6143,6 @@ snapshots: undici-types@5.26.5: {} - unicorn-magic@0.4.0: {} - unpipe@1.0.0: {} update-browserslist-db@1.0.13(browserslist@4.22.2): @@ -7017,15 +6173,6 @@ snapshots: vary@1.1.2: {} - webidl-conversions@3.0.1: {} - - well-known-symbols@2.0.0: {} - - whatwg-url@5.0.0: - dependencies: - tr46: 0.0.3 - webidl-conversions: 3.0.1 - which-boxed-primitive@1.1.1: dependencies: is-bigint: 1.1.0 @@ -7087,32 +6234,18 @@ snapshots: string-width: 5.1.2 strip-ansi: 7.2.0 - wrap-ansi@9.0.2: - dependencies: - ansi-styles: 6.2.3 - string-width: 7.2.0 - strip-ansi: 7.2.0 - wrappy@1.0.2: {} - write-file-atomic@7.0.1: - dependencies: - signal-exit: 4.1.0 - ws@7.4.5: {} ws@8.18.3: {} y18n@5.0.8: {} - yallist@5.0.0: {} - yaml@2.9.0: {} yargs-parser@21.1.1: {} - yargs-parser@22.0.0: {} - yargs-unparser@2.0.0: dependencies: camelcase: 6.3.0 @@ -7130,15 +6263,6 @@ snapshots: y18n: 5.0.8 yargs-parser: 21.1.1 - yargs@18.0.0: - dependencies: - cliui: 9.0.1 - escalade: 3.2.0 - get-caller-file: 2.0.5 - string-width: 7.2.0 - y18n: 5.0.8 - yargs-parser: 22.0.0 - yn@3.1.1: {} yocto-queue@0.1.0: {}