From 7146176466c7eb745582b3cc85db58218d333df6 Mon Sep 17 00:00:00 2001 From: Timo Stamm Date: Mon, 18 Aug 2025 15:56:04 +0200 Subject: [PATCH 01/16] Migrate most of protoplugin-test --- packages/protobuf-test/jest.config.js | 34 ---- packages/protobuf-test/package.json | 2 +- packages/protoplugin-test/jest.config.js | 30 ---- packages/protoplugin-test/package.json | 2 +- .../src/byo-transpile.test.ts | 17 +- .../src/custom-options.test.ts | 86 +++++----- .../protoplugin-test/src/file-array.test.ts | 9 +- .../src/file-export-decl.test.ts | 17 +- .../src/file-import-desc.test.ts | 45 +++--- .../src/file-import-shape.test.ts | 21 +-- .../protoplugin-test/src/file-import.test.ts | 33 ++-- .../protoplugin-test/src/file-jsdoc.test.ts | 37 ++--- .../src/file-preamble.test.ts | 69 ++++---- .../protoplugin-test/src/file-print.test.ts | 115 +++++++------- .../protoplugin-test/src/file-runtime.test.ts | 13 +- .../protoplugin-test/src/file-string.test.ts | 25 +-- packages/protoplugin-test/src/helpers.ts | 7 +- .../src/import_extension.test.ts | 67 ++++---- .../src/js_import_style.test.ts | 61 +++---- .../src/keep_empty_files.test.ts | 43 +++-- .../protoplugin-test/src/parse-option.test.ts | 51 +++--- .../src/plugin-edition-support.test.ts | 80 +++++----- .../src/rewrite_imports.test.ts | 21 +-- .../src/safe-identifier.test.ts | 35 ++-- .../src/source-code-info.test.ts | 71 +++++---- .../protoplugin-test/src/transpile.test.ts | 150 +++++++++--------- 26 files changed, 554 insertions(+), 587 deletions(-) delete mode 100644 packages/protobuf-test/jest.config.js delete mode 100644 packages/protoplugin-test/jest.config.js diff --git a/packages/protobuf-test/jest.config.js b/packages/protobuf-test/jest.config.js deleted file mode 100644 index 6e8ed5bc7..000000000 --- a/packages/protobuf-test/jest.config.js +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2021-2025 Buf Technologies, Inc. -// -// 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. - -/* - * For a detailed explanation regarding each configuration property and type check, visit: - * https://jestjs.io/docs/configuration - */ -/** @type {import('@jest/types').Config.InitialOptions} */ -const config = { - // Indicates which provider should be used to instrument code for coverage - coverageProvider: "v8", - - // The root directory that Jest should scan for tests and modules within - rootDir: "dist", - - // Enable worker threads for assertion failures involving BigInt - // See https://github.com/jestjs/jest/issues/11617#issuecomment-1458155552 - workerThreads: true, - - transform: {}, -}; - -export default config; diff --git a/packages/protobuf-test/package.json b/packages/protobuf-test/package.json index 789b9d47f..3854e9337 100644 --- a/packages/protobuf-test/package.json +++ b/packages/protobuf-test/package.json @@ -17,7 +17,7 @@ "perf": "tsx src/perf.ts benchmark '.*'", "profile": "dexnode dist/esm/perf.js run 'fromBinary perf-payload.bin' 10000", "flamegraph": "npx 0x -- node dist/esm/perf.js run 'fromBinary perf-payload.bin' 10000", - "test": "NODE_OPTIONS=--experimental-vm-modules npx jest", + "test": "tsx --test src/**/*.test.ts", "format": "biome format --write", "license-header": "license-header", "lint": "biome lint --error-on-warnings" diff --git a/packages/protoplugin-test/jest.config.js b/packages/protoplugin-test/jest.config.js deleted file mode 100644 index 4ef426336..000000000 --- a/packages/protoplugin-test/jest.config.js +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2021-2025 Buf Technologies, Inc. -// -// 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. - -/* - * For a detailed explanation regarding each configuration property and type check, visit: - * https://jestjs.io/docs/configuration - */ -/** @type {import('@jest/types').Config.InitialOptions} */ -const config = { - // Indicates which provider should be used to instrument code for coverage - coverageProvider: "v8", - - // The root directory that Jest should scan for tests and modules within - rootDir: "dist", - - transform: {}, -}; - -export default config; diff --git a/packages/protoplugin-test/package.json b/packages/protoplugin-test/package.json index 09a57fde0..8b6d2af89 100644 --- a/packages/protoplugin-test/package.json +++ b/packages/protoplugin-test/package.json @@ -4,7 +4,7 @@ "scripts": { "prebuild": "rm -rf ./dist/*", "build": "../../node_modules/typescript/bin/tsc --project tsconfig.json --outDir ./dist", - "test": "NODE_OPTIONS=--experimental-vm-modules npx jest", + "test": "tsx --test src/**/*.test.ts", "format": "biome format --write", "license-header": "license-header", "lint": "biome lint --error-on-warnings" diff --git a/packages/protoplugin-test/src/byo-transpile.test.ts b/packages/protoplugin-test/src/byo-transpile.test.ts index 8f683b1a2..acb00d4ca 100644 --- a/packages/protoplugin-test/src/byo-transpile.test.ts +++ b/packages/protoplugin-test/src/byo-transpile.test.ts @@ -12,24 +12,25 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import type { FileInfo } from "@bufbuild/protoplugin"; import { createTestPluginAndRun } from "./helpers.js"; -describe("bring your own transpile", () => { - test("does not transpile target=ts", async () => { +void suite("bring your own transpile", () => { + void test("does not transpile target=ts", async () => { const lines = await testGenerate("target=ts"); - expect(lines).toStrictEqual(["fake typescript source"]); + assert.deepStrictEqual(lines, ["fake typescript source"]); }); - test("transpiles to target js", async () => { + void test("transpiles to target js", async () => { const lines = await testGenerate("target=js"); - expect(lines).toStrictEqual(["fake transpiled to js"]); + assert.deepStrictEqual(lines, ["fake transpiled to js"]); }); - test("transpiles to target dts", async () => { + void test("transpiles to target dts", async () => { const lines = await testGenerate("target=dts"); - expect(lines).toStrictEqual(["fake transpiled to dts"]); + assert.deepStrictEqual(lines, ["fake transpiled to dts"]); }); async function testGenerate(parameter: string) { diff --git a/packages/protoplugin-test/src/custom-options.test.ts b/packages/protoplugin-test/src/custom-options.test.ts index edadc08cd..82d11bafb 100644 --- a/packages/protoplugin-test/src/custom-options.test.ts +++ b/packages/protoplugin-test/src/custom-options.test.ts @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { beforeEach, describe, expect, test } from "@jest/globals"; +import { suite, test, beforeEach } from "node:test"; +import * as assert from "node:assert"; import { type DescExtension, fromBinary, @@ -28,9 +29,8 @@ import { import type { Schema } from "@bufbuild/protoplugin"; import { UpstreamProtobuf } from "upstream-protobuf"; import { compileFile, createTestPluginAndRun } from "./helpers.js"; -import assert from "node:assert"; -describe("custom options", () => { +void suite("custom options", () => { const proto = ` syntax = "proto3"; import "google/protobuf/descriptor.proto"; @@ -39,7 +39,7 @@ describe("custom options", () => { optional uint32 opt = 60123; } `; - test("can be read via extension", async () => { + void test("can be read via extension", async () => { const opt = (await compileFile(proto)).extensions[0]; let value: unknown; await createTestPluginAndRun({ @@ -53,9 +53,9 @@ describe("custom options", () => { } }, }); - expect(value).toBe(123); + assert.strictEqual(value, 123); }); - test("can be read via getOptions", async () => { + void test("can be read via getOptions", async () => { const opt = (await compileFile(proto)).extensions[0]; let has = false; let value: unknown; @@ -71,12 +71,12 @@ describe("custom options", () => { } }, }); - expect(has).toBe(true); - expect(value).toBe(123); + assert.strictEqual(has, true); + assert.strictEqual(value, 123); }); }); -describe("option retention", () => { +void suite("option retention", () => { const proto = { "a.proto": ` syntax = "proto3"; @@ -103,7 +103,7 @@ describe("option retention", () => { } `, }; - describe("CodeGeneratorRequest", () => { + void suite("CodeGeneratorRequest", () => { let req: CodeGeneratorRequest; let opt_unknown: DescExtension, opt_source: DescExtension, @@ -120,41 +120,41 @@ describe("option retention", () => { await compileFile(proto["options.proto"]) ).extensions; }); - test("includes expected files", () => { - expect(req.fileToGenerate).toStrictEqual(["a.proto"]); - expect(req.protoFile.map((f) => f.name)).toStrictEqual([ + void test("includes expected files", () => { + assert.deepStrictEqual(req.fileToGenerate, ["a.proto"]); + assert.deepStrictEqual(req.protoFile.map((f) => f.name), [ "google/protobuf/descriptor.proto", "options.proto", "b.proto", "a.proto", ]); - expect(req.sourceFileDescriptors.map((f) => f.name)).toStrictEqual([ + assert.deepStrictEqual(req.sourceFileDescriptors.map((f) => f.name), [ "a.proto", ]); }); - test("proto_file elides source retention options for file_to_generate", () => { + void test("proto_file elides source retention options for file_to_generate", () => { const fileA = req.protoFile.find((f) => f.name == "a.proto"); - assert(fileA?.options); - expect(hasExtension(fileA.options, opt_unknown)).toBe(true); - expect(hasExtension(fileA.options, opt_source)).toBe(true); - expect(hasExtension(fileA.options, opt_runtime)).toBe(false); + assert.ok(fileA?.options); + assert.strictEqual(hasExtension(fileA.options, opt_unknown), true); + assert.strictEqual(hasExtension(fileA.options, opt_source), true); + assert.strictEqual(hasExtension(fileA.options, opt_runtime), false); }); - test("proto_file includes source retention options for files not in file_to_generate", () => { + void test("proto_file includes source retention options for files not in file_to_generate", () => { const fileB = req.protoFile.find((f) => f.name == "b.proto"); - assert(fileB?.options); - expect(hasExtension(fileB.options, opt_unknown)).toBe(true); - expect(hasExtension(fileB.options, opt_source)).toBe(true); - expect(hasExtension(fileB.options, opt_runtime)).toBe(true); + assert.ok(fileB?.options); + assert.strictEqual(hasExtension(fileB.options, opt_unknown), true); + assert.strictEqual(hasExtension(fileB.options, opt_source), true); + assert.strictEqual(hasExtension(fileB.options, opt_runtime), true); }); - test("source_file_descriptors include source retention options for file_to_generate", () => { + void test("source_file_descriptors include source retention options for file_to_generate", () => { const fileA = req.sourceFileDescriptors.find((f) => f.name == "a.proto"); - assert(fileA?.options); - expect(hasExtension(fileA.options, opt_unknown)).toBe(true); - expect(hasExtension(fileA.options, opt_source)).toBe(true); - expect(hasExtension(fileA.options, opt_runtime)).toBe(true); + assert.ok(fileA?.options); + assert.strictEqual(hasExtension(fileA.options, opt_unknown), true); + assert.strictEqual(hasExtension(fileA.options, opt_source), true); + assert.strictEqual(hasExtension(fileA.options, opt_runtime), true); }); }); - describe("protoplugin's Schema", () => { + void suite("protoplugin's Schema", () => { let schema: Schema; let opt_unknown: DescExtension, opt_runtime: DescExtension, @@ -171,28 +171,28 @@ describe("option retention", () => { await compileFile(proto["options.proto"]) ).extensions; }); - test("includes expected files", () => { - expect(schema.files.map((f) => f.proto.name)).toStrictEqual(["a.proto"]); - expect(schema.allFiles.map((f) => f.proto.name)).toStrictEqual([ + void test("includes expected files", () => { + assert.deepStrictEqual(schema.files.map((f) => f.proto.name), ["a.proto"]); + assert.deepStrictEqual(schema.allFiles.map((f) => f.proto.name), [ "google/protobuf/descriptor.proto", "options.proto", "b.proto", "a.proto", ]); }); - test("files include source retention options", () => { + void test("files include source retention options", () => { const file = schema.files.find((f) => f.proto.name == "a.proto"); - assert(file?.proto.options); - expect(hasExtension(file.proto.options, opt_unknown)).toBe(true); - expect(hasExtension(file.proto.options, opt_runtime)).toBe(true); - expect(hasExtension(file.proto.options, opt_source)).toBe(true); + assert.ok(file?.proto.options); + assert.strictEqual(hasExtension(file.proto.options, opt_unknown), true); + assert.strictEqual(hasExtension(file.proto.options, opt_runtime), true); + assert.strictEqual(hasExtension(file.proto.options, opt_source), true); }); - test("allFiles include source retention options", () => { + void test("allFiles include source retention options", () => { const file = schema.allFiles.find((f) => f.proto.name == "b.proto"); - assert(file?.proto.options); - expect(hasExtension(file.proto.options, opt_unknown)).toBe(true); - expect(hasExtension(file.proto.options, opt_runtime)).toBe(true); - expect(hasExtension(file.proto.options, opt_source)).toBe(true); + assert.ok(file?.proto.options); + assert.strictEqual(hasExtension(file.proto.options, opt_unknown), true); + assert.strictEqual(hasExtension(file.proto.options, opt_runtime), true); + assert.strictEqual(hasExtension(file.proto.options, opt_source), true); }); }); }); diff --git a/packages/protoplugin-test/src/file-array.test.ts b/packages/protoplugin-test/src/file-array.test.ts index dc458351a..3ef7c5d84 100644 --- a/packages/protoplugin-test/src/file-array.test.ts +++ b/packages/protoplugin-test/src/file-array.test.ts @@ -12,12 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import type { Printable } from "@bufbuild/protoplugin"; import { createTestPluginAndRun } from "./helpers.js"; -describe("GeneratedFile.array", () => { - test("creates an array literal", async () => { +void suite("GeneratedFile.array", () => { + void test("creates an array literal", async () => { const lines = await createTestPluginAndRun({ proto: `syntax="proto3";`, parameter: "target=ts", @@ -27,6 +28,6 @@ describe("GeneratedFile.array", () => { f.print(arr); }, }); - expect(lines).toStrictEqual(["[foo, 1, true]"]); + assert.deepStrictEqual(lines, ["[foo, 1, true]"]); }); }); diff --git a/packages/protoplugin-test/src/file-export-decl.test.ts b/packages/protoplugin-test/src/file-export-decl.test.ts index 994ce4f2a..0f09a3d32 100644 --- a/packages/protoplugin-test/src/file-export-decl.test.ts +++ b/packages/protoplugin-test/src/file-export-decl.test.ts @@ -12,34 +12,35 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import type { DescEnum, DescMessage } from "@bufbuild/protobuf"; import type { GeneratedFile } from "@bufbuild/protoplugin"; import { createTestPluginAndRun } from "./helpers.js"; -describe("GeneratedFile.export", () => { - test("works as documented", async () => { +void suite("GeneratedFile.export", () => { + void test("works as documented", async () => { const lines = await testGenerate((f) => { const name = "foo"; f.print(f.export("const", name), " = 123;"); }); - expect(lines).toStrictEqual(["export const foo = 123;"]); + assert.deepStrictEqual(lines, ["export const foo = 123;"]); }); - test("declaration can be empty string", async () => { + void test("declaration can be empty string", async () => { const lines = await testGenerate((f) => { f.print("const foo = 123;"); f.print(f.export("", "foo"), ";"); }); - expect(lines).toStrictEqual(["const foo = 123;", "export foo;"]); + assert.deepStrictEqual(lines, ["const foo = 123;", "export foo;"]); }); - test("forces import with same name to be aliased", async () => { + void test("forces import with same name to be aliased", async () => { const lines = await testGenerate((f) => { f.print(f.import("Foo", "pkg")); f.print(f.export("const", "Foo"), " = 123;"); }); - expect(lines).toStrictEqual([ + assert.deepStrictEqual(lines, [ `import { Foo as Foo$1 } from "pkg";`, "", "Foo$1", diff --git a/packages/protoplugin-test/src/file-import-desc.test.ts b/packages/protoplugin-test/src/file-import-desc.test.ts index 89d535f87..9948a0821 100644 --- a/packages/protoplugin-test/src/file-import-desc.test.ts +++ b/packages/protoplugin-test/src/file-import-desc.test.ts @@ -12,11 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { createTestPluginAndRun } from "./helpers.js"; -describe("GeneratedFile.importSchema", () => { - test("should create import symbol for enum descriptor", async () => { +void suite("GeneratedFile.importSchema", () => { + void test("should create import symbol for enum descriptor", async () => { await createTestPluginAndRun({ proto: ` syntax="proto3"; @@ -28,13 +29,13 @@ describe("GeneratedFile.importSchema", () => { parameter: "target=ts", generateAny(f, schema) { const imp = f.importSchema(schema.files[0].enums[0]); - expect(imp.name).toBe("FooSchema"); - expect(imp.from).toBe("./x_pb.js"); - expect(imp.typeOnly).toBe(false); + assert.strictEqual(imp.name, "FooSchema"); + assert.strictEqual(imp.from, "./x_pb.js"); + assert.strictEqual(imp.typeOnly, false); }, }); }); - test("should create import symbol for message descriptor", async () => { + void test("should create import symbol for message descriptor", async () => { await createTestPluginAndRun({ proto: ` syntax="proto3"; @@ -43,13 +44,13 @@ describe("GeneratedFile.importSchema", () => { parameter: "target=ts", generateAny(f, schema) { const imp = f.importSchema(schema.files[0].messages[0]); - expect(imp.name).toBe("PersonSchema"); - expect(imp.from).toBe("./x_pb.js"); - expect(imp.typeOnly).toBe(false); + assert.strictEqual(imp.name, "PersonSchema"); + assert.strictEqual(imp.from, "./x_pb.js"); + assert.strictEqual(imp.typeOnly, false); }, }); }); - test("should create import symbol for service descriptor", async () => { + void test("should create import symbol for service descriptor", async () => { await createTestPluginAndRun({ proto: ` syntax="proto3"; @@ -61,13 +62,13 @@ describe("GeneratedFile.importSchema", () => { parameter: "target=ts", generateAny(f, schema) { const imp = f.importSchema(schema.files[0].services[0]); - expect(imp.name).toBe("Serv"); - expect(imp.from).toBe("./x_pb.js"); - expect(imp.typeOnly).toBe(false); + assert.strictEqual(imp.name, "Serv"); + assert.strictEqual(imp.from, "./x_pb.js"); + assert.strictEqual(imp.typeOnly, false); }, }); }); - test("should create import symbol for extension descriptor", async () => { + void test("should create import symbol for extension descriptor", async () => { await createTestPluginAndRun({ proto: ` syntax="proto2"; @@ -81,13 +82,13 @@ describe("GeneratedFile.importSchema", () => { parameter: "target=ts", generateAny(f, schema) { const imp = f.importSchema(schema.files[0].extensions[0]); - expect(imp.name).toBe("ext"); - expect(imp.from).toBe("./x_pb.js"); - expect(imp.typeOnly).toBe(false); + assert.strictEqual(imp.name, "ext"); + assert.strictEqual(imp.from, "./x_pb.js"); + assert.strictEqual(imp.typeOnly, false); }, }); }); - test("should create import symbol for file descriptor", async () => { + void test("should create import symbol for file descriptor", async () => { await createTestPluginAndRun({ proto: { "my-proto-files/23/dir:/joe's files/x.proto": `syntax="proto3";`, @@ -95,9 +96,9 @@ describe("GeneratedFile.importSchema", () => { parameter: "target=ts", generateAny(f, schema) { const imp = f.importSchema(schema.files[0]); - expect(imp.name).toBe("file_my_proto_files_23_dir_joe_s_files_x"); - expect(imp.from).toBe("./my-proto-files/23/dir:/joe's files/x_pb.js"); - expect(imp.typeOnly).toBe(false); + assert.strictEqual(imp.name, "file_my_proto_files_23_dir_joe_s_files_x"); + assert.strictEqual(imp.from, "./my-proto-files/23/dir:/joe's files/x_pb.js"); + assert.strictEqual(imp.typeOnly, false); }, }); }); diff --git a/packages/protoplugin-test/src/file-import-shape.test.ts b/packages/protoplugin-test/src/file-import-shape.test.ts index fa3c116e2..13cc8b485 100644 --- a/packages/protoplugin-test/src/file-import-shape.test.ts +++ b/packages/protoplugin-test/src/file-import-shape.test.ts @@ -12,11 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { createTestPluginAndRun } from "./helpers.js"; -describe("GeneratedFile.importShape", () => { - test("should create import symbol for enum descriptor", async () => { +void suite("GeneratedFile.importShape", () => { + void test("should create import symbol for enum descriptor", async () => { await createTestPluginAndRun({ proto: ` syntax="proto3"; @@ -28,13 +29,13 @@ describe("GeneratedFile.importShape", () => { parameter: "target=ts", generateAny(f, schema) { const imp = f.importShape(schema.files[0].enums[0]); - expect(imp.name).toBe("Foo"); - expect(imp.from).toBe("./x_pb.js"); - expect(imp.typeOnly).toBe(true); + assert.strictEqual(imp.name, "Foo"); + assert.strictEqual(imp.from, "./x_pb.js"); + assert.strictEqual(imp.typeOnly, true); }, }); }); - test("should create import symbol for message descriptor", async () => { + void test("should create import symbol for message descriptor", async () => { await createTestPluginAndRun({ proto: ` syntax="proto3"; @@ -43,9 +44,9 @@ describe("GeneratedFile.importShape", () => { parameter: "target=ts", generateAny(f, schema) { const imp = f.importShape(schema.files[0].messages[0]); - expect(imp.name).toBe("Person"); - expect(imp.from).toBe("./x_pb.js"); - expect(imp.typeOnly).toBe(true); + assert.strictEqual(imp.name, "Person"); + assert.strictEqual(imp.from, "./x_pb.js"); + assert.strictEqual(imp.typeOnly, true); }, }); }); diff --git a/packages/protoplugin-test/src/file-import.test.ts b/packages/protoplugin-test/src/file-import.test.ts index df9abe394..de5015f4b 100644 --- a/packages/protoplugin-test/src/file-import.test.ts +++ b/packages/protoplugin-test/src/file-import.test.ts @@ -12,53 +12,54 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { createTestPluginAndRun } from "./helpers.js"; -describe("GeneratedFile.import", () => { - test("should create import symbol for package", async () => { +void suite("GeneratedFile.import", () => { + void test("should create import symbol for package", async () => { await createTestPluginAndRun({ proto: `syntax="proto3";`, parameter: "target=ts", generateAny(f) { const imp = f.import("Foo", "@scope/pkg"); - expect(imp.name).toBe("Foo"); - expect(imp.from).toBe("@scope/pkg"); - expect(imp.typeOnly).toBe(false); + assert.strictEqual(imp.name, "Foo"); + assert.strictEqual(imp.from, "@scope/pkg"); + assert.strictEqual(imp.typeOnly, false); }, }); }); - test("should create import symbol for relative import", async () => { + void test("should create import symbol for relative import", async () => { await createTestPluginAndRun({ proto: `syntax="proto3";`, parameter: "target=ts", generateAny(f) { const imp = f.import("Foo", "./foo_zz.js"); - expect(imp.name).toBe("Foo"); - expect(imp.from).toBe("./foo_zz.js"); - expect(imp.typeOnly).toBe(false); + assert.strictEqual(imp.name, "Foo"); + assert.strictEqual(imp.from, "./foo_zz.js"); + assert.strictEqual(imp.typeOnly, false); }, }); }); - test("should create import symbol for https import", async () => { + void test("should create import symbol for https import", async () => { await createTestPluginAndRun({ proto: `syntax="proto3";`, parameter: "target=ts", generateAny(f) { const imp = f.import("Foo", "https://example.com/foo.js"); - expect(imp.name).toBe("Foo"); - expect(imp.from).toBe("https://example.com/foo.js"); - expect(imp.typeOnly).toBe(false); + assert.strictEqual(imp.name, "Foo"); + assert.strictEqual(imp.from, "https://example.com/foo.js"); + assert.strictEqual(imp.typeOnly, false); }, }); }); - test("should honor typeOnly argument", async () => { + void test("should honor typeOnly argument", async () => { await createTestPluginAndRun({ proto: `syntax="proto3";`, parameter: "target=ts", generateAny(f) { const imp = f.import("Foo", "@scope/pkg", true); - expect(imp.typeOnly).toBe(true); + assert.strictEqual(imp.typeOnly, true); }, }); }); diff --git a/packages/protoplugin-test/src/file-jsdoc.test.ts b/packages/protoplugin-test/src/file-jsdoc.test.ts index f70d82fef..1e5cf664b 100644 --- a/packages/protoplugin-test/src/file-jsdoc.test.ts +++ b/packages/protoplugin-test/src/file-jsdoc.test.ts @@ -12,11 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { createTestPluginAndRun } from "./helpers.js"; -describe("GeneratedFile.jsDoc", () => { - test("creates JSDoc block", async () => { +void suite("GeneratedFile.jsDoc", () => { + void test("creates JSDoc block", async () => { const lines = await createTestPluginAndRun({ proto: `syntax="proto3";`, parameter: "target=ts", @@ -25,10 +26,10 @@ describe("GeneratedFile.jsDoc", () => { }, returnLinesOfFirstFile: true, }); - expect(lines).toStrictEqual(["/**", " * hello world", " */"]); + assert.deepStrictEqual(lines, ["/**", " * hello world", " */"]); }); - test("creates JSDoc block for message", async () => { + void test("creates JSDoc block for message", async () => { const lines = await createTestPluginAndRun({ proto: ` syntax="proto3"; @@ -40,14 +41,14 @@ describe("GeneratedFile.jsDoc", () => { }, returnLinesOfFirstFile: true, }); - expect(lines).toStrictEqual([ + assert.deepStrictEqual(lines, [ "/**", " * @generated from message SomeMessage", " */", ]); }); - test("creates JSDoc block for message with comments", async () => { + void test("creates JSDoc block for message with comments", async () => { const lines = await createTestPluginAndRun({ proto: ` syntax="proto3"; @@ -63,7 +64,7 @@ describe("GeneratedFile.jsDoc", () => { }, returnLinesOfFirstFile: true, }); - expect(lines).toStrictEqual([ + assert.deepStrictEqual(lines, [ "/**", " * comment on message", " *", @@ -72,7 +73,7 @@ describe("GeneratedFile.jsDoc", () => { ]); }); - test("creates JSDoc block for message with feature options", async () => { + void test("creates JSDoc block for message with feature options", async () => { const lines = await createTestPluginAndRun({ proto: ` edition="2023"; @@ -86,7 +87,7 @@ describe("GeneratedFile.jsDoc", () => { }, returnLinesOfFirstFile: true, }); - expect(lines).toStrictEqual([ + assert.deepStrictEqual(lines, [ "/**", " * @generated from message SomeMessage", " * @generated with option features.json_format = ALLOW", @@ -94,7 +95,7 @@ describe("GeneratedFile.jsDoc", () => { ]); }); - test("creates JSDoc block for enum with feature options", async () => { + void test("creates JSDoc block for enum with feature options", async () => { const lines = await createTestPluginAndRun({ proto: ` edition="2023"; @@ -109,7 +110,7 @@ describe("GeneratedFile.jsDoc", () => { }, returnLinesOfFirstFile: true, }); - expect(lines).toStrictEqual([ + assert.deepStrictEqual(lines, [ "/**", " * @generated from enum SomeEnum", " * @generated with option features.enum_type = OPEN", @@ -117,7 +118,7 @@ describe("GeneratedFile.jsDoc", () => { ]); }); - test("indents", async () => { + void test("indents", async () => { const lines = await createTestPluginAndRun({ proto: `syntax="proto3";`, parameter: "target=ts", @@ -126,7 +127,7 @@ describe("GeneratedFile.jsDoc", () => { }, returnLinesOfFirstFile: true, }); - expect(lines).toStrictEqual([ + assert.deepStrictEqual(lines, [ " /**", " * multi-line", " * comment", @@ -134,7 +135,7 @@ describe("GeneratedFile.jsDoc", () => { ]); }); - test("escapes */", async () => { + void test("escapes */", async () => { const lines = await createTestPluginAndRun({ proto: `syntax="proto3";`, parameter: "target=ts", @@ -143,10 +144,10 @@ describe("GeneratedFile.jsDoc", () => { }, returnLinesOfFirstFile: true, }); - expect(lines).toStrictEqual(["/**", " * *\\/", " */"]); + assert.deepStrictEqual(lines, ["/**", " * *\\/", " */"]); }); - test("whitespace is unmodified", async () => { + void test("whitespace is unmodified", async () => { const lines = await createTestPluginAndRun({ proto: `syntax="proto3";`, parameter: "target=ts", @@ -155,7 +156,7 @@ describe("GeneratedFile.jsDoc", () => { }, returnLinesOfFirstFile: true, }); - expect(lines).toStrictEqual([ + assert.deepStrictEqual(lines, [ "/**", " *", " * a", diff --git a/packages/protoplugin-test/src/file-preamble.test.ts b/packages/protoplugin-test/src/file-preamble.test.ts index 895c7e708..056534f26 100644 --- a/packages/protoplugin-test/src/file-preamble.test.ts +++ b/packages/protoplugin-test/src/file-preamble.test.ts @@ -12,96 +12,97 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { createTestPluginAndRun } from "./helpers.js"; -describe("GeneratedFile.preamble", () => { - test("contains plugin name and version", async () => { +void suite("GeneratedFile.preamble", () => { + void test("contains plugin name and version", async () => { const lines = await testGenerate({ proto: `syntax="proto3";`, name: "pi-plugin", version: "v3.14159", }); - expect(lines).toContain("// @generated by pi-plugin v3.14159"); + assert.ok(lines.includes("// @generated by pi-plugin v3.14159")); }); - test("contains plugin options", async () => { + void test("contains plugin options", async () => { const lines = await testGenerate({ proto: `syntax="proto3";`, parameter: "foo=bar,baz", }); - expect(lines).toContain( + assert.ok(lines.includes( `// @generated by test v1 with parameter "foo=bar,baz"`, - ); + )); }); - test("elides rewrite_imports plugin option", async () => { + void test("elides rewrite_imports plugin option", async () => { const lines = await testGenerate({ proto: `syntax="proto3";`, parameter: "foo,rewrite_imports=./test/*_pb.js:@buf/test,rewrite_imports=./test/*_web.js:@buf/web,bar", }); - expect(lines).toContain( + assert.ok(lines.includes( `// @generated by test v1 with parameter "foo,bar"`, - ); + )); }); - test("contains eslint-disable annotation", async () => { + void test("contains eslint-disable annotation", async () => { const lines = await testGenerate({ proto: `syntax="proto3";`, }); - expect(lines).toContain("/* eslint-disable */"); + assert.ok(lines.includes("/* eslint-disable */")); }); - test("does not contain ts-nocheck annotation by default", async () => { + void test("does not contain ts-nocheck annotation by default", async () => { const lines = await testGenerate({ proto: `syntax="proto3";`, }); - expect(lines).not.toContain("// @ts-nocheck"); + assert.ok(!lines.includes("// @ts-nocheck")); }); - test("contains ts-nocheck annotation when opted in", async () => { + void test("contains ts-nocheck annotation when opted in", async () => { const lines = await testGenerate({ proto: `syntax="proto3";`, parameter: "ts_nocheck=true", }); - expect(lines).toContain("// @ts-nocheck"); + assert.ok(lines.includes("// @ts-nocheck")); }); - test("contains source file info for proto3", async () => { + void test("contains source file info for proto3", async () => { const lines = await testGenerate({ proto: { "foo/bar.proto": `syntax="proto3";`, }, }); - expect(lines).toContain( + assert.ok(lines.includes( "// @generated from file foo/bar.proto (syntax proto3)", - ); + )); }); - test("contains source file info for proto2", async () => { + void test("contains source file info for proto2", async () => { const lines = await testGenerate({ proto: { "foo/bar.proto": `syntax="proto2";`, }, }); - expect(lines).toContain( + assert.ok(lines.includes( "// @generated from file foo/bar.proto (syntax proto2)", - ); + )); }); - test("contains source file info for edition 2023", async () => { + void test("contains source file info for edition 2023", async () => { const lines = await testGenerate({ proto: { "foo/bar.proto": `edition="2023";`, }, }); - expect(lines).toContain( + assert.ok(lines.includes( "// @generated from file foo/bar.proto (edition 2023)", - ); + )); }); - test("contains edition file features", async () => { + void test("contains edition file features", async () => { const lines = await testGenerate({ proto: { "foo/bar.proto": ` @@ -111,11 +112,11 @@ describe("GeneratedFile.preamble", () => { `, }, }); - expect(lines).toContain("// option features.field_presence = EXPLICIT;"); - expect(lines).toContain("// option features.enum_type = OPEN;"); + assert.ok(lines.includes("// option features.field_presence = EXPLICIT;")); + assert.ok(lines.includes("// option features.enum_type = OPEN;")); }); - test("contains syntax comments", async () => { + void test("contains syntax comments", async () => { const lines = await testGenerate({ proto: ` // comment above... @@ -127,14 +128,14 @@ describe("GeneratedFile.preamble", () => { 0, lines.indexOf("// @generated by test v1"), ); - expect(firstLines).toStrictEqual([ + assert.deepStrictEqual(firstLines, [ "// comment above...", "// ... the syntax declaration", "", ]); }); - test("contains syntax comments with edition 2023", async () => { + void test("contains syntax comments with edition 2023", async () => { const lines = await testGenerate({ proto: ` // comment above... @@ -146,14 +147,14 @@ describe("GeneratedFile.preamble", () => { 0, lines.indexOf("// @generated by test v1"), ); - expect(firstLines).toStrictEqual([ + assert.deepStrictEqual(firstLines, [ "// comment above...", "// ... the syntax declaration", "", ]); }); - test("contains package comments", async () => { + void test("contains package comments", async () => { const lines = await testGenerate({ proto: ` syntax="proto3"; @@ -163,7 +164,7 @@ describe("GeneratedFile.preamble", () => { package foo; `, }); - expect(lines.slice(3)).toStrictEqual([ + assert.deepStrictEqual(lines.slice(3), [ "", "// comment above...", "// ... the package declaration", diff --git a/packages/protoplugin-test/src/file-print.test.ts b/packages/protoplugin-test/src/file-print.test.ts index 10013f17b..e34b0952e 100644 --- a/packages/protoplugin-test/src/file-print.test.ts +++ b/packages/protoplugin-test/src/file-print.test.ts @@ -12,35 +12,36 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { protoInt64, ScalarType } from "@bufbuild/protobuf"; import type { GeneratedFile, Schema } from "@bufbuild/protoplugin"; import { createImportSymbol } from "@bufbuild/protoplugin"; import { createTestPluginAndRun } from "./helpers.js"; -describe("GeneratedFile.print", () => { - test("should print bigint literals", async () => { +void suite("GeneratedFile.print", () => { + void test("should print bigint literals", async () => { const lines = await testGenerate((f) => { f.print(0n); f.print(-9223372036854775808n); // min signed f.print(18446744073709551615n); // max unsigned }); - expect(lines).toStrictEqual([ + assert.deepStrictEqual(lines, [ `import { protoInt64 } from "@bufbuild/protobuf";`, "", "protoInt64.zero", `protoInt64.parse("-9223372036854775808")`, `protoInt64.uParse("18446744073709551615")`, ]); - expect( + assert.ok( protoInt64.parse("-9223372036854775808") === -9223372036854775808n, - ).toBeTruthy(); - expect( + ); + assert.ok( protoInt64.uParse("18446744073709551615") === 18446744073709551615n, - ).toBeTruthy(); + ); }); - test("should print number literals", async () => { + void test("should print number literals", async () => { const lines = await testGenerate((f) => { f.print( 123, @@ -54,25 +55,25 @@ describe("GeneratedFile.print", () => { Number.NEGATIVE_INFINITY, ); }); - expect(lines).toStrictEqual([ + assert.deepStrictEqual(lines, [ "123 3.145 globalThis.NaN globalThis.Infinity -globalThis.Infinity", ]); }); - test("should print boolean literals", async () => { + void test("should print boolean literals", async () => { const lines = await testGenerate((f) => { f.print(true); f.print(false); }); - expect(lines).toStrictEqual(["true", "false"]); + assert.deepStrictEqual(lines, ["true", "false"]); }); - test("should print Uint8Array literals", async () => { + void test("should print Uint8Array literals", async () => { const lines = await testGenerate((f) => { f.print(new Uint8Array()); f.print(new Uint8Array([0xde, 0xad, 0xbe, 0xef])); }); - expect(lines).toStrictEqual([ + assert.deepStrictEqual(lines, [ "new Uint8Array(0)", "new Uint8Array([0xDE, 0xAD, 0xBE, 0xEF])", ]); @@ -85,11 +86,11 @@ describe("GeneratedFile.print", () => { value: `ab"c`, }); }); - expect(lines).toStrictEqual([`"ab\\"c"`]); + assert.deepStrictEqual(lines, [`"ab\\"c"`]); }); - describe(`should print "es_proto_int64" Printable`, () => { - test("should honor longAsString", async () => { + void suite (`should print "es_proto_int64" Printable`, () => { + void test("should honor longAsString", async () => { const lines = await testGenerate((f) => { f.print({ kind: "es_proto_int64", @@ -98,10 +99,10 @@ describe("GeneratedFile.print", () => { value: 123n, }); }); - expect(lines).toStrictEqual([`"123"`]); + assert.deepStrictEqual(lines, [`"123"`]); }); - test("should honor longAsString for 0", async () => { + void test("should honor longAsString for 0", async () => { const lines = await testGenerate((f) => { f.print({ kind: "es_proto_int64", @@ -110,10 +111,10 @@ describe("GeneratedFile.print", () => { value: 0n, }); }); - expect(lines).toStrictEqual([`"0"`]); + assert.deepStrictEqual(lines, [`"0"`]); }); - test("should honor longAsString for string value", async () => { + void test("should honor longAsString for string value", async () => { const lines = await testGenerate((f) => { f.print({ kind: "es_proto_int64", @@ -122,7 +123,7 @@ describe("GeneratedFile.print", () => { value: "123", }); }); - expect(lines).toStrictEqual([`"123"`]); + assert.deepStrictEqual(lines, [`"123"`]); }); const signedTypes = [ @@ -140,7 +141,7 @@ describe("GeneratedFile.print", () => { value: 0n, }); }); - expect(lines).toStrictEqual([ + assert.deepStrictEqual(lines, [ `import { protoInt64 } from "@bufbuild/protobuf";`, "", "protoInt64.zero", @@ -155,7 +156,7 @@ describe("GeneratedFile.print", () => { value: 123n, }); }); - expect(lines).toStrictEqual([ + assert.deepStrictEqual(lines, [ `import { protoInt64 } from "@bufbuild/protobuf";`, "", `protoInt64.parse("123")`, @@ -174,7 +175,7 @@ describe("GeneratedFile.print", () => { value: 0n, }); }); - expect(lines).toStrictEqual([ + assert.deepStrictEqual(lines, [ `import { protoInt64 } from "@bufbuild/protobuf";`, "", "protoInt64.zero", @@ -189,7 +190,7 @@ describe("GeneratedFile.print", () => { value: 123n, }); }); - expect(lines).toStrictEqual([ + assert.deepStrictEqual(lines, [ `import { protoInt64 } from "@bufbuild/protobuf";`, "", `protoInt64.uParse("123")`, @@ -198,29 +199,29 @@ describe("GeneratedFile.print", () => { } }); - test("should print import symbol", async () => { + void test("should print import symbol", async () => { const lines = await testGenerate((f) => { const imp = createImportSymbol("Foo", "bar"); f.print(imp); }); - expect(lines).toStrictEqual(['import { Foo } from "bar";', "", "Foo"]); + assert.deepStrictEqual(lines, ['import { Foo } from "bar";', "", "Foo"]); }); - test("should print type-only import symbol", async () => { + void test("should print type-only import symbol", async () => { const lines = await testGenerate((f) => { const imp = createImportSymbol("Foo", "bar"); f.print(imp.toTypeOnly()); }); - expect(lines).toStrictEqual(['import type { Foo } from "bar";', "", "Foo"]); + assert.deepStrictEqual(lines, ['import type { Foo } from "bar";', "", "Foo"]); }); - test("should print import symbol used as type and value", async () => { + void test("should print import symbol used as type and value", async () => { const lines = await testGenerate((f) => { const imp = createImportSymbol("Foo", "bar"); f.print(imp); f.print(imp.toTypeOnly()); }); - expect(lines).toStrictEqual([ + assert.deepStrictEqual(lines, [ 'import { Foo } from "bar";', "", "Foo", @@ -228,14 +229,14 @@ describe("GeneratedFile.print", () => { ]); }); - test("should print only one import for the same symbol", async () => { + void test("should print only one import for the same symbol", async () => { const lines = await testGenerate((f) => { const imp = createImportSymbol("Foo", "bar"); const imp2 = createImportSymbol("Foo", "bar"); f.print(imp); f.print(imp2); }); - expect(lines).toStrictEqual([ + assert.deepStrictEqual(lines, [ 'import { Foo } from "bar";', "", "Foo", @@ -243,14 +244,14 @@ describe("GeneratedFile.print", () => { ]); }); - test("should escape clashing import symbols", async () => { + void test("should escape clashing import symbols", async () => { const lines = await testGenerate((f) => { const imp = createImportSymbol("Foo", "a"); const imp2 = createImportSymbol("Foo", "b"); f.print(imp); f.print(imp2); }); - expect(lines).toStrictEqual([ + assert.deepStrictEqual(lines, [ `import { Foo } from "a";`, `import { Foo as Foo$1 } from "b";`, "", @@ -259,7 +260,7 @@ describe("GeneratedFile.print", () => { ]); }); - test("should escape clashing import symbols with commonjs", async () => { + void test("should escape clashing import symbols with commonjs", async () => { const lines = await createTestPluginAndRun({ proto: `syntax="proto3";`, parameter: "target=js,js_import_style=legacy_commonjs", @@ -271,7 +272,7 @@ describe("GeneratedFile.print", () => { }, returnLinesOfFirstFile: true, }); - expect(lines).toStrictEqual([ + assert.deepStrictEqual(lines, [ `"use strict";`, `Object.defineProperty(exports, "__esModule", { value: true });`, "", @@ -283,68 +284,68 @@ describe("GeneratedFile.print", () => { ]); }); - test("should print runtime imports", async () => { + void test("should print runtime imports", async () => { const lines = await testGenerate((f) => { f.print(f.runtime.create, "(FooDesc);"); }); - expect(lines).toStrictEqual([ + assert.deepStrictEqual(lines, [ 'import { create } from "@bufbuild/protobuf";', "", "create(FooDesc);", ]); }); - test("should print empty lines", async () => { + void test("should print empty lines", async () => { const lines = await testGenerate((f) => { f.print(" "); f.print(""); f.print(); }); - expect(lines).toStrictEqual([" ", "", ""]); + assert.deepStrictEqual(lines, [" ", "", ""]); }); - test("should print multiple printables", async () => { + void test("should print multiple printables", async () => { const lines = await testGenerate((f) => { f.print("a", "b", "c", 1, " ", createImportSymbol("Foo", "bar")); }); - expect(lines).toStrictEqual([`import { Foo } from "bar";`, "", "abc1 Foo"]); + assert.deepStrictEqual(lines, [`import { Foo } from "bar";`, "", "abc1 Foo"]); }); - test("should print nested printables", async () => { + void test("should print nested printables", async () => { const lines = await testGenerate((f) => { // biome-ignore format: want this to read well f.print("a", ["b", ["c", "d", [1, " ", createImportSymbol("Foo", "bar")]]]); }); - expect(lines).toStrictEqual([ + assert.deepStrictEqual(lines, [ `import { Foo } from "bar";`, "", "abcd1 Foo", ]); }); - describe("with tagged template literals", () => { - test("should print empty lines", async () => { + void suite("with tagged template literals", () => { + void test("should print empty lines", async () => { const lines = await testGenerate((f) => { f.print` `; f.print``; }); - expect(lines).toStrictEqual([" ", ""]); + assert.deepStrictEqual(lines, [" ", ""]); }); - test("should print import symbol", async () => { + void test("should print import symbol", async () => { const lines = await testGenerate((f) => { const imp = createImportSymbol("Foo", "bar"); f.print`${imp}`; }); - expect(lines).toStrictEqual(['import { Foo } from "bar";', "", "Foo"]); + assert.deepStrictEqual(lines, ['import { Foo } from "bar";', "", "Foo"]); }); - test("should print real-world import use case", async () => { + void test("should print real-world import use case", async () => { const lines = await testGenerate((f) => { const Foo = createImportSymbol("Foo", "bar"); f.print`export function foo(): ${Foo.toTypeOnly()} { return new ${Foo}(); };`; }); - expect(lines).toStrictEqual([ + assert.deepStrictEqual(lines, [ 'import { Foo } from "bar";', "", "export function foo(): Foo {", @@ -352,22 +353,22 @@ describe("GeneratedFile.print", () => { "};", ]); }); - test("should print multiple printables", async () => { + void test("should print multiple printables", async () => { const lines = await testGenerate((f) => { f.print`${"a"}${"b"}${"c"}${1} ${createImportSymbol("Foo", "bar")}`; }); - expect(lines).toStrictEqual([ + assert.deepStrictEqual(lines, [ `import { Foo } from "bar";`, "", "abc1 Foo", ]); }); - test("should print nested printables", async () => { + void test("should print nested printables", async () => { const lines = await testGenerate((f) => { // biome-ignore format: want this to read well f.print`${"a"}${["b", ["c", "d", [1, " ", createImportSymbol("Foo", "bar")]]]}`; }); - expect(lines).toStrictEqual([ + assert.deepStrictEqual(lines, [ `import { Foo } from "bar";`, "", "abcd1 Foo", diff --git a/packages/protoplugin-test/src/file-runtime.test.ts b/packages/protoplugin-test/src/file-runtime.test.ts index 38e20eb68..2f8c04b67 100644 --- a/packages/protoplugin-test/src/file-runtime.test.ts +++ b/packages/protoplugin-test/src/file-runtime.test.ts @@ -12,19 +12,20 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { createTestPluginAndRun } from "./helpers.js"; -describe("GeneratedFile.runtime", () => { - test("should provide import symbols", async () => { +void suite("GeneratedFile.runtime", () => { + void test("should provide import symbols", async () => { await createTestPluginAndRun({ proto: `syntax="proto3";`, parameter: "target=ts", generateAny(f) { const imp = f.runtime.Message; - expect(imp.name).toBe("Message"); - expect(imp.from).toBe("@bufbuild/protobuf"); - expect(imp.typeOnly).toBe(true); + assert.equal(imp.name, "Message"); + assert.equal(imp.from, "@bufbuild/protobuf"); + assert.equal(imp.typeOnly, true); }, }); }); diff --git a/packages/protoplugin-test/src/file-string.test.ts b/packages/protoplugin-test/src/file-string.test.ts index 785b5d579..d5471742f 100644 --- a/packages/protoplugin-test/src/file-string.test.ts +++ b/packages/protoplugin-test/src/file-string.test.ts @@ -12,44 +12,45 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import type { GeneratedFile } from "@bufbuild/protoplugin"; import { createTestPluginAndRun } from "./helpers.js"; -describe("GeneratedFile.string", () => { - test("surrounds string in quotes", async () => { +void suite("GeneratedFile.string", () => { + void test("surrounds string in quotes", async () => { const lines = await testGenerate((f) => { f.print("const s = ", f.string("abc"), ";"); }); - expect(lines).toStrictEqual([`const s = "abc";`]); + assert.deepStrictEqual(lines, [`const s = "abc";`]); }); - test("surrounds string in quotes", async () => { + void test("surrounds string in quotes", async () => { const lines = await testGenerate((f) => { f.print(f.string("abc")); }); - expect(lines).toStrictEqual([`"abc"`]); + assert.deepStrictEqual(lines, [`"abc"`]); }); - test("escapes quote", async () => { + void test("escapes quote", async () => { const lines = await testGenerate((f) => { f.print(f.string(`ab"c`)); }); - expect(lines).toStrictEqual([`"ab\\"c"`]); + assert.deepStrictEqual(lines, [`"ab\\"c"`]); }); - test("escapes backslash", async () => { + void test("escapes backslash", async () => { const lines = await testGenerate((f) => { f.print(f.string("ab\\c")); }); - expect(lines).toStrictEqual([`"ab\\\\c"`]); + assert.deepStrictEqual(lines, [`"ab\\\\c"`]); }); - test("escapes line breaks", async () => { + void test("escapes line breaks", async () => { const lines = await testGenerate((f) => { f.print(f.string("ab\r\nc")); }); - expect(lines).toStrictEqual([`"ab\\r\\nc"`]); + assert.deepStrictEqual(lines, [`"ab\\r\\nc"`]); }); async function testGenerate(gen: (f: GeneratedFile) => void) { diff --git a/packages/protoplugin-test/src/helpers.ts b/packages/protoplugin-test/src/helpers.ts index c155a3a85..a5191734b 100644 --- a/packages/protoplugin-test/src/helpers.ts +++ b/packages/protoplugin-test/src/helpers.ts @@ -29,8 +29,7 @@ import type { Plugin, } from "@bufbuild/protoplugin"; import { UpstreamProtobuf } from "upstream-protobuf"; -import { expect } from "@jest/globals"; -import assert from "node:assert"; +import * as assert from "node:assert"; let upstreamProtobuf: UpstreamProtobuf | undefined; @@ -113,7 +112,7 @@ export async function createTestPluginAndRun( } const res = plugin.run(req); if (opt.returnLinesOfFirstFile === true) { - expect(res.file.length).toBeGreaterThanOrEqual(1); + assert.ok(res.file.length >= 1); let content = res.file[0]?.content ?? ""; if (content.endsWith("\n")) { content = content.slice(0, -1); // trim final newline so we don't return an extra line @@ -148,7 +147,7 @@ export async function compileFile(proto: string) { const fds = fromBinary(FileDescriptorSetSchema, bytes); const reg = createFileRegistry(fds); const file = reg.getFile("input.proto"); - assert(file); + assert.ok(file !== undefined); return file; } diff --git a/packages/protoplugin-test/src/import_extension.test.ts b/packages/protoplugin-test/src/import_extension.test.ts index 59edfd0ad..d263a6bb4 100644 --- a/packages/protoplugin-test/src/import_extension.test.ts +++ b/packages/protoplugin-test/src/import_extension.test.ts @@ -12,47 +12,49 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import type { GeneratedFile, Schema } from "@bufbuild/protoplugin"; import { createTestPluginAndRun } from "./helpers.js"; -describe("import_extension", () => { - test("should default to 'none'", async () => { +void suite("import_extension", () => { + void test("should default to 'none'", async () => { const lines = await testGenerate("target=ts", (f) => { const Bar = f.import("Bar", "./foo/bar_pb.js"); f.print(Bar); }); - expect(lines).toStrictEqual([ + assert.deepStrictEqual(lines, [ 'import { Bar } from "./foo/bar_pb";', "", "Bar", ]); }); - test.each([ + for (const {option, ext} of [ { option: "js", ext: ".js" }, { option: ".js", ext: ".js" }, { option: "ts", ext: ".ts" }, { option: ".ts", ext: ".ts" }, - ])("should be replaced with option '$option'", async ({ option, ext }) => { - const lines = await testGenerate( - `target=ts,import_extension=${option}`, - (f) => { - const Bar = f.import("Bar", "./foo/bar_pb.js"); - f.print(Bar); - }, - ); - expect(lines).toStrictEqual([ - `import { Bar } from "./foo/bar_pb${ext}";`, - "", - "Bar", - ]); - }); - test.each([ + ]) { + void test(`should be replaced with option ${option}`, async () => { + const lines = await testGenerate( + `target=ts,import_extension=${option}`, + (f) => { + const Bar = f.import("Bar", "./foo/bar_pb.js"); + f.print(Bar); + }, + ); + assert.deepStrictEqual(lines, [ + `import { Bar } from "./foo/bar_pb${ext}";`, + "", + "Bar", + ]); + }); + } + for (const {option, ext} of [ { option: "none", ext: "" }, { option: "", ext: "" }, - ])( - "should be removed with with option '$option'", - async ({ option, ext }) => { + ]) { + void test(`should be removed with with option ${option}`, async () => { const lines = await testGenerate( `target=ts,import_extension=${option}`, (f) => { @@ -60,27 +62,30 @@ describe("import_extension", () => { f.print(Bar); }, ); - expect(lines).toStrictEqual([ + assert.deepStrictEqual(lines, [ `import { Bar } from "./foo/bar_pb${ext}";`, "", "Bar", ]); - }, - ); - test("throws error for unknown extension", async () => { - await expect(async () => { + }); + } + void test("throws error for unknown extension", async () => { + await assert.rejects(async () => { await testGenerate("target=mjs", (f) => { const Bar = f.import("Bar", "./foo/bar_pb.js"); f.print(Bar); }); - }).rejects.toThrow(`invalid option "target=mjs"`); + }, { + name: "PluginOptionError", + message: `invalid option "target=mjs"`, + }); }); - test("should only touch .js import paths", async () => { + void test("should only touch .js import paths", async () => { const lines = await testGenerate("target=ts,import_extension=ts", (f) => { const json = f.import("json", "./foo/bar_pb.json"); f.print(json); }); - expect(lines).toStrictEqual([ + assert.deepStrictEqual(lines, [ 'import { json } from "./foo/bar_pb.json";', "", "json", diff --git a/packages/protoplugin-test/src/js_import_style.test.ts b/packages/protoplugin-test/src/js_import_style.test.ts index 309b18114..cf4236827 100644 --- a/packages/protoplugin-test/src/js_import_style.test.ts +++ b/packages/protoplugin-test/src/js_import_style.test.ts @@ -12,11 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import type { Schema } from "@bufbuild/protoplugin"; import { createTestPluginAndRun } from "./helpers.js"; -describe("js_import_style", () => { +void suite("js_import_style", () => { const linesEsm = [ `import { third } from "party";`, "", @@ -25,40 +26,40 @@ describe("js_import_style", () => { `import { hand } from "written";`, "hand();", ]; - describe("unset", () => { - test.each(["js", "ts", "dts"])( - "uses module with target %p", - async (target) => { - const lines = await testGenerate(`target=${target}`); - expect(lines).toStrictEqual(linesEsm); - }, - ); + void suite("unset", () => { + for (const target of ["js", "ts", "dts"]) { + void test(`uses module with target ${target}`, async () => { + const lines = await testGenerate(`target=${target}`); + assert.deepStrictEqual(lines, linesEsm); + }, + ); + } }); - describe("module", () => { - test.each(["js", "ts", "dts"])( - "uses module with target %p", - async (target) => { - const lines = await testGenerate( - `js_import_style=module,target=${target}`, - ); - expect(lines).toStrictEqual(linesEsm); - }, - ); + void suite("module", () => { + for (const target of ["js", "ts", "dts"]) { + void test(`uses module with target ${target}`, async () => { + const lines = await testGenerate(`js_import_style=module,target=${target}`); + assert.deepStrictEqual(lines, linesEsm); + }, + ); + } }); - describe("legacy_commonjs", () => { - test.each(["ts", "dts"])("uses CommonJs with target %p", async (target) => { - const lines = await testGenerate( - `js_import_style=legacy_commonjs,target=${target}`, - ); - expect(lines).toStrictEqual(linesEsm); - }); + void suite("legacy_commonjs", () => { + for (const target of ["ts", "dts"]) { + void test(`uses CommonJs with target ${target}`, async () => { + const lines = await testGenerate( + `js_import_style=legacy_commonjs,target=${target}`, + ); + assert.deepStrictEqual(lines, linesEsm); + }); + } test(`uses CommonJs with target "js"`, async () => { const lines = await testGenerate( "js_import_style=legacy_commonjs,target=js", ); - expect(lines).toStrictEqual([ + assert.deepStrictEqual(lines, [ `"use strict";`, `Object.defineProperty(exports, "__esModule", { value: true });`, "", @@ -72,12 +73,12 @@ describe("js_import_style", () => { "exports.MyClass = MyClass;", ]); }); - test("uses CommonJs with built-in transpile", async () => { + void test("uses CommonJs with built-in transpile", async () => { const lines = await testGenerate( "js_import_style=legacy_commonjs,target=js", true, ); - expect(lines).toStrictEqual([ + assert.deepStrictEqual(lines, [ `"use strict";`, `Object.defineProperty(exports, "__esModule", { value: true });`, "exports.MyClass = void 0;", diff --git a/packages/protoplugin-test/src/keep_empty_files.test.ts b/packages/protoplugin-test/src/keep_empty_files.test.ts index 167cb455e..517892432 100644 --- a/packages/protoplugin-test/src/keep_empty_files.test.ts +++ b/packages/protoplugin-test/src/keep_empty_files.test.ts @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { createTestPluginAndRun } from "./helpers.js"; -describe("keep_empty_files", () => { - describe("unset", () => { - test.each(["js", "ts", "dts"])( - "does not generate empty file with target %p", - async (target) => { +void suite("keep_empty_files", () => { + void suite("unset", () => { + for (const target of ["js", "ts", "dts"]) { + void test(`does not generate empty file with target ${target}`, async () => { const res = await createTestPluginAndRun({ proto: ` // detached syntax comment @@ -44,12 +44,11 @@ describe("keep_empty_files", () => { f.export("foo", "bar"); }, }); - expect(res.file.length).toBe(0); - }, - ); - test.each(["js", "ts", "dts"])( - "printing empty line generates a file with target %p", - async (target) => { + assert.strictEqual(res.file.length, 0); + }); + } + for (const target of ["js", "ts", "dts"]) { + void test(`printing empty line generates a file with target ${target}`, async () => { const lines = await createTestPluginAndRun({ returnLinesOfFirstFile: true, proto: `syntax="proto3"; message M {}`, @@ -58,15 +57,13 @@ describe("keep_empty_files", () => { f.print(); }, }); - expect(lines).toStrictEqual([""]); - }, - ); + assert.deepStrictEqual(lines, [""]); + }) + } }); - - describe("set", () => { - test.each(["js", "ts", "dts"])( - "generates empty file with target %p", - async (target) => { + void suite("set", () => { + for (const target of ["js", "ts", "dts"]) { + void test(`generates empty file with target ${target}`, async () => { const res = await createTestPluginAndRun({ proto: `syntax="proto3"; message M {}`, parameter: `target=${target},keep_empty_files=true`, @@ -75,8 +72,8 @@ describe("keep_empty_files", () => { f.preamble(schema.files[0]); }, }); - expect(res.file.length).toBe(1); - }, - ); + assert.strictEqual(res.file.length, 1); + }) + } }); }); diff --git a/packages/protoplugin-test/src/parse-option.test.ts b/packages/protoplugin-test/src/parse-option.test.ts index 3c496ba5a..19802ecff 100644 --- a/packages/protoplugin-test/src/parse-option.test.ts +++ b/packages/protoplugin-test/src/parse-option.test.ts @@ -12,13 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { CodeGeneratorRequestSchema } from "@bufbuild/protobuf/wkt"; import { create, type MessageInitShape } from "@bufbuild/protobuf"; import type { Schema } from "@bufbuild/protoplugin"; import { createEcmaScriptPlugin } from "@bufbuild/protoplugin"; -describe("parse custom plugin option", () => { +void suite("parse custom plugin option", () => { interface Options { foo?: number; bar: boolean; @@ -67,32 +68,32 @@ describe("parse custom plugin option", () => { generateDts: generate, }).run(create(CodeGeneratorRequestSchema, req)); }; - test("parse as expected on the happy path", () => { + void test("parse as expected on the happy path", () => { runPlugin( (options) => { - expect(options.foo).toBe(123); - expect(options.bar).toBe(true); - expect(options.baz).toStrictEqual(["a", "b"]); + assert.strictEqual(options.foo, 123); + assert.strictEqual(options.bar, true); + assert.deepStrictEqual(options.baz,["a", "b"]); }, create(CodeGeneratorRequestSchema, { parameter: "foo=123,bar,baz=a,baz=b", }), ); }); - test("custom option is initialized to default if no plugin option is provided", () => { + void test("custom option is initialized to default if no plugin option is provided", () => { runPlugin( (options) => { - expect(options.foo).toBeUndefined(); - expect(options.bar).toBe(false); - expect(options.baz).toStrictEqual([]); + assert.strictEqual(options.foo, undefined); + assert.strictEqual(options.bar, false); + assert.deepStrictEqual(options.baz, []); }, create(CodeGeneratorRequestSchema, { parameter: "", }), ); }); - test("error from parseOption is wrapped", () => { - expect(() => + void test("error from parseOption is wrapped", () => { + assert.throws(() => runPlugin( () => { // @@ -100,11 +101,13 @@ describe("parse custom plugin option", () => { { parameter: "foo=abc", }, - ), - ).toThrow(/^invalid option "foo=abc": please provide an integer for foo$/); + ), { + name: "PluginOptionError", + message: /^invalid option "foo=abc": please provide an integer for foo$/ + }); }); - test("unknown option raises an error", () => { - expect(() => + void test("unknown option raises an error", () => { + assert.throws(() => runPlugin( () => { // @@ -112,11 +115,13 @@ describe("parse custom plugin option", () => { { parameter: "unknown", }, - ), - ).toThrow(/^invalid option "unknown"$/); + ), { + name: "PluginOptionError", + message: /^invalid option "unknown"$/ + }); }); - test("unknown option with value raises an error", () => { - expect(() => + void test("unknown option with value raises an error", () => { + assert.throws(() => runPlugin( () => { // @@ -124,7 +129,9 @@ describe("parse custom plugin option", () => { { parameter: "unknown=bar", }, - ), - ).toThrow(/^invalid option "unknown=bar"$/); + ), { + name: "PluginOptionError", + message: /^invalid option "unknown=bar"$/ + }); }); }); diff --git a/packages/protoplugin-test/src/plugin-edition-support.test.ts b/packages/protoplugin-test/src/plugin-edition-support.test.ts index be1e23b1e..fb0216d3a 100644 --- a/packages/protoplugin-test/src/plugin-edition-support.test.ts +++ b/packages/protoplugin-test/src/plugin-edition-support.test.ts @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { fromBinary, minimumEdition, maximumEdition } from "@bufbuild/protobuf"; import { CodeGeneratorRequestSchema, @@ -56,8 +57,8 @@ function noop() { // } -describe("editions support in plugins", () => { - test("sets SUPPORTS_EDITIONS", async () => { +void suite("editions support in plugins", () => { + void test("sets SUPPORTS_EDITIONS", async () => { const res = await createTestPluginAndRun({ proto: `syntax="proto3";`, generateAny: noop, @@ -66,71 +67,70 @@ describe("editions support in plugins", () => { (res.supportedFeatures & BigInt(CodeGeneratorResponse_Feature.SUPPORTS_EDITIONS)) === BigInt(CodeGeneratorResponse_Feature.SUPPORTS_EDITIONS); - expect(supportsEditions).toBe(true); + assert.strictEqual(supportsEditions, true); }); - test("sets supported edition range to @bufbuild/protobuf's supported range", async () => { + void test("sets supported edition range to @bufbuild/protobuf's supported range", async () => { const res = await createTestPluginAndRun({ proto: `syntax="proto3";`, generateAny: noop, }); - expect(res.minimumEdition).toBe(minimumEdition); - expect(res.maximumEdition).toBe(maximumEdition); + assert.strictEqual(res.minimumEdition, minimumEdition); + assert.strictEqual(res.maximumEdition, maximumEdition); }); - test("sets supported edition range to the provided range", async () => { + void test("sets supported edition range to the provided range", async () => { const res = await createTestPluginAndRun({ proto: `syntax="proto3";`, minimumEdition: Edition.EDITION_PROTO2, maximumEdition: Edition.EDITION_PROTO3, generateAny: noop, }); - expect(res.minimumEdition).toBe(Edition.EDITION_PROTO2); - expect(res.maximumEdition).toBe(Edition.EDITION_PROTO3); + assert.strictEqual(res.minimumEdition, Edition.EDITION_PROTO2); + assert.strictEqual(res.maximumEdition, Edition.EDITION_PROTO3); }); - test("raises error for minimumEdition > maximumEdition", async () => { - await expect(async () => + void test("raises error for minimumEdition > maximumEdition", async () => { + await assert.rejects(async () => runPlugin( Edition.EDITION_PROTO3, Edition.EDITION_PROTO3, Edition.EDITION_PROTO2, - ), - ).rejects.toThrow( - /^configured minimumEdition PROTO3 > maximumEdition PROTO2 - please contact plugin author$/, - ); + ), { + message: /^configured minimumEdition PROTO3 > maximumEdition PROTO2 - please contact plugin author$/, + }); }); - test("raises error on unsupported edition from the past with default range", async () => { - await expect(async () => - runPlugin(Edition.EDITION_1_TEST_ONLY), - ).rejects.toThrow( - /^test.proto: unsupported edition 1_TEST_ONLY - the earliest supported edition is PROTO2$/, - ); + void test("raises error on unsupported edition from the past with default range", async () => { + await assert.rejects(async () => + runPlugin( + Edition.EDITION_1_TEST_ONLY, + ), { + message: /^test.proto: unsupported edition 1_TEST_ONLY - the earliest supported edition is PROTO2$/, + }); }); - test("raises error on unsupported edition from the future with default range", async () => { - await expect(async () => - runPlugin(Edition.EDITION_99999_TEST_ONLY), - ).rejects.toThrow( - /^test.proto: unsupported edition 99999_TEST_ONLY - the latest supported edition is 2023$/, - ); + void test("raises error on unsupported edition from the future with default range", async () => { + await assert.rejects(async () => + runPlugin( + Edition.EDITION_99999_TEST_ONLY, + ), { + message: /^test.proto: unsupported edition 99999_TEST_ONLY - the latest supported edition is 2023$/, + }); }); - test("raises error on unsupported edition from the past with custom range", async () => { - await expect(async () => + void test("raises error on unsupported edition from the past with custom range", async () => { + await assert.rejects(async () => runPlugin( Edition.EDITION_PROTO2, Edition.EDITION_PROTO3, Edition.EDITION_PROTO3, - ), - ).rejects.toThrow( - /^test.proto: unsupported edition PROTO2 - the earliest supported edition is PROTO3$/, - ); + ), { + message: /^test.proto: unsupported edition PROTO2 - the earliest supported edition is PROTO3$/, + }); }); - test("raises error on unsupported edition from the future with custom range", async () => { - await expect(async () => + void test("raises error on unsupported edition from the future with custom range", async () => { + await assert.rejects(async () => runPlugin( Edition.EDITION_2023, Edition.EDITION_PROTO3, Edition.EDITION_PROTO3, - ), - ).rejects.toThrow( - /^test.proto: unsupported edition 2023 - the latest supported edition is PROTO3$/, - ); + ), { + message: /^test.proto: unsupported edition 2023 - the latest supported edition is PROTO3$/, + }); }); }); diff --git a/packages/protoplugin-test/src/rewrite_imports.test.ts b/packages/protoplugin-test/src/rewrite_imports.test.ts index a81382cff..48c319662 100644 --- a/packages/protoplugin-test/src/rewrite_imports.test.ts +++ b/packages/protoplugin-test/src/rewrite_imports.test.ts @@ -12,12 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import type { GeneratedFile, Schema } from "@bufbuild/protoplugin"; import { createTestPluginAndRun } from "./helpers.js"; -describe("rewrite_imports", () => { - test("example works as documented", async () => { +void suite("rewrite_imports", () => { + void test("example works as documented", async () => { const lines = await testGenerate( "target=ts,rewrite_imports=./foo/**/*_pb.js:@scope/pkg", (f) => { @@ -26,14 +27,14 @@ describe("rewrite_imports", () => { f.print("console.log(", Bar, ", ", Baz, ");"); }, ); - expect(lines).toStrictEqual([ + assert.deepStrictEqual(lines, [ 'import { Bar } from "@scope/pkg/foo/bar_pb";', 'import { Baz } from "@scope/pkg/foo/bar/baz_pb";', "", "console.log(Bar, Baz);", ]); }); - test("should rewrite npm import to other package", async () => { + void test("should rewrite npm import to other package", async () => { const lines = await testGenerate( "target=ts,rewrite_imports=@scope/pkg:@other-scope/other-pkg", (f) => { @@ -41,13 +42,13 @@ describe("rewrite_imports", () => { f.print(Foo); }, ); - expect(lines).toStrictEqual([ + assert.deepStrictEqual(lines, [ 'import { Foo } from "@other-scope/other-pkg";', "", "Foo", ]); }); - test("should rewrite to target with package prefix", async () => { + void test("should rewrite to target with package prefix", async () => { const lines = await testGenerate( "target=ts,rewrite_imports=@scope/pkg:npm:@scope/pkg", (f) => { @@ -55,13 +56,13 @@ describe("rewrite_imports", () => { f.print(Foo); }, ); - expect(lines).toStrictEqual([ + assert.deepStrictEqual(lines, [ 'import { Foo } from "npm:@scope/pkg";', "", "Foo", ]); }); - test("should rewrite to target with package prefix and subpath", async () => { + void test("should rewrite to target with package prefix and subpath", async () => { const lines = await testGenerate( "target=ts,rewrite_imports=@scope/pkg/subpath:npm:@scope/pkg/subpath", (f) => { @@ -69,7 +70,7 @@ describe("rewrite_imports", () => { f.print(Foo); }, ); - expect(lines).toStrictEqual([ + assert.deepStrictEqual(lines, [ 'import { Foo } from "npm:@scope/pkg/subpath";', "", "Foo", diff --git a/packages/protoplugin-test/src/safe-identifier.test.ts b/packages/protoplugin-test/src/safe-identifier.test.ts index ee200f528..ca3749c60 100644 --- a/packages/protoplugin-test/src/safe-identifier.test.ts +++ b/packages/protoplugin-test/src/safe-identifier.test.ts @@ -12,26 +12,27 @@ // See the License for the specific language governing permissions and // limitations under the License. +import { suite, test } from "node:test"; import { safeIdentifier } from "@bufbuild/protoplugin"; -import { describe, expect, test } from "@jest/globals"; +import assert from "node:assert"; -describe("safeIdentifier", () => { - test("sanitized reserved identifiers", () => { - expect(safeIdentifier("break")).toBe("break$"); - expect(safeIdentifier("case")).toBe("case$"); - expect(safeIdentifier("catch")).toBe("catch$"); - expect(safeIdentifier("class")).toBe("class$"); - expect(safeIdentifier("const")).toBe("const$"); - expect(safeIdentifier("continue")).toBe("continue$"); - expect(safeIdentifier("debugger")).toBe("debugger$"); - expect(safeIdentifier("default")).toBe("default$"); - expect(safeIdentifier("delete")).toBe("delete$"); +void suite("safeIdentifier", () => { + void test("sanitized reserved identifiers", () => { + assert.equal(safeIdentifier("break"), "break$"); + assert.equal(safeIdentifier("case"), "case$"); + assert.equal(safeIdentifier("catch"), "catch$"); + assert.equal(safeIdentifier("class"), "class$"); + assert.equal(safeIdentifier("const"), "const$"); + assert.equal(safeIdentifier("continue"), "continue$"); + assert.equal(safeIdentifier("debugger"), "debugger$"); + assert.equal(safeIdentifier("default"), "default$"); + assert.equal(safeIdentifier("delete"), "delete$"); }); - test("does not modify other inputs which are not reserved identifiers", () => { - expect(safeIdentifier("constructor")).toBe("constructor"); - expect(safeIdentifier("toString")).toBe("toString"); - expect(safeIdentifier("toJSON")).toBe("toJSON"); - expect(safeIdentifier("valueOf")).toBe("valueOf"); + void test("does not modify other inputs which are not reserved identifiers", () => { + assert.equal(safeIdentifier("constructor"), "constructor"); + assert.equal(safeIdentifier("toString"), "toString"); + assert.equal(safeIdentifier("toJSON"), "toJSON"); + assert.equal(safeIdentifier("valueOf"), "valueOf"); }); }); diff --git a/packages/protoplugin-test/src/source-code-info.test.ts b/packages/protoplugin-test/src/source-code-info.test.ts index 8cccbf6db..45f7ca133 100644 --- a/packages/protoplugin-test/src/source-code-info.test.ts +++ b/packages/protoplugin-test/src/source-code-info.test.ts @@ -12,13 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { getComments, getDeclarationString, getPackageComments, getSyntaxComments, } from "@bufbuild/protoplugin"; -import { describe, expect, test } from "@jest/globals"; import { compileEnum, compileField, @@ -26,8 +27,8 @@ import { compileMessage, } from "./helpers.js"; -describe("getComments()", () => { - test("for syntax", async () => { +void suite("getComments()", () => { + void test("for syntax", async () => { const file = await compileFile(` // Copyright ACME, Inc. // @@ -43,7 +44,7 @@ describe("getComments()", () => { package testcomments; `); const comments = getSyntaxComments(file); - expect(comments.leadingDetached).toStrictEqual([ + assert.deepStrictEqual(comments.leadingDetached, [ [ " Copyright ACME, Inc.", "", @@ -53,10 +54,10 @@ describe("getComments()", () => { "", ].join("\n"), ]); - expect(comments.leading).toBe(" Comment before syntax.\n"); - expect(comments.trailing).toBe(" Comment next to syntax.\n"); + assert.equal(comments.leading, " Comment before syntax.\n"); + assert.equal(comments.trailing, " Comment next to syntax.\n"); }); - test("for package", async () => { + void test("for package", async () => { const file = await compileFile(` // Comment before syntax. syntax = "proto3"; // Comment next to syntax. @@ -72,11 +73,11 @@ describe("getComments()", () => { message MessageWithComments {} `); const comments = getPackageComments(file); - expect(comments.leadingDetached[0]).toBe(" Comment after syntax.\n"); - expect(comments.leading).toBe(" Comment before package.\n"); - expect(comments.trailing).toBe(" Comment next to package.\n"); + assert.equal(comments.leadingDetached[0], " Comment after syntax.\n"); + assert.equal(comments.leading, " Comment before package.\n"); + assert.equal(comments.trailing, " Comment next to package.\n"); }); - test("for messages", async () => { + void test("for messages", async () => { const message = await compileMessage(` syntax="proto3"; package testcomments; // Comment next to package. @@ -88,14 +89,14 @@ describe("getComments()", () => { message MessageWithComments {} `); const comments = getComments(message); - expect(comments.leadingDetached).toStrictEqual([ + assert.deepStrictEqual(comments.leadingDetached, [ " Comment after package.\n", " Comment between package and message.\n", ]); - expect(comments.leading).toBe(" Comment before message.\n"); - expect(comments.trailing).toBeUndefined(); + assert.equal(comments.leading, " Comment before message.\n"); + assert.strictEqual(comments.trailing, undefined); }); - test("for fields", async () => { + void test("for fields", async () => { const field = await compileField(` syntax="proto3"; message MessageWithComments { @@ -116,84 +117,84 @@ describe("getComments()", () => { } `); const comments = getComments(field); - expect(comments.leadingDetached).toStrictEqual([ + assert.deepStrictEqual(comments.leadingDetached, [ "\n Comment after start of message,\n with funny indentation,\n and empty lines on start and end.\n\n", ]); - expect(comments.leading).toBe( + assert.equal(comments.leading, " Comment before field with 5 lines:\n line 2, next is empty\n\n line 4, next is empty\n\n", ); - expect(comments.trailing).toBe(" Comment next to field.\n"); + assert.equal(comments.trailing, " Comment next to field.\n"); }); }); -describe("getDeclarationString()", () => { - test("for field with json_name option", async () => { +void suite("getDeclarationString()", () => { + void test("for field with json_name option", async () => { const field = await compileField(` syntax="proto3"; message M { string scalar_field = 1 [json_name = "scalarFieldJsonName"]; } `); - expect(getDeclarationString(field)).toBe( + assert.equal(getDeclarationString(field), 'string scalar_field = 1 [json_name = "scalarFieldJsonName"]', ); }); - test("for field with jstype option", async () => { + void test("for field with jstype option", async () => { const field = await compileField(` syntax="proto3"; message M { string scalar_field = 1 [jstype = JS_NORMAL]; } `); - expect(getDeclarationString(field)).toBe( + assert.equal(getDeclarationString(field), "string scalar_field = 1 [jstype = JS_NORMAL]", ); }); - test("for field with edition feature", async () => { + void test("for field with edition feature", async () => { const field = await compileField(` edition="2023"; message M { string scalar_field = 1 [features.field_presence = EXPLICIT]; } `); - expect(getDeclarationString(field)).toBe( + assert.equal(getDeclarationString(field), "string scalar_field = 1 [features.field_presence = EXPLICIT]", ); }); - test("for repeated field", async () => { + void test("for repeated field", async () => { const field = await compileField(` syntax="proto3"; message M { repeated double double_field = 1; } `); - expect(getDeclarationString(field)).toBe( + assert.equal(getDeclarationString(field), "repeated double double_field = 1", ); }); - test("for proto2 optional field", async () => { + void test("for proto2 optional field", async () => { const field = await compileField(` syntax="proto3"; message M { optional double double_field = 1; } `); - expect(getDeclarationString(field)).toBe( + assert.equal(getDeclarationString(field), "optional double double_field = 1", ); }); - test("for proto2 required field", async () => { + void test("for proto2 required field", async () => { const field = await compileField(` syntax="proto2"; message M { required double double_field = 1; } `); - expect(getDeclarationString(field)).toBe( + assert.equal(getDeclarationString(field), "required double double_field = 1", ); }); - test("for map field", async () => { + void test("for map field", async () => { const field = await compileField(` syntax="proto3"; package foo; @@ -201,11 +202,11 @@ describe("getDeclarationString()", () => { map int32_msg_field = 10; } `); - expect(getDeclarationString(field)).toBe( + assert.equal(getDeclarationString(field), "map int32_msg_field = 10", ); }); - test("for enum value", async () => { + void test("for enum value", async () => { const e = await compileEnum(` syntax="proto3"; enum SimpleEnum { @@ -213,6 +214,6 @@ describe("getDeclarationString()", () => { SIMPLE_ONE = 1; } `); - expect(getDeclarationString(e.values[0])).toBe("SIMPLE_ZERO = 0"); + assert.equal(getDeclarationString(e.values[0]), "SIMPLE_ZERO = 0"); }); }); diff --git a/packages/protoplugin-test/src/transpile.test.ts b/packages/protoplugin-test/src/transpile.test.ts index 731c1e946..c2c65e8b5 100644 --- a/packages/protoplugin-test/src/transpile.test.ts +++ b/packages/protoplugin-test/src/transpile.test.ts @@ -12,10 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { createTestPluginAndRun } from "./helpers.js"; -describe("built-in transpile", () => { +void suite("built-in transpile", () => { async function testTranspileToDts(linesTs: string[]) { return await createTestPluginAndRun({ proto: `syntax="proto3";`, @@ -30,52 +31,54 @@ describe("built-in transpile", () => { }); } - describe("ECMAScript types", () => { - test("global Promise type transpiles", async () => { + void suite("ECMAScript types", () => { + void test("global Promise type transpiles", async () => { const linesDts = await testTranspileToDts([ "export const p = Promise.resolve(true);", ]); - expect(linesDts).toStrictEqual([ + assert.deepStrictEqual(linesDts, [ "export declare const p: Promise;", ]); }); }); - describe("TypeScript built-in types", () => { - test("global ReturnType transpiles", async () => { + void suite("TypeScript built-in types", () => { + void test("global ReturnType transpiles", async () => { const linesDts = await testTranspileToDts([ "export const n: ReturnType = 1;", ]); - expect(linesDts).toStrictEqual([ + assert.deepStrictEqual(linesDts, [ "export declare const n: ReturnType;", ]); }); }); - describe("DOM types", () => { - test("global Headers transpiles", async () => { + void suite("DOM types", () => { + void test("global Headers transpiles", async () => { const linesDts = await testTranspileToDts([ "export const h = new Headers();", ]); - expect(linesDts).toStrictEqual(["export declare const h: Headers;"]); + assert.deepStrictEqual(linesDts, [ + "export declare const h: Headers;", + ]); }); }); - describe("runtime types", () => { - test("JsonValue transpiles", async () => { + void suite("runtime types", () => { + void test("JsonValue transpiles", async () => { const linesDts = await testTranspileToDts([ `import type { JsonValue } from "@bufbuild/protobuf";`, "export const j: JsonValue = 1;", ]); - expect(linesDts).toStrictEqual([ + assert.deepStrictEqual(linesDts, [ `import type { JsonValue } from "@bufbuild/protobuf";`, "export declare const j: JsonValue;", ]); }); }); - describe("unknown type", () => { - test("is not inferred correctly", async () => { + void suite("unknown type", () => { + void test("is not inferred correctly", async () => { const linesDts = await testTranspileToDts([ `import { Foo } from "foo";`, "", @@ -83,78 +86,83 @@ describe("built-in transpile", () => { ]); // The return type is inferred as `any` instead of the expected // `Foo`. This is a limitation of the TypeScript compiler. - expect(linesDts).toStrictEqual(["export declare function foo(): any;"]); + assert.deepStrictEqual(linesDts, [ + "export declare function foo(): any;", + ]); }); - test("can be typed explicitly", async () => { + void test("can be typed explicitly", async () => { const linesDts = await testTranspileToDts([ `import { Foo } from "foo";`, "", "export function foo(): Foo { return new Foo(); };", ]); - expect(linesDts).toStrictEqual([ + assert.deepStrictEqual(linesDts, [ `import { Foo } from "foo";`, "export declare function foo(): Foo;", ]); }); }); - describe("failing to emit", () => { - test("raises error with helpful message", async () => { - await expect(async () => - testTranspileToDts([ - "export interface Foo {", - " p: {", - " [K in keyof P]: string;", - " },", - "}", - ]), - ).rejects.toThrow( - /^A problem occurred during transpilation and files were not generated\. {2}Contact the plugin author for support\.\n/, + void suite("failing to emit", () => { + void test("raises error with helpful message", async () => { + await assert.rejects( + async () => + testTranspileToDts([ + "export interface Foo {", + " p: {", + " [K in keyof P]: string;", + " },", + "}", + ]), + { + name: "Error", + message: /^A problem occurred during transpilation and files were not generated\. {2}Contact the plugin author for support\.\n/, + } ); }); - test("raises error with diagnostics", async () => { - await expect(async () => - testTranspileToDts([ - "export interface Foo {", - " p: {", - " [K in keyof P]: string;", - " },", - "}", - ]), - ).rejects.toThrow( + void test("raises error with diagnostics", async () => { + await assert.rejects( + async () => + testTranspileToDts([ + "export interface Foo {", + " p: {", + " [K in keyof P]: string;", + " },", + "}", + ]), /test\.ts\(3,17\): error TS4033: Property 'p' of exported interface has or is using private name 'P'\.$/, ); }); - test("raises error with 3 diagnostics, and elides the rest", async () => { - await expect(async () => - testTranspileToDts([ - "export interface Foo1 {", - " p: {", - " [K in keyof P]: string;", - " },", - "}", - "export interface Foo2 {", - " p: {", - " [K in keyof P]: string;", - " },", - "}", - "export interface Foo3 {", - " p: {", - " [K in keyof P]: string;", - " },", - "}", - "export interface Foo4 {", - " p: {", - " [K in keyof P]: string;", - " },", - "}", - "export interface Foo5 {", - " p: {", - " [K in keyof P]: string;", - " },", - "}", - ]), - ).rejects.toThrow( + void test("raises error with 3 diagnostics, and elides the rest", async () => { + await assert.rejects( + async () => + testTranspileToDts([ + "export interface Foo1 {", + " p: {", + " [K in keyof P]: string;", + " },", + "}", + "export interface Foo2 {", + " p: {", + " [K in keyof P]: string;", + " },", + "}", + "export interface Foo3 {", + " p: {", + " [K in keyof P]: string;", + " },", + "}", + "export interface Foo4 {", + " p: {", + " [K in keyof P]: string;", + " },", + "}", + "export interface Foo5 {", + " p: {", + " [K in keyof P]: string;", + " },", + "}", + ]), /(?:test\.ts\(\d+,\d+\): .+\n){3}2 more diagnostics elided/, ); }); From ca28d3b6f16ef8129dbb102fa522eefa8e96398c Mon Sep 17 00:00:00 2001 From: Timo Stamm Date: Mon, 18 Aug 2025 15:57:16 +0200 Subject: [PATCH 02/16] Migrate protobuf-test codegenv1 codegenv2 reflect --- .../protobuf-test/src/codegenv1/boot.test.ts | 28 +- .../protobuf-test/src/codegenv1/embed.test.ts | 20 +- .../protobuf-test/src/codegenv1/enum.test.ts | 25 +- .../src/codegenv1/extension.test.ts | 7 +- .../protobuf-test/src/codegenv1/file.test.ts | 13 +- .../src/codegenv1/message.test.ts | 7 +- .../src/codegenv1/service.test.ts | 7 +- .../protobuf-test/src/codegenv1/types.test.ts | 45 +- .../protobuf-test/src/codegenv2/boot.test.ts | 28 +- .../protobuf-test/src/codegenv2/embed.test.ts | 20 +- .../protobuf-test/src/codegenv2/enum.test.ts | 25 +- .../src/codegenv2/extension.test.ts | 7 +- .../protobuf-test/src/codegenv2/file.test.ts | 13 +- .../src/codegenv2/message.test.ts | 7 +- .../src/codegenv2/service.test.ts | 7 +- .../protobuf-test/src/codegenv2/types.test.ts | 49 +- .../protobuf-test/src/reflect/error.test.ts | 41 +- .../protobuf-test/src/reflect/names.test.ts | 88 ++-- .../src/reflect/nested-types.test.ts | 33 +- .../protobuf-test/src/reflect/path.test.ts | 40 +- .../src/reflect/reflect-list.test.ts | 107 ++--- .../src/reflect/reflect-map.test.ts | 129 +++--- .../protobuf-test/src/reflect/reflect.test.ts | 431 ++++++++++-------- packages/protoplugin-test/src/target.test.ts | 29 +- 24 files changed, 628 insertions(+), 578 deletions(-) diff --git a/packages/protobuf-test/src/codegenv1/boot.test.ts b/packages/protobuf-test/src/codegenv1/boot.test.ts index d6fa6008b..ed61c2443 100644 --- a/packages/protobuf-test/src/codegenv1/boot.test.ts +++ b/packages/protobuf-test/src/codegenv1/boot.test.ts @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import type { CompileToDescriptorSetOptions } from "upstream-protobuf"; import { UpstreamProtobuf } from "upstream-protobuf"; import { join as joinPath } from "node:path"; @@ -29,7 +30,6 @@ import { FieldOptionsSchema, EnumDescriptorProtoSchema, } from "@bufbuild/protobuf/wkt"; -import assert from "node:assert"; import { boot, bootFileDescriptorProto, @@ -37,18 +37,18 @@ import { embedFileDesc, } from "@bufbuild/protobuf/codegenv1"; -describe("boot()", () => { +void suite("boot()", () => { test("hydrates google/protobuf/descriptor.proto", async () => { const fileDescriptorProto = await compileGoogleProtobufDescriptorProto(); const embedded = embedFileDesc(fileDescriptorProto); - assert(embedded.bootable); + assert.ok(embedded.bootable); const bootedFileDesc = boot(embedded.boot()); - expect(bootedFileDesc).toBeDefined(); + assert.ok(bootedFileDesc !== undefined); }); }); -describe("createFileDescriptorProtoBoot()", () => { +void suite("createFileDescriptorProtoBoot()", () => { test("only accepts google/protobuf/descriptor.proto", async () => { const upstreamProtobuf = new UpstreamProtobuf(); const bytes = await upstreamProtobuf.compileToDescriptorSet( @@ -62,20 +62,20 @@ describe("createFileDescriptorProtoBoot()", () => { ); const fileDescriptorProto = fromBinary(FileDescriptorSetSchema, bytes) .file[0]; - expect(() => createFileDescriptorProtoBoot(fileDescriptorProto)).toThrow(); + assert.throws(() => createFileDescriptorProtoBoot(fileDescriptorProto)); }); test("requires unset source_code_info", async () => { const fileDescriptorProto = await compileGoogleProtobufDescriptorProto({ includeSourceInfo: true, }); - expect(() => createFileDescriptorProtoBoot(fileDescriptorProto)).toThrow(); + assert.throws(() => createFileDescriptorProtoBoot(fileDescriptorProto)); }); }); -describe("bootFileDescriptorProto()", () => { +void suite("bootFileDescriptorProto()", () => { test("keeps all important bits of google/protobuf/descriptor.proto", async () => { const compiled = await compileGoogleProtobufDescriptorProto(); - expect(compiled).toBeDefined(); + assert.ok(compiled !== undefined); const booted = bootFileDescriptorProto( createFileDescriptorProtoBoot(compiled), @@ -83,11 +83,11 @@ describe("bootFileDescriptorProto()", () => { stripLikeBoot(compiled); const eq = equals(FileDescriptorProtoSchema, compiled, booted); - expect(eq).toBe(true); + assert.strictEqual(eq, true); const compiledBytes = toBinary(FileDescriptorProtoSchema, compiled); const bootedBytes = toBinary(FileDescriptorProtoSchema, booted); - expect(bootedBytes).toStrictEqual(compiledBytes); + assert.deepStrictEqual(bootedBytes, compiledBytes); }); function stripLikeBoot( d: FileDescriptorProto | DescriptorProto | EnumDescriptorProto, @@ -138,8 +138,8 @@ async function compileGoogleProtobufDescriptorProto( opt, ); const fds = fromBinary(FileDescriptorSetSchema, fdsBytes); - assert(fds.file.length == 1); + assert.equal(fds.file.length, 1); const file = fds.file[0]; - assert(file.name == path); + assert.equal(file.name, path); return file; } diff --git a/packages/protobuf-test/src/codegenv1/embed.test.ts b/packages/protobuf-test/src/codegenv1/embed.test.ts index 4ebaa7687..51be4fa30 100644 --- a/packages/protobuf-test/src/codegenv1/embed.test.ts +++ b/packages/protobuf-test/src/codegenv1/embed.test.ts @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { compileFile, compileFileDescriptorSet } from "../helpers.js"; import { embedFileDesc } from "@bufbuild/protobuf/codegenv1"; -import assert from "node:assert"; import { createFileRegistry } from "@bufbuild/protobuf"; -describe("embedFileDesc()", () => { +void suite("embedFileDesc()", () => { test("embeds file descriptor", async () => { const file = await compileFile(` syntax="proto3"; @@ -27,8 +27,8 @@ describe("embedFileDesc()", () => { } `); const embedded = embedFileDesc(file.proto); - expect(embedded.bootable).toBe(false); - expect(typeof embedded.base64()).toBe("string"); + assert.strictEqual(embedded.bootable, false); + assert.strictEqual(typeof embedded.base64(), "string"); }); test("embeds google/protobuf.descriptor.proto", async () => { const file = createFileRegistry( @@ -39,15 +39,15 @@ describe("embedFileDesc()", () => { `, }), ).getFile("google/protobuf/descriptor.proto"); - assert(file); + assert.ok(file !== undefined); const embedded = embedFileDesc(file.proto); - expect(embedded).toBeDefined(); - expect(embedded.bootable).toBe(true); + assert.ok(embedded !== undefined); + assert.strictEqual(embedded.bootable, true); if (embedded.bootable) { const b = embedded.boot(); - expect(b).toBeDefined(); + assert.ok(b !== undefined); } - expect(typeof embedded.base64()).toBe("string"); + assert.strictEqual(typeof embedded.base64(), "string"); }); }); diff --git a/packages/protobuf-test/src/codegenv1/enum.test.ts b/packages/protobuf-test/src/codegenv1/enum.test.ts index dbdce0583..f38dd7cab 100644 --- a/packages/protobuf-test/src/codegenv1/enum.test.ts +++ b/packages/protobuf-test/src/codegenv1/enum.test.ts @@ -12,11 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { compileEnum, compileFile } from "../helpers.js"; import { enumDesc, tsEnum } from "@bufbuild/protobuf/codegenv1"; -describe("enumDesc()", () => { +void suite("enumDesc()", () => { test("resolves enum", async () => { const descFile = await compileFile(` syntax="proto3"; @@ -26,11 +27,11 @@ describe("enumDesc()", () => { } `); const descEnum = enumDesc(descFile, 0); - expect(descEnum.name).toBe("E"); + assert.strictEqual(descEnum.name, "E"); }); }); -describe("tsEnum()", () => { +void suite("tsEnum()", () => { test("creates TS enum", async () => { const descEnum = await compileEnum(` syntax="proto3"; @@ -40,11 +41,11 @@ describe("tsEnum()", () => { } `); const e = tsEnum(descEnum); - expect(e[0]).toBe("A"); - expect(e[1]).toBe("B"); - expect(e.A).toBe(0); - expect(e.B).toBe(1); - expect(e).toStrictEqual({ + assert.strictEqual(e[0], "A"); + assert.strictEqual(e[1], "B"); + assert.strictEqual(e.A, 0); + assert.strictEqual(e.B, 1); + assert.deepStrictEqual(e, { 0: "A", 1: "B", A: 0, @@ -60,7 +61,7 @@ describe("tsEnum()", () => { } `); const e = tsEnum(descEnum); - expect(e).toStrictEqual({ + assert.deepStrictEqual(e, { 0: "ZERO", 1: "ONE", ZERO: 0, @@ -78,7 +79,7 @@ describe("tsEnum()", () => { } `); const e = tsEnum(descEnum); - expect(e).toStrictEqual({ + assert.deepStrictEqual(e, { 0: "constructor$", 1: "toString$", 2: "toJSON$", @@ -100,7 +101,7 @@ describe("tsEnum()", () => { } `); const e = tsEnum(descEnum); - expect(e).toStrictEqual({ + assert.deepStrictEqual(e, { 0: "constructor$", 1: "toString$", 2: "toJSON$", diff --git a/packages/protobuf-test/src/codegenv1/extension.test.ts b/packages/protobuf-test/src/codegenv1/extension.test.ts index b2378b540..1c0ea55ad 100644 --- a/packages/protobuf-test/src/codegenv1/extension.test.ts +++ b/packages/protobuf-test/src/codegenv1/extension.test.ts @@ -12,11 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { compileFile } from "../helpers.js"; import { extDesc } from "@bufbuild/protobuf/codegenv1"; -describe("extDesc()", () => { +void suite("extDesc()", () => { test("resolves extension", async () => { const descFile = await compileFile(` syntax="proto3"; @@ -26,6 +27,6 @@ describe("extDesc()", () => { } `); const descExtension = extDesc(descFile, 0); - expect(descExtension.typeName).toBe("http"); + assert.strictEqual(descExtension.typeName, "http"); }); }); diff --git a/packages/protobuf-test/src/codegenv1/file.test.ts b/packages/protobuf-test/src/codegenv1/file.test.ts index d14a59c73..b392d905b 100644 --- a/packages/protobuf-test/src/codegenv1/file.test.ts +++ b/packages/protobuf-test/src/codegenv1/file.test.ts @@ -12,11 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { compileMessage } from "../helpers.js"; import { embedFileDesc, fileDesc } from "@bufbuild/protobuf/codegenv1"; -describe("fileDesc()", () => { +void suite("fileDesc()", () => { test("hydrates default jsonName and proto.jsonName", async () => { const { file } = await compileMessage(` syntax="proto3"; @@ -26,8 +27,8 @@ describe("fileDesc()", () => { `); const hydrated = fileDesc(embedFileDesc(file.proto).base64()); const field = hydrated.messages[0].fields[0]; - expect(field.jsonName).toBe("int32Field"); - expect(field.proto.jsonName).toBe("int32Field"); + assert.strictEqual(field.jsonName, "int32Field"); + assert.strictEqual(field.proto.jsonName, "int32Field"); }); test("hydrates custom jsonName and proto.jsonName", async () => { @@ -39,7 +40,7 @@ describe("fileDesc()", () => { `); const hydrated = fileDesc(embedFileDesc(file.proto).base64()); const field = hydrated.messages[0].fields[0]; - expect(field.jsonName).toBe("foo"); - expect(field.proto.jsonName).toBe("foo"); + assert.strictEqual(field.jsonName, "foo"); + assert.strictEqual(field.proto.jsonName, "foo"); }); }); diff --git a/packages/protobuf-test/src/codegenv1/message.test.ts b/packages/protobuf-test/src/codegenv1/message.test.ts index e35517f19..99dd62912 100644 --- a/packages/protobuf-test/src/codegenv1/message.test.ts +++ b/packages/protobuf-test/src/codegenv1/message.test.ts @@ -12,11 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { compileFile } from "../helpers.js"; import { messageDesc } from "@bufbuild/protobuf/codegenv1"; -describe("messageDesc()", () => { +void suite("messageDesc()", () => { test("resolves message", async () => { const descFile = await compileFile(` syntax="proto3"; @@ -25,6 +26,6 @@ describe("messageDesc()", () => { } `); const descMessage = messageDesc(descFile, 0); - expect(descMessage.typeName).toBe("M"); + assert.strictEqual(descMessage.typeName, "M"); }); }); diff --git a/packages/protobuf-test/src/codegenv1/service.test.ts b/packages/protobuf-test/src/codegenv1/service.test.ts index f1a11a274..67039809d 100644 --- a/packages/protobuf-test/src/codegenv1/service.test.ts +++ b/packages/protobuf-test/src/codegenv1/service.test.ts @@ -12,11 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { compileFile } from "../helpers.js"; import { serviceDesc } from "@bufbuild/protobuf/codegenv1"; -describe("serviceDesc()", () => { +void suite("serviceDesc()", () => { test("resolves service", async () => { const descFile = await compileFile(` syntax="proto3"; @@ -26,6 +27,6 @@ describe("serviceDesc()", () => { message E {} `); const descService = serviceDesc(descFile, 0); - expect(descService.typeName).toBe("Foo"); + assert.strictEqual(descService.typeName, "Foo"); }); }); diff --git a/packages/protobuf-test/src/codegenv1/types.test.ts b/packages/protobuf-test/src/codegenv1/types.test.ts index 89e8ec387..5f83bd23c 100644 --- a/packages/protobuf-test/src/codegenv1/types.test.ts +++ b/packages/protobuf-test/src/codegenv1/types.test.ts @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import type { DescField, DescFile, @@ -38,30 +39,30 @@ import type { GenService, } from "@bufbuild/protobuf/codegenv1"; -describe("GenFile", () => { +void suite("GenFile", () => { test("is DescFile", async () => { function f(genFile: GenFile, descFile: DescFile) { genFile = descFile; descFile = genFile; return descFile; } - expect(f).toBeDefined(); + assert.ok(f !== undefined); }); }); -describe("GenMessage", () => { +void suite("GenMessage", () => { type FakeMessage = Message<"fake"> & { foo: boolean }; test("is DescMessage", () => { function f(genMessage: GenMessage): DescMessage { return genMessage; } - expect(f).toBeDefined(); + assert.ok(f !== undefined); }); test("single type parameter is message shape", () => { function f(message: FakeMessage): MessageShape> { return message; } - expect(f).toBeDefined(); + assert.ok(f !== undefined); }); test("json type defaults to JsonValue", () => { function f( @@ -72,14 +73,14 @@ describe("GenMessage", () => { messageJson = jsonValue; return [jsonValue, messageJson]; } - expect(f).toBeDefined(); + assert.ok(f !== undefined); }); test("json type parameter", () => { type FakeMessageJson = "fake-json"; function f(): MessageJsonType> { return "fake-json"; } - expect(f).toBeDefined(); + assert.ok(f !== undefined); }); test("has typed field names", () => { function f(genMessage: GenMessage): DescField { @@ -87,11 +88,11 @@ describe("GenMessage", () => { genMessage.field.bar; return genMessage.field.foo; } - expect(f).toBeDefined(); + assert.ok(f !== undefined); }); }); -describe("GenEnum", () => { +void suite("GenEnum", () => { enum FakeEnum { FOO = 0, BAR = 1, @@ -100,13 +101,13 @@ describe("GenEnum", () => { function f(genEnum: GenEnum): DescEnum { return genEnum; } - expect(f).toBeDefined(); + assert.ok(f !== undefined); }); test("single type parameter is enum shape", () => { function f(fakeEnum: FakeEnum): EnumShape> { return fakeEnum; } - expect(f).toBeDefined(); + assert.ok(f !== undefined); }); test("json type defaults to JsonValue", () => { function f( @@ -117,25 +118,25 @@ describe("GenEnum", () => { enumJson = jsonValue; return [jsonValue, enumJson]; } - expect(f).toBeDefined(); + assert.ok(f !== undefined); }); test("json type parameter", async () => { type FakeEnumJson = "fake-json"; function f(): EnumJsonType> { return "fake-json"; } - expect(f).toBeDefined(); + assert.ok(f !== undefined); }); }); -describe("GenExtension", () => { +void suite("GenExtension", () => { type FakeExtendee = Message<"fake-extendee"> & { foo: boolean }; type FakeExtensionVal = "fake-ext-val"; test("is DescExtension", () => { function f(genExt: GenExtension): DescExtension { return genExt; } - expect(f).toBeDefined(); + assert.ok(f !== undefined); }); test("without type parameters", () => { function f( @@ -150,14 +151,14 @@ describe("GenExtension", () => { extensionValueShape = unknownValue; return [extendee, extensionValueShape]; } - expect(f).toBeDefined(); + assert.ok(f !== undefined); }); test("single type parameter is extendee", () => { function f(extendee: Extendee>): FakeExtendee { return extendee; } - expect(f).toBeDefined(); + assert.ok(f !== undefined); }); test("second type parameter is extension value", () => { function f( @@ -166,11 +167,11 @@ describe("GenExtension", () => { ): [FakeExtendee, "fake-ext-val"] { return [extendee, val]; } - expect(f).toBeDefined(); + assert.ok(f !== undefined); }); }); -describe("GenService", () => { +void suite("GenService", () => { type FakeGenServiceMethods = { foo: DescMethod; }; @@ -178,7 +179,7 @@ describe("GenService", () => { function f(genService: GenService): DescService { return genService; } - expect(f).toBeDefined(); + assert.ok(f !== undefined); }); test("has typed method names", () => { function f(genService: GenService): DescMethod { @@ -186,6 +187,6 @@ describe("GenService", () => { genService.method.bar; return genService.method.foo; } - expect(f).toBeDefined(); + assert.ok(f !== undefined); }); }); diff --git a/packages/protobuf-test/src/codegenv2/boot.test.ts b/packages/protobuf-test/src/codegenv2/boot.test.ts index 968af17d6..74bc90a0d 100644 --- a/packages/protobuf-test/src/codegenv2/boot.test.ts +++ b/packages/protobuf-test/src/codegenv2/boot.test.ts @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import type { CompileToDescriptorSetOptions } from "upstream-protobuf"; import { UpstreamProtobuf } from "upstream-protobuf"; import { join as joinPath } from "node:path"; @@ -29,7 +30,6 @@ import { FieldOptionsSchema, EnumDescriptorProtoSchema, } from "@bufbuild/protobuf/wkt"; -import assert from "node:assert"; import { boot, bootFileDescriptorProto, @@ -37,18 +37,18 @@ import { embedFileDesc, } from "@bufbuild/protobuf/codegenv2"; -describe("boot()", () => { +void suite("boot()", () => { test("hydrates google/protobuf/descriptor.proto", async () => { const fileDescriptorProto = await compileGoogleProtobufDescriptorProto(); const embedded = embedFileDesc(fileDescriptorProto); - assert(embedded.bootable); + assert.ok(embedded.bootable); const bootedFileDesc = boot(embedded.boot()); - expect(bootedFileDesc).toBeDefined(); + assert.ok(bootedFileDesc !== undefined); }); }); -describe("createFileDescriptorProtoBoot()", () => { +void suite("createFileDescriptorProtoBoot()", () => { test("only accepts google/protobuf/descriptor.proto", async () => { const upstreamProtobuf = new UpstreamProtobuf(); const bytes = await upstreamProtobuf.compileToDescriptorSet( @@ -62,20 +62,20 @@ describe("createFileDescriptorProtoBoot()", () => { ); const fileDescriptorProto = fromBinary(FileDescriptorSetSchema, bytes) .file[0]; - expect(() => createFileDescriptorProtoBoot(fileDescriptorProto)).toThrow(); + assert.throws(() => createFileDescriptorProtoBoot(fileDescriptorProto)); }); test("requires unset source_code_info", async () => { const fileDescriptorProto = await compileGoogleProtobufDescriptorProto({ includeSourceInfo: true, }); - expect(() => createFileDescriptorProtoBoot(fileDescriptorProto)).toThrow(); + assert.throws(() => createFileDescriptorProtoBoot(fileDescriptorProto)); }); }); -describe("bootFileDescriptorProto()", () => { +void suite("bootFileDescriptorProto()", () => { test("keeps all important bits of google/protobuf/descriptor.proto", async () => { const compiled = await compileGoogleProtobufDescriptorProto(); - expect(compiled).toBeDefined(); + assert.ok(compiled !== undefined); const booted = bootFileDescriptorProto( createFileDescriptorProtoBoot(compiled), @@ -83,11 +83,11 @@ describe("bootFileDescriptorProto()", () => { stripLikeBoot(compiled); const eq = equals(FileDescriptorProtoSchema, compiled, booted); - expect(eq).toBe(true); + assert.strictEqual(eq, true); const compiledBytes = toBinary(FileDescriptorProtoSchema, compiled); const bootedBytes = toBinary(FileDescriptorProtoSchema, booted); - expect(bootedBytes).toStrictEqual(compiledBytes); + assert.deepStrictEqual(bootedBytes, compiledBytes); }); function stripLikeBoot( d: FileDescriptorProto | DescriptorProto | EnumDescriptorProto, @@ -138,8 +138,8 @@ async function compileGoogleProtobufDescriptorProto( opt, ); const fds = fromBinary(FileDescriptorSetSchema, fdsBytes); - assert(fds.file.length == 1); + assert.equal(fds.file.length, 1); const file = fds.file[0]; - assert(file.name == path); + assert.equal(file.name, path); return file; } diff --git a/packages/protobuf-test/src/codegenv2/embed.test.ts b/packages/protobuf-test/src/codegenv2/embed.test.ts index 32aa922ba..16b955e87 100644 --- a/packages/protobuf-test/src/codegenv2/embed.test.ts +++ b/packages/protobuf-test/src/codegenv2/embed.test.ts @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { compileFile, compileFileDescriptorSet } from "../helpers.js"; import { embedFileDesc } from "@bufbuild/protobuf/codegenv2"; -import assert from "node:assert"; import { createFileRegistry } from "@bufbuild/protobuf"; -describe("embedFileDesc()", () => { +void suite("embedFileDesc()", () => { test("embeds file descriptor", async () => { const file = await compileFile(` syntax="proto3"; @@ -27,8 +27,8 @@ describe("embedFileDesc()", () => { } `); const embedded = embedFileDesc(file.proto); - expect(embedded.bootable).toBe(false); - expect(typeof embedded.base64()).toBe("string"); + assert.strictEqual(embedded.bootable, false); + assert.strictEqual(typeof embedded.base64(), "string"); }); test("embeds google/protobuf.descriptor.proto", async () => { const file = createFileRegistry( @@ -39,15 +39,15 @@ describe("embedFileDesc()", () => { `, }), ).getFile("google/protobuf/descriptor.proto"); - assert(file); + assert.ok(file !== undefined); const embedded = embedFileDesc(file.proto); - expect(embedded).toBeDefined(); - expect(embedded.bootable).toBe(true); + assert.ok(embedded !== undefined); + assert.strictEqual(embedded.bootable, true); if (embedded.bootable) { const b = embedded.boot(); - expect(b).toBeDefined(); + assert.ok(b !== undefined); } - expect(typeof embedded.base64()).toBe("string"); + assert.strictEqual(typeof embedded.base64(), "string"); }); }); diff --git a/packages/protobuf-test/src/codegenv2/enum.test.ts b/packages/protobuf-test/src/codegenv2/enum.test.ts index b138f3401..818a22bde 100644 --- a/packages/protobuf-test/src/codegenv2/enum.test.ts +++ b/packages/protobuf-test/src/codegenv2/enum.test.ts @@ -12,11 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { compileEnum, compileFile } from "../helpers.js"; import { enumDesc, tsEnum } from "@bufbuild/protobuf/codegenv2"; -describe("enumDesc()", () => { +void suite("enumDesc()", () => { test("resolves enum", async () => { const descFile = await compileFile(` syntax="proto3"; @@ -26,11 +27,11 @@ describe("enumDesc()", () => { } `); const descEnum = enumDesc(descFile, 0); - expect(descEnum.name).toBe("E"); + assert.strictEqual(descEnum.name, "E"); }); }); -describe("tsEnum()", () => { +void suite("tsEnum()", () => { test("creates TS enum", async () => { const descEnum = await compileEnum(` syntax="proto3"; @@ -40,11 +41,11 @@ describe("tsEnum()", () => { } `); const e = tsEnum(descEnum); - expect(e[0]).toBe("A"); - expect(e[1]).toBe("B"); - expect(e.A).toBe(0); - expect(e.B).toBe(1); - expect(e).toStrictEqual({ + assert.strictEqual(e[0], "A"); + assert.strictEqual(e[1], "B"); + assert.strictEqual(e.A, 0); + assert.strictEqual(e.B, 1); + assert.deepStrictEqual(e, { 0: "A", 1: "B", A: 0, @@ -60,7 +61,7 @@ describe("tsEnum()", () => { } `); const e = tsEnum(descEnum); - expect(e).toStrictEqual({ + assert.deepStrictEqual(e, { 0: "ZERO", 1: "ONE", ZERO: 0, @@ -78,7 +79,7 @@ describe("tsEnum()", () => { } `); const e = tsEnum(descEnum); - expect(e).toStrictEqual({ + assert.deepStrictEqual(e, { 0: "constructor$", 1: "toString$", 2: "toJSON$", @@ -100,7 +101,7 @@ describe("tsEnum()", () => { } `); const e = tsEnum(descEnum); - expect(e).toStrictEqual({ + assert.deepStrictEqual(e, { 0: "constructor$", 1: "toString$", 2: "toJSON$", diff --git a/packages/protobuf-test/src/codegenv2/extension.test.ts b/packages/protobuf-test/src/codegenv2/extension.test.ts index c45bb6355..f70c5da83 100644 --- a/packages/protobuf-test/src/codegenv2/extension.test.ts +++ b/packages/protobuf-test/src/codegenv2/extension.test.ts @@ -12,11 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { compileFile } from "../helpers.js"; import { extDesc } from "@bufbuild/protobuf/codegenv2"; -describe("extDesc()", () => { +void suite("extDesc()", () => { test("resolves extension", async () => { const descFile = await compileFile(` syntax="proto3"; @@ -26,6 +27,6 @@ describe("extDesc()", () => { } `); const descExtension = extDesc(descFile, 0); - expect(descExtension.typeName).toBe("http"); + assert.strictEqual(descExtension.typeName, "http"); }); }); diff --git a/packages/protobuf-test/src/codegenv2/file.test.ts b/packages/protobuf-test/src/codegenv2/file.test.ts index 610fdd683..cd886b0f6 100644 --- a/packages/protobuf-test/src/codegenv2/file.test.ts +++ b/packages/protobuf-test/src/codegenv2/file.test.ts @@ -12,11 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { compileMessage } from "../helpers.js"; import { embedFileDesc, fileDesc } from "@bufbuild/protobuf/codegenv2"; -describe("fileDesc()", () => { +void suite("fileDesc()", () => { test("hydrates default jsonName and proto.jsonName", async () => { const { file } = await compileMessage(` syntax="proto3"; @@ -26,8 +27,8 @@ describe("fileDesc()", () => { `); const hydrated = fileDesc(embedFileDesc(file.proto).base64()); const field = hydrated.messages[0].fields[0]; - expect(field.jsonName).toBe("int32Field"); - expect(field.proto.jsonName).toBe("int32Field"); + assert.strictEqual(field.jsonName, "int32Field"); + assert.strictEqual(field.proto.jsonName, "int32Field"); }); test("hydrates custom jsonName and proto.jsonName", async () => { @@ -39,7 +40,7 @@ describe("fileDesc()", () => { `); const hydrated = fileDesc(embedFileDesc(file.proto).base64()); const field = hydrated.messages[0].fields[0]; - expect(field.jsonName).toBe("foo"); - expect(field.proto.jsonName).toBe("foo"); + assert.strictEqual(field.jsonName, "foo"); + assert.strictEqual(field.proto.jsonName, "foo"); }); }); diff --git a/packages/protobuf-test/src/codegenv2/message.test.ts b/packages/protobuf-test/src/codegenv2/message.test.ts index eb3506ce8..b22e118d8 100644 --- a/packages/protobuf-test/src/codegenv2/message.test.ts +++ b/packages/protobuf-test/src/codegenv2/message.test.ts @@ -12,11 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { compileFile } from "../helpers.js"; import { messageDesc } from "@bufbuild/protobuf/codegenv2"; -describe("messageDesc()", () => { +void suite("messageDesc()", () => { test("resolves message", async () => { const descFile = await compileFile(` syntax="proto3"; @@ -25,6 +26,6 @@ describe("messageDesc()", () => { } `); const descMessage = messageDesc(descFile, 0); - expect(descMessage.typeName).toBe("M"); + assert.strictEqual(descMessage.typeName, "M"); }); }); diff --git a/packages/protobuf-test/src/codegenv2/service.test.ts b/packages/protobuf-test/src/codegenv2/service.test.ts index c29e8350e..65863bee3 100644 --- a/packages/protobuf-test/src/codegenv2/service.test.ts +++ b/packages/protobuf-test/src/codegenv2/service.test.ts @@ -12,11 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { compileFile } from "../helpers.js"; import { serviceDesc } from "@bufbuild/protobuf/codegenv2"; -describe("serviceDesc()", () => { +void suite("serviceDesc()", () => { test("resolves service", async () => { const descFile = await compileFile(` syntax="proto3"; @@ -26,6 +27,6 @@ describe("serviceDesc()", () => { message E {} `); const descService = serviceDesc(descFile, 0); - expect(descService.typeName).toBe("Foo"); + assert.strictEqual(descService.typeName, "Foo"); }); }); diff --git a/packages/protobuf-test/src/codegenv2/types.test.ts b/packages/protobuf-test/src/codegenv2/types.test.ts index f2027803c..6f9d2f2be 100644 --- a/packages/protobuf-test/src/codegenv2/types.test.ts +++ b/packages/protobuf-test/src/codegenv2/types.test.ts @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import type { DescField, DescFile, @@ -39,30 +40,30 @@ import type { GenService, } from "@bufbuild/protobuf/codegenv2"; -describe("GenFile", () => { +void suite("GenFile", () => { test("is DescFile", async () => { function f(genFile: GenFile, descFile: DescFile) { genFile = descFile; descFile = genFile; return descFile; } - expect(f).toBeDefined(); + assert.ok(f !== undefined); }); }); -describe("GenMessage", () => { +void suite("GenMessage", () => { type FakeMessage = Message<"fake"> & { foo: boolean }; test("is DescMessage", () => { function f(genMessage: GenMessage): DescMessage { return genMessage; } - expect(f).toBeDefined(); + assert.ok(f !== undefined); }); test("single type parameter is message shape", () => { function f(message: FakeMessage): MessageShape> { return message; } - expect(f).toBeDefined(); + assert.ok(f !== undefined); }); test("json type defaults to JsonValue", () => { function f( @@ -73,7 +74,7 @@ describe("GenMessage", () => { messageJson = jsonValue; return [jsonValue, messageJson]; } - expect(f).toBeDefined(); + assert.ok(f !== undefined); }); test("json type parameter", () => { type FakeMessageJson = "fake-json"; @@ -82,7 +83,7 @@ describe("GenMessage", () => { > { return "fake-json"; } - expect(f).toBeDefined(); + assert.ok(f !== undefined); }); test("valid type defaults to message shape", () => { function f( @@ -98,7 +99,7 @@ describe("GenMessage", () => { messageValidWithJson = message; return [message, messageValid, messageValidWithJson]; } - expect(f).toBeDefined(); + assert.ok(f !== undefined); }); test("valid type parameter", () => { type FakeMessageValid = Message<"fake-valid"> & { @@ -133,7 +134,7 @@ describe("GenMessage", () => { fakeMessageValid, ]; } - expect(f).toBeDefined(); + assert.ok(f !== undefined); }); test("has typed field names", () => { function f(genMessage: GenMessage): DescField { @@ -141,11 +142,11 @@ describe("GenMessage", () => { genMessage.field.bar; return genMessage.field.foo; } - expect(f).toBeDefined(); + assert.ok(f !== undefined); }); }); -describe("GenEnum", () => { +void suite("GenEnum", () => { enum FakeEnum { FOO = 0, BAR = 1, @@ -154,13 +155,13 @@ describe("GenEnum", () => { function f(genEnum: GenEnum): DescEnum { return genEnum; } - expect(f).toBeDefined(); + assert.ok(f !== undefined); }); test("single type parameter is enum shape", () => { function f(fakeEnum: FakeEnum): EnumShape> { return fakeEnum; } - expect(f).toBeDefined(); + assert.ok(f !== undefined); }); test("json type defaults to JsonValue", () => { function f( @@ -171,25 +172,25 @@ describe("GenEnum", () => { enumJson = jsonValue; return [jsonValue, enumJson]; } - expect(f).toBeDefined(); + assert.ok(f !== undefined); }); test("json type parameter", async () => { type FakeEnumJson = "fake-json"; function f(): EnumJsonType> { return "fake-json"; } - expect(f).toBeDefined(); + assert.ok(f !== undefined); }); }); -describe("GenExtension", () => { +void suite("GenExtension", () => { type FakeExtendee = Message<"fake-extendee"> & { foo: boolean }; type FakeExtensionVal = "fake-ext-val"; test("is DescExtension", () => { function f(genExt: GenExtension): DescExtension { return genExt; } - expect(f).toBeDefined(); + assert.ok(f !== undefined); }); test("without type parameters", () => { function f( @@ -204,14 +205,14 @@ describe("GenExtension", () => { extensionValueShape = unknownValue; return [extendee, extensionValueShape]; } - expect(f).toBeDefined(); + assert.ok(f !== undefined); }); test("single type parameter is extendee", () => { function f(extendee: Extendee>): FakeExtendee { return extendee; } - expect(f).toBeDefined(); + assert.ok(f !== undefined); }); test("second type parameter is extension value", () => { function f( @@ -220,11 +221,11 @@ describe("GenExtension", () => { ): [FakeExtendee, "fake-ext-val"] { return [extendee, val]; } - expect(f).toBeDefined(); + assert.ok(f !== undefined); }); }); -describe("GenService", () => { +void suite("GenService", () => { type FakeGenServiceMethods = { foo: DescMethod; }; @@ -232,7 +233,7 @@ describe("GenService", () => { function f(genService: GenService): DescService { return genService; } - expect(f).toBeDefined(); + assert.ok(f !== undefined); }); test("has typed method names", () => { function f(genService: GenService): DescMethod { @@ -240,6 +241,6 @@ describe("GenService", () => { genService.method.bar; return genService.method.foo; } - expect(f).toBeDefined(); + assert.ok(f !== undefined); }); }); diff --git a/packages/protobuf-test/src/reflect/error.test.ts b/packages/protobuf-test/src/reflect/error.test.ts index cb58ed9ec..bf80f0aef 100644 --- a/packages/protobuf-test/src/reflect/error.test.ts +++ b/packages/protobuf-test/src/reflect/error.test.ts @@ -12,60 +12,61 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { FieldError, isFieldError } from "@bufbuild/protobuf/reflect"; import { UserSchema } from "../gen/ts/extra/example_pb.js"; import type { DescField, DescOneof } from "@bufbuild/protobuf"; -describe("FieldError", () => { +void suite("FieldError", () => { test("is JSON serializable", () => { const err = new FieldError(UserSchema.fields[0], "foo"); - expect(JSON.stringify(err)).toBeDefined(); + assert.ok(JSON.stringify(err) !== undefined); }); - describe("field()", () => { + void suite("field()", () => { test("returns field", () => { const err = new FieldError(UserSchema.fields[0], "foo"); - expect(err.field()).toBe(UserSchema.fields[0]); + assert.strictEqual(err.field(), UserSchema.fields[0]); }); }); }); -describe("isFieldError()", () => { +void suite("isFieldError()", () => { test("returns true for FieldError instances", () => { - expect(isFieldError(new FieldError(UserSchema.fields[0], "foo"))).toBe( + assert.strictEqual(isFieldError(new FieldError(UserSchema.fields[0], "foo")), true, ); - expect( + assert.strictEqual( isFieldError( new FieldError(UserSchema.fields[0], "foo", "FieldValueInvalidError"), ), - ).toBe(true); - expect( + true); + assert.strictEqual( isFieldError( new FieldError(UserSchema.fields[0], "foo", "FieldListRangeError"), ), - ).toBe(true); - expect( + true); + assert.strictEqual( isFieldError( new FieldError(UserSchema.fields[0], "foo", "ForeignFieldError"), ), - ).toBe(true); + true); }); test("narrows down to FieldError", () => { const u: unknown = null; if (isFieldError(u)) { - expect(u.name).toBeDefined(); - expect(u.message).toBeDefined(); + assert.ok(u.name !== undefined); + assert.ok(u.message !== undefined); const field: DescField | DescOneof = u.field(); - expect(field).toBeDefined(); + assert.ok(field !== undefined); } }); test("returns false for other errors", () => { - expect(isFieldError(null)).toBe(false); - expect(isFieldError(new Error("foo"))).toBe(false); + assert.strictEqual(isFieldError(null), false); + assert.strictEqual(isFieldError(new Error("foo")), false); const err = new Error(); err.name = "FieldValueInvalidError"; - expect(isFieldError(err)).toBe(false); + assert.strictEqual(isFieldError(err), false); }); test("falsely returns true if the argument is close enough to a FieldError", () => { const err = new Error(); @@ -73,6 +74,6 @@ describe("isFieldError()", () => { (err as unknown as Record<"field", () => unknown>).field = () => { // }; - expect(isFieldError(err)).toBe(true); + assert.strictEqual(isFieldError(err), true); }); }); diff --git a/packages/protobuf-test/src/reflect/names.test.ts b/packages/protobuf-test/src/reflect/names.test.ts index 8db4091fd..b7307f1b1 100644 --- a/packages/protobuf-test/src/reflect/names.test.ts +++ b/packages/protobuf-test/src/reflect/names.test.ts @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { beforeAll, describe, expect, test } from "@jest/globals"; +import { suite, test, beforeEach } from "node:test"; +import * as assert from "node:assert"; import { safeObjectProperty, protoCamelCase, @@ -21,9 +22,9 @@ import { import type { DescFile } from "@bufbuild/protobuf"; import { compileField, compileFile } from "../helpers.js"; -describe("qualifiedName", () => { +void suite("qualifiedName", () => { let testFile: DescFile; - beforeAll(async () => { + beforeEach(async () => { testFile = await compileFile(` syntax = "proto3"; // Fully-qualified name //---------------------- @@ -60,63 +61,62 @@ service FooService { // foo.bar.FooService } // `); }); - test("https://protobuf.com/docs/language-spec#fully-qualified-names", () => { + void test("https://protobuf.com/docs/language-spec#fully-qualified-names", () => { const m0 = testFile.messages[0]; - expect(qualifiedName(m0)).toBe("foo.bar.Message"); - expect(qualifiedName(m0.oneofs[0])).toBe("foo.bar.Message.id"); - expect(qualifiedName(m0.fields[0])).toBe("foo.bar.Message.name"); - expect(qualifiedName(m0.fields[1])).toBe("foo.bar.Message.num"); - expect(qualifiedName(m0.nestedMessages[0])).toBe( + assert.strictEqual(qualifiedName(m0), "foo.bar.Message"); + assert.strictEqual(qualifiedName(m0.oneofs[0]), "foo.bar.Message.id"); + assert.strictEqual(qualifiedName(m0.fields[0]), "foo.bar.Message.name"); + assert.strictEqual(qualifiedName(m0.fields[1]), "foo.bar.Message.num"); + assert.strictEqual(qualifiedName(m0.nestedMessages[0]), "foo.bar.Message.NestedMessage", ); - expect(qualifiedName(m0.nestedMessages[0].nestedExtensions[0])).toBe( + assert.strictEqual(qualifiedName(m0.nestedMessages[0].nestedExtensions[0]), "foo.bar.Message.NestedMessage.fizz", ); - expect(qualifiedName(m0.nestedMessages[0].nestedEnums[0])).toBe( + assert.strictEqual(qualifiedName(m0.nestedMessages[0].nestedEnums[0]), "foo.bar.Message.NestedMessage.Kind", ); - expect(qualifiedName(m0.nestedMessages[0].nestedEnums[0].values[0])).toBe( + assert.strictEqual(qualifiedName(m0.nestedMessages[0].nestedEnums[0].values[0]), "foo.bar.Message.NestedMessage.NULL", ); - expect(qualifiedName(m0.nestedMessages[0].nestedEnums[0].values[1])).toBe( + assert.strictEqual(qualifiedName(m0.nestedMessages[0].nestedEnums[0].values[1]), "foo.bar.Message.NestedMessage.PRIMARY", ); - expect(qualifiedName(m0.nestedMessages[0].nestedEnums[0].values[2])).toBe( + assert.strictEqual(qualifiedName(m0.nestedMessages[0].nestedEnums[0].values[2]), "foo.bar.Message.NestedMessage.SECONDARY", ); - expect(qualifiedName(m0.fields[2])).toBe("foo.bar.Message.extra"); + assert.strictEqual(qualifiedName(m0.fields[2]), "foo.bar.Message.extra"); const e0 = testFile.enums[0]; - expect(qualifiedName(e0)).toBe("foo.bar.Unit"); - expect(qualifiedName(e0.values[0])).toBe("foo.bar.VOID"); + assert.strictEqual(qualifiedName(e0), "foo.bar.Unit"); + assert.strictEqual(qualifiedName(e0.values[0]), "foo.bar.VOID"); const s0 = testFile.services[0]; - expect(qualifiedName(s0)).toBe("foo.bar.FooService"); - expect(qualifiedName(s0.methods[0])).toBe("foo.bar.FooService.Bar"); + assert.strictEqual(qualifiedName(s0), "foo.bar.FooService"); + assert.strictEqual(qualifiedName(s0.methods[0]), "foo.bar.FooService.Bar"); }); }); -describe("safeObjectProperty", () => { - test("escapes reserved object property names", () => { - expect(safeObjectProperty("constructor")).toBe("constructor$"); - expect(safeObjectProperty("toString")).toBe("toString$"); - expect(safeObjectProperty("toJSON")).toBe("toJSON$"); - expect(safeObjectProperty("valueOf")).toBe("valueOf$"); +void suite("safeObjectProperty", () => { + void test("escapes reserved object property names", () => { + assert.strictEqual(safeObjectProperty("constructor"), "constructor$"); + assert.strictEqual(safeObjectProperty("toString"), "toString$"); + assert.strictEqual(safeObjectProperty("toJSON"), "toJSON$"); + assert.strictEqual(safeObjectProperty("valueOf"), "valueOf$"); }); - test("does not modify other inputs which are not reserved object properties", () => { - expect(safeObjectProperty("break")).toBe("break"); - expect(safeObjectProperty("case")).toBe("case"); - expect(safeObjectProperty("catch")).toBe("catch"); - expect(safeObjectProperty("class")).toBe("class"); - expect(safeObjectProperty("const")).toBe("const"); - expect(safeObjectProperty("continue")).toBe("continue"); - expect(safeObjectProperty("debugger")).toBe("debugger"); - expect(safeObjectProperty("default")).toBe("default"); - expect(safeObjectProperty("delete")).toBe("delete"); + void test("does not modify other inputs which are not reserved object properties", () => { + assert.strictEqual(safeObjectProperty("break"), "break"); + assert.strictEqual(safeObjectProperty("case"), "case"); + assert.strictEqual(safeObjectProperty("catch"), "catch"); + assert.strictEqual(safeObjectProperty("class"), "class"); + assert.strictEqual(safeObjectProperty("const"), "const"); + assert.strictEqual(safeObjectProperty("continue"), "continue"); + assert.strictEqual(safeObjectProperty("debugger"), "debugger"); + assert.strictEqual(safeObjectProperty("default"), "default"); + assert.strictEqual(safeObjectProperty("delete"), "delete"); }); }); -describe("protoCamelCase", () => { - test.each([ - "foo_bar", +void suite("protoCamelCase", () => { + for (const name of [ "foo_bar", "__proto__", "fieldname1", "field_name2", @@ -136,14 +136,16 @@ describe("protoCamelCase", () => { "field__Name16", "field_name17__", "Field_name18__", - ])("returns same name as protoc for %s", async (name) => { - const field = await compileField(` + ]) { + void test(`returns same name as protoc for ${name}`, async () => { + const field = await compileField(` syntax="proto3"; message M { int32 ${name} = 1; } `); - const protocJsonName = field.proto.jsonName; - expect(protoCamelCase(name)).toBe(protocJsonName); - }); + const protocJsonName = field.proto.jsonName; + assert.strictEqual(protoCamelCase(name), protocJsonName); + }); + } }); diff --git a/packages/protobuf-test/src/reflect/nested-types.test.ts b/packages/protobuf-test/src/reflect/nested-types.test.ts index e35dce491..0b1791fd7 100644 --- a/packages/protobuf-test/src/reflect/nested-types.test.ts +++ b/packages/protobuf-test/src/reflect/nested-types.test.ts @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { compileFile, compileMessage, compileMethod } from "../helpers.js"; import { nestedTypes, @@ -20,7 +21,7 @@ import { parentTypes, } from "@bufbuild/protobuf/reflect"; -describe("nestedTypes()", () => { +void suite("nestedTypes()", () => { test("lists nested types", async () => { const file = await compileFile(` syntax="proto2"; @@ -47,7 +48,7 @@ describe("nestedTypes()", () => { } `); const nested = Array.from(nestedTypes(file)); - expect(nested.map((d) => d.toString())).toStrictEqual([ + assert.deepStrictEqual(nested.map((d) => d.toString()), [ "message A", "message A.B", "enum A.E", @@ -59,7 +60,7 @@ describe("nestedTypes()", () => { }); }); -describe("usedTypes()", () => { +void suite("usedTypes()", () => { test("example", async () => { const file = await compileFile(` syntax="proto3"; @@ -74,7 +75,7 @@ describe("usedTypes()", () => { `); const message = file.messages[0]; const used = Array.from(usedTypes(message)).map((desc) => desc.toString()); - expect(used).toStrictEqual(["message Msg", "enum Level"]); + assert.deepStrictEqual(used, ["message Msg", "enum Level"]); }); test("supports message singular, list, map", async () => { const file = await compileFile(` @@ -90,7 +91,7 @@ describe("usedTypes()", () => { `); const message = file.messages[0]; const used = Array.from(usedTypes(message)).map((desc) => desc.toString()); - expect(used).toStrictEqual([ + assert.deepStrictEqual(used, [ "message Singular", "message List", "message Map", @@ -116,7 +117,7 @@ describe("usedTypes()", () => { `); const message = file.messages[0]; const used = Array.from(usedTypes(message)).map((desc) => desc.toString()); - expect(used).toStrictEqual(["enum Singular", "enum List", "enum Map"]); + assert.deepStrictEqual(used, ["enum Singular", "enum List", "enum Map"]); }); test("supports singular, list, map", async () => { const file = await compileFile(` @@ -132,7 +133,7 @@ describe("usedTypes()", () => { `); const message = file.messages[0]; const used = Array.from(usedTypes(message)).map((desc) => desc.toString()); - expect(used).toStrictEqual([ + assert.deepStrictEqual(used, [ "message MsgSingular", "message MsgList", "message MsgMap", @@ -149,7 +150,7 @@ describe("usedTypes()", () => { `); const message = file.messages[0]; const used = Array.from(usedTypes(message)).map((desc) => desc.toString()); - expect(used).toStrictEqual(["message Msg"]); + assert.deepStrictEqual(used, ["message Msg"]); }); test("recurses into messages", async () => { const file = await compileFile(` @@ -169,7 +170,7 @@ describe("usedTypes()", () => { `); const message = file.messages[0]; const used = Array.from(usedTypes(message)).map((desc) => desc.toString()); - expect(used).toStrictEqual(["message A", "message B", "enum C"]); + assert.deepStrictEqual(used, ["message A", "message B", "enum C"]); }); test("yields itself", async () => { const file = await compileFile(` @@ -180,11 +181,11 @@ describe("usedTypes()", () => { `); const message = file.messages[0]; const used = Array.from(usedTypes(message)).map((desc) => desc.toString()); - expect(used).toStrictEqual(["message Example"]); + assert.deepStrictEqual(used, ["message Example"]); }); }); -describe("parentTypes()", () => { +void suite("parentTypes()", () => { test("lists parents of field", async () => { const message = await compileMessage(` syntax="proto3"; @@ -196,7 +197,7 @@ describe("parentTypes()", () => { `); const field = message.nestedMessages[0].fields[0]; const parents = parentTypes(field).map((desc) => desc.toString()); - expect(parents).toStrictEqual([ + assert.deepStrictEqual(parents, [ "message A.B", "message A", "file input.proto", @@ -213,7 +214,7 @@ describe("parentTypes()", () => { `); const enumValue = message.nestedEnums[0].values[0]; const parents = parentTypes(enumValue).map((desc) => desc.toString()); - expect(parents).toStrictEqual([ + assert.deepStrictEqual(parents, [ "enum A.B", "message A", "file input.proto", @@ -228,7 +229,7 @@ describe("parentTypes()", () => { message M {} `); const parents = parentTypes(method).map((desc) => desc.toString()); - expect(parents).toStrictEqual(["service A", "file input.proto"]); + assert.deepStrictEqual(parents, ["service A", "file input.proto"]); }); test("lists parents of extension", async () => { const message = await compileMessage(` @@ -246,7 +247,7 @@ describe("parentTypes()", () => { `); const ext = message.nestedMessages[0].nestedExtensions[0]; const parents = parentTypes(ext).map((desc) => desc.toString()); - expect(parents).toStrictEqual([ + assert.deepStrictEqual(parents, [ "message A.B", "message A", "file input.proto", diff --git a/packages/protobuf-test/src/reflect/path.test.ts b/packages/protobuf-test/src/reflect/path.test.ts index b142cb580..b5126eb5b 100644 --- a/packages/protobuf-test/src/reflect/path.test.ts +++ b/packages/protobuf-test/src/reflect/path.test.ts @@ -12,23 +12,23 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { createRegistry } from "@bufbuild/protobuf"; import { buildPath, parsePath, pathToString } from "@bufbuild/protobuf/reflect"; -import assert from "node:assert/strict"; import { compileExtension, compileMessage } from "../helpers.js"; import { assertPathsEqual, getTestDataForPaths } from "./path.testdata.js"; const { cases, invalid, schema } = await getTestDataForPaths(); -describe("buildPath()", () => { +void suite("buildPath()", () => { test("returns PathBuilder", () => { const builder = buildPath(schema); - expect(builder.schema).toBe(schema); + assert.strictEqual(builder.schema, schema); }); }); -describe("parsePath()", () => { +void suite("parsePath()", () => { for (const { schema, string, golden, usesExtension } of cases) { test(`parses "${string}"`, () => { const registry = usesExtension @@ -40,28 +40,30 @@ describe("parsePath()", () => { } for (const { schema, input, error } of invalid) { test(`fails to parse invalid "${input}"`, () => { - expect(() => parsePath(schema, input)).toThrow({ - name: "InvalidXPathError", - message: error, - path: input, - }); + assert.throws(() => parsePath(schema, input), + { + name: "InvalidPathError", + message: error, + path: input, + }, + ); }); } }); -describe("pathToString()", () => { +void suite("pathToString()", () => { for (const { string, golden, goldenString } of cases) { test(string, () => { - expect(pathToString(golden)).toBe(goldenString); + assert.strictEqual(pathToString(golden), goldenString); }); } }); -describe("PathBuilder", () => { - describe("toPath()", () => { +void suite("PathBuilder", () => { + void suite("toPath()", () => { test("returns empty path", () => { const path = buildPath(schema).toPath(); - assert.equal(path.length, 0); + assert.strictEqual(path.length, 0); }); test("returns path", () => { const path = buildPath(schema).add(cases[0].golden).toPath(); @@ -74,7 +76,7 @@ describe("PathBuilder", () => { assert.notStrictEqual(a, b); }); }); - describe("clone()", () => { + void suite("clone()", () => { test("returns copy", () => { const builder = buildPath(schema); const clone = builder.clone(); @@ -83,7 +85,7 @@ describe("PathBuilder", () => { test("copies path", () => { const builder = buildPath(schema); const clone = builder.clone().add(cases[0].golden); - assert.notEqual(clone.toPath().length, builder.toPath().length); + assert.notStrictEqual(clone.toPath().length, builder.toPath().length); }); test("clones", () => { const builder = buildPath(schema).add(cases[0].golden); @@ -110,7 +112,7 @@ describe("PathBuilder", () => { assert.throws(() => builder.add([schema.field.manager, { kind: "list_sub", index: 0 }]), ); - assert.equal(builder.toPath().length, 0); + assert.strictEqual(builder.toPath().length, 0); }); for (const { string, schema, golden } of cases) { test(`build "${string}" via api`, () => { @@ -139,7 +141,7 @@ describe("PathBuilder", () => { }); } - describe("build errors", () => { + void suite("build errors", () => { test("field() on non-message", () => { const builder = buildPath(schema).field(schema.field.firstName); assert.throws(() => builder.field(schema.field.firstName), { diff --git a/packages/protobuf-test/src/reflect/reflect-list.test.ts b/packages/protobuf-test/src/reflect/reflect-list.test.ts index c7b0dabf2..83a353c5c 100644 --- a/packages/protobuf-test/src/reflect/reflect-list.test.ts +++ b/packages/protobuf-test/src/reflect/reflect-list.test.ts @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { isReflectList, reflectList, @@ -20,29 +21,28 @@ import { isReflectMessage, } from "@bufbuild/protobuf/reflect"; import { create, protoInt64 } from "@bufbuild/protobuf"; -import assert from "node:assert"; import { catchFieldError } from "../helpers.js"; import { StructSchema } from "@bufbuild/protobuf/wkt"; import { UserSchema } from "../gen/ts/extra/example_pb.js"; import * as proto3_ts from "../gen/ts/extra/proto3_pb.js"; -describe("reflectList()", () => { +void suite("reflectList()", () => { test("creates ReflectList", () => { const f = proto3_ts.Proto3MessageSchema.field.repeatedStringField; - assert(f.fieldKind == "list"); + assert.strictEqual(f.fieldKind, "list"); const list = reflectList(f); - expect(typeof list.field).toBe("function"); - expect(isReflectList(list)).toBe(true); + assert.strictEqual(typeof list.field, "function"); + assert.strictEqual(isReflectList(list), true); }); test("creates ReflectList with unsafe input", () => { const f = proto3_ts.Proto3MessageSchema.field.repeatedStringField; - assert(f.fieldKind == "list"); + assert.strictEqual(f.fieldKind, "list"); const list = reflectList(f, [1, 2, 3]); - expect(isReflectList(list)).toBe(true); + assert.strictEqual(isReflectList(list), true); }); }); -describe("ReflectList", () => { +void suite("ReflectList", () => { const { repeatedStringField, repeatedInt64Field, @@ -50,63 +50,63 @@ describe("ReflectList", () => { repeatedMessageField, repeatedStructField, } = proto3_ts.Proto3MessageSchema.field; - assert(repeatedStringField.fieldKind == "list"); - assert(repeatedInt64Field.fieldKind == "list"); - assert(repeatedInt64JsStringField.fieldKind == "list"); - assert(repeatedMessageField.fieldKind == "list"); - assert(repeatedStructField.fieldKind == "list"); + assert.strictEqual(repeatedStringField.fieldKind, "list"); + assert.strictEqual(repeatedInt64Field.fieldKind, "list"); + assert.strictEqual(repeatedInt64JsStringField.fieldKind, "list"); + assert.strictEqual(repeatedMessageField.fieldKind, "list"); + assert.strictEqual(repeatedStructField.fieldKind, "list"); const n0 = protoInt64.zero; const n1 = protoInt64.parse(1); const n2 = protoInt64.parse(2); const n3 = protoInt64.parse(3); - describe("field()", () => { + void suite("field()", () => { test("returns the field", () => { const list = reflectList(repeatedStringField, []); - expect(list.field()).toBe(repeatedStringField); + assert.strictEqual(list.field(), repeatedStringField); }); }); - describe("size", () => { + void suite("size", () => { test("returns size of the list", () => { const a = reflectList(repeatedStringField, []); - expect(a.size).toBe(0); + assert.strictEqual(a.size, 0); const b = reflectList(repeatedStringField, ["a", "b"]); - expect(b.size).toBe(2); + assert.strictEqual(b.size, 2); }); }); - describe("get()", () => { + void suite("get()", () => { test("returns item at index", () => { const list = reflectList(repeatedStringField, ["a", "b"]); - expect(list.get(1)).toBe("b"); + assert.strictEqual(list.get(1), "b"); }); test("returns undefined if out of range", () => { const list = reflectList(repeatedStringField, []); - expect(list.get(0)).toBeUndefined(); + assert.strictEqual(list.get(0), undefined); }); test("converts jstype=JS_STRING to bigint", () => { const local: unknown[] = ["1"]; const list = reflectList(repeatedInt64JsStringField, local); - expect(list.get(0)).toBe(n1); + assert.strictEqual(list.get(0), n1); }); test("returns ReflectMessage for message list", () => { const list = reflectList(repeatedMessageField, [ create(proto3_ts.Proto3MessageSchema), ]); const val = list.get(0); - expect(isReflectMessage(val)).toBe(true); + assert.strictEqual(isReflectMessage(val), true); }); test("returns ReflectMessage for google.protobuf.Struct list", () => { const list = reflectList(repeatedStructField, [{ shouldBeJson: true }]); const val = list.get(0); - expect(isReflectMessage(val)).toBe(true); + assert.strictEqual(isReflectMessage(val), true); }); }); - describe("add()", () => { + void suite("add()", () => { test("adds item", () => { const local: unknown[] = ["a"]; const list = reflectList(repeatedStringField, local); list.add("b"); list.add("c"); - expect(local).toStrictEqual(["a", "b", "c"]); + assert.deepStrictEqual(local, ["a", "b", "c"]); }); test("converts number, string, bigint to bigint for 64-bit integer field", () => { const local: unknown[] = []; @@ -114,7 +114,7 @@ describe("ReflectList", () => { list.add(1); list.add("2"); list.add(n3); - expect(local).toStrictEqual([n1, n2, n3]); + assert.deepStrictEqual(local, [n1, n2, n3]); }); test("converts number, string, bigint to string for 64-bit integer field with jstype=JS_STRING", () => { const local: unknown[] = []; @@ -122,33 +122,33 @@ describe("ReflectList", () => { list.add(1); list.add("2"); list.add(n3); - expect(local).toStrictEqual(["1", "2", "3"]); + assert.deepStrictEqual(local, ["1", "2", "3"]); }); test("adds google.protobuf.Struct as JsonObject", () => { const local: unknown[] = []; const list = reflectList(repeatedStructField, local); list.add(reflect(StructSchema)); - expect(local).toStrictEqual([{}]); + assert.deepStrictEqual(local, [{}]); }); test("throws error for wrong message type", () => { const list = reflectList(repeatedMessageField, []); const err = catchFieldError(() => list.add(reflect(UserSchema))); - expect(err?.message).toMatch( - /^list item #1: expected ReflectMessage \(spec.Proto3Message\), got ReflectMessage \(example.User\)$/, - ); + assert.ok(err !== undefined); + assert.match(err.message, /^list item #1: expected ReflectMessage \(spec.Proto3Message\), got ReflectMessage \(example.User\)$/); }); test("throws error for invalid scalar", () => { const list = reflectList(repeatedStringField, []); const err = catchFieldError(() => list.add(true)); - expect(err?.message).toMatch(/^list item #1: expected string, got true$/); + assert.ok(err !== undefined); + assert.match(err.message, /^list item #1: expected string, got true$/); }); }); - describe("set()", () => { + void suite("set()", () => { test("replaces item at index", () => { const local: unknown[] = ["a", "b"]; const list = reflectList(repeatedStringField, local); list.set(0, "c"); - expect(local).toStrictEqual(["c", "b"]); + assert.deepStrictEqual(local, ["c", "b"]); }); test("converts number, string, bigint to bigint for 64-bit integer field", () => { const local: unknown[] = [n0, n0, n0]; @@ -156,7 +156,7 @@ describe("ReflectList", () => { list.set(0, 1); list.set(1, "2"); list.set(2, n3); - expect(local).toStrictEqual([n1, n2, n3]); + assert.deepStrictEqual(local, [n1, n2, n3]); }); test("converts number, string, bigint to string for 64-bit integer field with jstype=JS_STRING", () => { const local: unknown[] = ["0", "0", "0"]; @@ -164,63 +164,64 @@ describe("ReflectList", () => { list.set(0, 1); list.set(1, "2"); list.set(2, n3); - expect(local).toStrictEqual(["1", "2", "3"]); + assert.deepStrictEqual(local, ["1", "2", "3"]); }); test("throws error if out of range", () => { const list = reflectList(repeatedStringField, []); const err = catchFieldError(() => list.set(0, "abc")); - expect(err?.message).toMatch(/^list item #1: out of range$/); + assert.ok(err !== undefined); + assert.match(err.message, /^list item #1: out of range$/); }); test("throws error for invalid scalar", () => { const list = reflectList(repeatedStringField, [null]); const err = catchFieldError(() => list.set(0, true)); - expect(err?.message).toMatch(/^list item #1: expected string, got true$/); + assert.ok(err !== undefined); + assert.match(err.message, /^list item #1: expected string, got true$/); }); test("throws error for wrong message type", () => { const list = reflectList(repeatedMessageField, [null]); const err = catchFieldError(() => list.set(0, reflect(UserSchema))); - expect(err?.message).toMatch( - /^list item #1: expected ReflectMessage \(spec.Proto3Message\), got ReflectMessage \(example.User\)$/, - ); + assert.ok(err !== undefined); + assert.match(err.message, /^list item #1: expected ReflectMessage \(spec.Proto3Message\), got ReflectMessage \(example.User\)$/); }); }); - describe("clear()", () => { + void suite("clear()", () => { test("removes all items", () => { const local: unknown[] = ["a", "b"]; const list = reflectList(repeatedStringField, local); list.clear(); - expect(local).toStrictEqual([]); + assert.deepStrictEqual(local, []); }); }); - describe("values()", () => { + void suite("values()", () => { test("returns iterable items", () => { const local: unknown[] = ["a", "b"]; const values = reflectList(repeatedStringField, local).values(); - expect(Array.from(values)).toStrictEqual(["a", "b"]); + assert.deepStrictEqual(Array.from(values), ["a", "b"]); }); }); - describe("iterator", () => { + void suite("iterator", () => { test("returns iterable items", () => { const local: unknown[] = ["a", "b"]; const list = reflectList(repeatedStringField, local); - expect(Array.from(list)).toStrictEqual(["a", "b"]); + assert.deepStrictEqual(Array.from(list), ["a", "b"]); }); }); - describe("entries()", () => { + void suite("entries()", () => { test("returns iterable tuples", () => { const local: unknown[] = ["a", "b"]; const entries = reflectList(repeatedStringField, local).entries(); - expect(Array.from(entries)).toStrictEqual([ + assert.deepStrictEqual(Array.from(entries), [ [0, "a"], [1, "b"], ]); }); }); - describe("keys()", () => { + void suite("keys()", () => { test("returns iterable indices", () => { const local: unknown[] = ["a", "b"]; const keys = reflectList(repeatedStringField, local).keys(); - expect(Array.from(keys)).toStrictEqual([0, 1]); + assert.deepStrictEqual(Array.from(keys), [0, 1]); }); }); }); diff --git a/packages/protobuf-test/src/reflect/reflect-map.test.ts b/packages/protobuf-test/src/reflect/reflect-map.test.ts index d3bed3ee9..ce9fea267 100644 --- a/packages/protobuf-test/src/reflect/reflect-map.test.ts +++ b/packages/protobuf-test/src/reflect/reflect-map.test.ts @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { isReflectMap, reflectMap, @@ -20,30 +21,29 @@ import { isReflectMessage, } from "@bufbuild/protobuf/reflect"; import { create, protoInt64 } from "@bufbuild/protobuf"; -import assert from "node:assert"; import { catchFieldError } from "../helpers.js"; import { StructSchema } from "@bufbuild/protobuf/wkt"; import { UserSchema } from "../gen/ts/extra/example_pb.js"; import * as proto3_ts from "../gen/ts/extra/proto3_pb.js"; -describe("reflectMap()", () => { +void suite("reflectMap()", () => { test("creates ReflectMap", () => { const f = proto3_ts.Proto3MessageSchema.field.mapStringStringField; - assert(f.fieldKind == "map"); + assert.strictEqual(f.fieldKind, "map"); const map = reflectMap(f); - expect(typeof map.field).toBe("function"); - expect(isReflectMap(map)).toBe(true); + assert.strictEqual(typeof map.field, "function"); + assert.strictEqual(isReflectMap(map), true); }); test("creates ReflectMap with unsafe input", () => { const f = proto3_ts.Proto3MessageSchema.field.mapStringStringField; - assert(f.fieldKind == "map"); + assert.strictEqual(f.fieldKind, "map"); const map = reflectMap(f, { x: 123 }); - expect(typeof map.field).toBe("function"); - expect(isReflectMap(map)).toBe(true); + assert.strictEqual(typeof map.field, "function"); + assert.strictEqual(isReflectMap(map), true); }); }); -describe("ReflectMap", () => { +void suite("ReflectMap", () => { const { mapStringStringField, mapInt64Int64Field, @@ -51,91 +51,91 @@ describe("ReflectMap", () => { mapInt32MessageField, mapInt32StructField, } = proto3_ts.Proto3MessageSchema.field; - assert(mapStringStringField.fieldKind == "map"); - assert(mapInt64Int64Field.fieldKind == "map"); - assert(mapInt32Int32Field.fieldKind == "map"); - assert(mapInt32MessageField.fieldKind == "map"); - assert(mapInt32StructField.fieldKind == "map"); + assert.strictEqual(mapStringStringField.fieldKind, "map"); + assert.strictEqual(mapInt64Int64Field.fieldKind, "map"); + assert.strictEqual(mapInt32Int32Field.fieldKind, "map"); + assert.strictEqual(mapInt32MessageField.fieldKind, "map"); + assert.strictEqual(mapInt32StructField.fieldKind, "map"); const n1 = protoInt64.parse(1); const n2 = protoInt64.parse(2); const n3 = protoInt64.parse(3); const n11 = protoInt64.parse(11); const n22 = protoInt64.parse(22); const n33 = protoInt64.parse(33); - describe("field()", () => { + void suite("field()", () => { test("returns the field", () => { const map = reflectMap(mapStringStringField, {}); - expect(map.field()).toBe(mapStringStringField); + assert.strictEqual(map.field(), mapStringStringField); }); }); - describe("size", () => { + void suite("size", () => { test("returns size of the map", () => { const a = reflectMap(mapStringStringField, {}); - expect(a.size).toBe(0); + assert.strictEqual(a.size, 0); const b = reflectMap(mapStringStringField, { a: "A", b: "B" }); - expect(b.size).toBe(2); + assert.strictEqual(b.size, 2); }); }); - describe("has()", () => { + void suite("has()", () => { test("returns true for known key, false for unknown", () => { const map = reflectMap(mapStringStringField, { a: "A", b: "B" }); - expect(map.has("a")).toBe(true); - expect(map.has("c")).toBe(false); + assert.strictEqual(map.has("a"), true); + assert.strictEqual(map.has("c"), false); }); test("converts key", () => { const map = reflectMap(mapInt64Int64Field, { "1": n11 }); - expect(map.has(n1)).toBe(true); - expect(map.has("1")).toBe(true); + assert.strictEqual(map.has(n1), true); + assert.strictEqual(map.has("1"), true); }); }); - describe("get()", () => { + void suite("get()", () => { test("returns value for key, or undefined", () => { const map = reflectMap(mapStringStringField, { a: "A", b: "B" }); - expect(map.get("a")).toBe("A"); - expect(map.get("c")).toBeUndefined(); + assert.strictEqual(map.get("a"), "A"); + assert.strictEqual(map.get("c"), undefined); }); test("converts key", () => { const map = reflectMap(mapInt64Int64Field, { "1": n11 }); - expect(map.get(n1)).toBeDefined(); + assert.ok(map.get(n1) !== undefined); }); test("returns ReflectMessage for message map", () => { const map = reflectMap(mapInt32MessageField, { a: create(proto3_ts.Proto3MessageSchema), }); const val = map.get("a"); - expect(isReflectMessage(val)).toBe(true); + assert.strictEqual(isReflectMessage(val), true); }); test("returns ReflectMessage for google.protobuf.Struct map", () => { const map = reflectMap(mapInt32StructField, { 123: { shouldBeJson: true }, }); const val = map.get(123); - expect(isReflectMessage(val)).toBe(true); + assert.strictEqual(isReflectMessage(val), true); }); }); - describe("keys()", () => { + void suite("keys()", () => { test("returns iterable keys", () => { const keys = reflectMap(mapStringStringField, { a: "A", b: "B" }).keys(); - expect(Array.from(keys)).toStrictEqual(["a", "b"]); + assert.deepStrictEqual(Array.from(keys), ["a", "b"]); }); test("converts keys", () => { const keys = reflectMap(mapInt64Int64Field, { "1": n11, "2": n22, }).keys(); - expect(Array.from(keys)).toStrictEqual([n1, n2]); + assert.deepStrictEqual(Array.from(keys), [n1, n2]); }); }); - describe("values()", () => { + void suite("values()", () => { test("returns iterable values", () => { const values = reflectMap(mapStringStringField, { a: "A", b: "B", }).values(); - expect(Array.from(values)).toStrictEqual(["A", "B"]); + assert.deepStrictEqual(Array.from(values), ["A", "B"]); }); }); - describe("entries() and iterator", () => { + void suite("entries() and iterator", () => { const stringMap = reflectMap(mapStringStringField, { a: "A", b: "B" }); const longMap = reflectMap(mapInt64Int64Field, { "1": n11, @@ -146,38 +146,38 @@ describe("ReflectMap", () => { ["a", "A"], ["b", "B"], ]; - expect(Array.from(stringMap)).toStrictEqual(want); - expect(Array.from(stringMap.entries())).toStrictEqual(want); + assert.deepStrictEqual(Array.from(stringMap), want); + assert.deepStrictEqual(Array.from(stringMap.entries()), want); }); test("converts keys", () => { const want = [ [n1, n11], [n2, n22], ]; - expect(Array.from(longMap)).toStrictEqual(want); - expect(Array.from(longMap.entries())).toStrictEqual(want); + assert.deepStrictEqual(Array.from(longMap), want); + assert.deepStrictEqual(Array.from(longMap.entries()), want); }); }); - describe("forEach()", () => { + void suite("forEach()", () => { test("returns iterable entries", () => { const map = reflectMap(mapStringStringField, { a: "A", b: "B" }); const seenValues: unknown[] = []; const seenKeys: unknown[] = []; map.forEach((value, key, map) => { - expect(map).toBe(map); + assert.strictEqual(map, map); seenValues.push(value); seenKeys.push(key); }); - expect(seenKeys).toStrictEqual(["a", "b"]); - expect(seenValues).toStrictEqual(["A", "B"]); + assert.deepStrictEqual(seenKeys, ["a", "b"]); + assert.deepStrictEqual(seenValues, ["A", "B"]); }); }); - describe("set()", () => { + void suite("set()", () => { test("sets entry", () => { const local = {}; const map = reflectMap(mapStringStringField, local); map.set("a", "A"); - expect(local).toStrictEqual({ a: "A" }); + assert.deepStrictEqual(local, { a: "A" }); }); test("converts key", () => { const local = {}; @@ -185,7 +185,7 @@ describe("ReflectMap", () => { map.set(1, n11); map.set(n2, n22); map.set("3", n33); - expect(local).toStrictEqual({ + assert.deepStrictEqual(local, { "1": n11, "2": n22, "3": n33, @@ -197,7 +197,7 @@ describe("ReflectMap", () => { map.set(n1, n11); map.set(n2, n22); map.set(n3, n33); - expect(local).toStrictEqual({ + assert.deepStrictEqual(local, { "1": n11, "2": n22, "3": n33, @@ -207,54 +207,51 @@ describe("ReflectMap", () => { const local = {}; const map = reflectMap(mapInt32StructField, local); map.set(123, reflect(StructSchema)); - expect(local).toStrictEqual({ + assert.deepStrictEqual(local, { 123: {}, }); }); test("throws error for invalid key", () => { const map = reflectMap(mapInt32Int32Field, {}); const err = catchFieldError(() => map.set(true, "A")); - expect(err?.message).toMatch( - /^invalid map key: expected number \(int32\), got true$/, - ); + assert.ok(err !== undefined); + assert.match(err.message, /^invalid map key: expected number \(int32\), got true$/); }); test("throws error for invalid scalar value", () => { const map = reflectMap(mapStringStringField, {}); const err = catchFieldError(() => map.set("a", true)); - expect(err?.message).toMatch( - /^map entry "a": expected string, got true$/, - ); + assert.ok(err !== undefined); + assert.match(err.message, /^map entry "a": expected string, got true$/); }); test("throws error for wrong message type", () => { const map = reflectMap(mapInt32MessageField, {}); const err = catchFieldError(() => map.set(1, reflect(UserSchema))); - expect(err?.message).toMatch( - /^map entry 1: expected ReflectMessage \(spec.Proto3Message\), got ReflectMessage \(example.User\)$/, - ); + assert.ok(err !== undefined); + assert.match(err.message, /^map entry 1: expected ReflectMessage \(spec.Proto3Message\), got ReflectMessage \(example.User\)$/); }); }); - describe("delete()", () => { + void suite("delete()", () => { test("deletes entry", () => { const local = { a: "A", b: "B" }; const map = reflectMap(mapStringStringField, local); - expect(map.delete("a")).toBe(true); - expect(local).toStrictEqual({ b: "B" }); + assert.strictEqual(map.delete("a"), true); + assert.deepStrictEqual(local, { b: "B" }); }); test("returns false for unknown key", () => { const map = reflectMap(mapStringStringField, {}); - expect(map.delete("a")).toBe(false); + assert.strictEqual(map.delete("a"), false); }); test("converts key", () => { const map = reflectMap(mapInt64Int64Field, { "1": n11 }); - expect(map.delete(n1)).toBe(true); + assert.strictEqual(map.delete(n1), true); }); }); - describe("clear()", () => { + void suite("clear()", () => { test("removes all entries", () => { const local = { a: "A", b: "B" }; const map = reflectMap(mapStringStringField, local); map.clear(); - expect(local).toStrictEqual({}); + assert.deepStrictEqual(local, {}); }); }); }); diff --git a/packages/protobuf-test/src/reflect/reflect.test.ts b/packages/protobuf-test/src/reflect/reflect.test.ts index ae9fbe4ff..d12616da3 100644 --- a/packages/protobuf-test/src/reflect/reflect.test.ts +++ b/packages/protobuf-test/src/reflect/reflect.test.ts @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { beforeEach, describe, expect, test } from "@jest/globals"; +import { suite, test, beforeEach } from "node:test"; +import * as assert from "node:assert"; import type { DescMessage, Message } from "@bufbuild/protobuf"; import { create, protoInt64 } from "@bufbuild/protobuf"; import type { ReflectMessage } from "@bufbuild/protobuf/reflect"; @@ -25,36 +26,35 @@ import { reflectMap, } from "@bufbuild/protobuf/reflect"; import { catchFieldError, compileMessage } from "../helpers.js"; -import assert from "node:assert"; import { StructSchema, UInt32ValueSchema } from "@bufbuild/protobuf/wkt"; import * as proto3_ts from "../gen/ts/extra/proto3_pb.js"; import * as example_ts from "../gen/ts/extra/example_pb.js"; -describe("reflect()", () => { +void suite("reflect()", () => { test("accepts generated message shape", () => { const msg = create(proto3_ts.Proto3MessageSchema); const r = reflect(proto3_ts.Proto3MessageSchema, msg); - expect(r).toBeDefined(); + assert.ok(r !== undefined); }); test("accepts anonymous message", () => { const desc: DescMessage = proto3_ts.Proto3MessageSchema; const msg: Message = create(desc); const r = reflect(desc, msg); - expect(r).toBeDefined(); + assert.ok(r !== undefined); }); test("accepts option to disable field check", () => { const msg = create(proto3_ts.Proto3MessageSchema); const r = reflect(proto3_ts.Proto3MessageSchema, msg, false); const field = r.findNumber(3); - expect(field?.name).toBe("singular_int32_field"); + assert.strictEqual(field?.name, "singular_int32_field"); if (field) { r.set(field, "not a int 32"); } }); }); -describe("ReflectMessage", () => { - describe("findNumber()", () => { +void suite("ReflectMessage", () => { + void suite("findNumber()", () => { test("finds field by field number", async () => { const desc = await compileMessage(` syntax="proto3"; @@ -66,12 +66,12 @@ describe("ReflectMessage", () => { `); const r = reflect(desc); const f = r.findNumber(2); - expect(f).toBeDefined(); - expect(f?.name).toBe("f2"); - expect(f?.number).toBe(2); + assert.ok(f !== undefined); + assert.strictEqual(f?.name, "f2"); + assert.strictEqual(f?.number, 2); }); }); - describe("sortedFields", () => { + void suite("sortedFields", () => { test("returns fields sorted by field number ascending", async () => { const desc = await compileMessage(` syntax="proto3"; @@ -83,10 +83,10 @@ describe("ReflectMessage", () => { `); const r = reflect(desc); const sortedNumbers = r.sortedFields.map((f) => f.number); - expect(sortedNumbers).toStrictEqual([1, 2, 3]); + assert.deepStrictEqual(sortedNumbers, [1, 2, 3]); }); }); - describe("oneofCase()", () => { + void suite("oneofCase()", () => { test("returns selected field", () => { const msg = create(proto3_ts.Proto3MessageSchema); msg.either = { @@ -94,10 +94,10 @@ describe("ReflectMessage", () => { value: 123, }; const r = reflect(proto3_ts.Proto3MessageSchema, msg); - expect(r.oneofs[0]).toBeDefined(); + assert.ok(r.oneofs[0] !== undefined); const selectedField = r.oneofCase(r.oneofs[0]); - expect(selectedField).toBeDefined(); - expect(selectedField?.name).toBe("oneof_int32_field"); + assert.ok(selectedField !== undefined); + assert.strictEqual(selectedField?.name, "oneof_int32_field"); }); test("returns undefined for oneof w/o selected field", () => { const msg = create(proto3_ts.Proto3MessageSchema); @@ -105,9 +105,9 @@ describe("ReflectMessage", () => { case: undefined, }; const r = reflect(proto3_ts.Proto3MessageSchema, msg); - expect(r.oneofs[0]).toBeDefined(); + assert.ok(r.oneofs[0] !== undefined); const selectedField = r.oneofCase(r.oneofs[0]); - expect(selectedField).toBeUndefined(); + assert.strictEqual(selectedField, undefined); }); test("throws error on foreign oneof", async () => { const foreignMessage = await compileMessage(` @@ -116,12 +116,12 @@ describe("ReflectMessage", () => { `); const foreignOneof = foreignMessage.oneofs[0]; const r = reflect(proto3_ts.Proto3MessageSchema); - expect(() => r.oneofCase(foreignOneof)).toThrow( - /^cannot use oneof Foreign.foo with message spec.Proto3Message$/, - ); + assert.throws(() => r.oneofCase(foreignOneof), { + message: /^cannot use oneof Foreign.foo with message spec.Proto3Message$/, + }); }); }); - describe("get()", () => { + void suite("get()", () => { const desc = proto3_ts.Proto3MessageSchema; let msg: proto3_ts.Proto3Message; let r: ReflectMessage; @@ -131,44 +131,44 @@ describe("ReflectMessage", () => { }); test("gets message", () => { const f = desc.field.singularMessageField; - assert(f.fieldKind == "message"); + assert.strictEqual(f.fieldKind, "message"); msg.singularMessageField = create(proto3_ts.Proto3MessageSchema); const v = r.get(f); - expect(isReflectMessage(v)).toBe(true); + assert.strictEqual(isReflectMessage(v), true); if (isReflectMessage(v)) { - expect(v.message).toBe(msg.singularMessageField); + assert.strictEqual(v.message, msg.singularMessageField); } }); test("gets enum", () => { const f = desc.field.singularEnumField; msg.singularEnumField = proto3_ts.Proto3Enum.YES; - expect(r.get(f)).toBe(proto3_ts.Proto3Enum.YES); + assert.strictEqual(r.get(f), proto3_ts.Proto3Enum.YES); }); test("gets string", () => { const f = desc.field.singularStringField; msg.singularStringField = "abc"; - expect(r.get(f)).toBe("abc"); + assert.strictEqual(r.get(f), "abc"); }); test("gets list", () => { const f = desc.field.repeatedStringField; - assert(f.fieldKind == "list"); + assert.strictEqual(f.fieldKind, "list"); const list = r.get(f); - expect(isReflectList(list)).toBe(true); + assert.strictEqual(isReflectList(list), true); }); test("gets map", () => { const f = desc.field.mapStringStringField; - assert(f.fieldKind == "map"); + assert.strictEqual(f.fieldKind, "map"); const map = r.get(f); - expect(isReflectMap(map)).toBe(true); + assert.strictEqual(isReflectMap(map), true); }); test("gets wrapped wrapper field", () => { const f = desc.field.singularWrappedUint32Field; msg.singularWrappedUint32Field = 123; const wrapper = r.get(f); - expect(isReflectMessage(wrapper, UInt32ValueSchema)).toBe(true); + assert.strictEqual(isReflectMessage(wrapper, UInt32ValueSchema), true); if (isReflectMessage(wrapper, UInt32ValueSchema)) { const value = wrapper.get(wrapper.fields[0]); - expect(value).toBe(123); + assert.strictEqual(value, 123); } }); test("gets google.protobuf.Struct field", () => { @@ -192,13 +192,13 @@ describe("ReflectMessage", () => { // eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check switch (f.fieldKind) { case "message": - expect(isReflectMessage(r.get(f), StructSchema)).toBe(true); + assert.strictEqual(isReflectMessage(r.get(f), StructSchema), true); break; case "list": - expect(isReflectMessage(r.get(f).get(0), StructSchema)).toBe(true); + assert.strictEqual(isReflectMessage(r.get(f).get(0), StructSchema), true); break; case "map": - expect(isReflectMessage(r.get(f).get(123), StructSchema)).toBe( + assert.strictEqual(isReflectMessage(r.get(f).get(123), StructSchema), true, ); break; @@ -211,49 +211,49 @@ describe("ReflectMessage", () => { case: "oneofBoolField", value: false, }; - expect(r.get(f)).toBe(false); + assert.strictEqual(r.get(f), false); }); - describe("returns zero value for unset", () => { + void suite("returns zero value for unset", () => { test("scalar oneof field", () => { const f = desc.field.oneofBoolField; - expect(r.get(f)).toBe(false); + assert.strictEqual(r.get(f), false); }); test("optional string field", () => { const f = desc.field.optionalStringField; - expect(r.get(f)).toBe(""); + assert.strictEqual(r.get(f), ""); }); test("optional enum field", () => { const f = desc.field.optionalEnumField; - expect(r.get(f)).toBe(proto3_ts.Proto3Enum.UNSPECIFIED); + assert.strictEqual(r.get(f), proto3_ts.Proto3Enum.UNSPECIFIED); }); test("message field", () => { const f = desc.field.singularMessageField; - assert(f.fieldKind == "message"); + assert.strictEqual(f.fieldKind, "message"); const v = r.get(f); - expect(isReflectMessage(v)).toBe(true); + assert.strictEqual(isReflectMessage(v), true); if (isReflectMessage(v)) { for (const f of v.fields) { - expect(v.isSet(f)).toBe(false); + assert.strictEqual(v.isSet(f), false); } } - expect(r.isSet(f)).toBe(false); + assert.strictEqual(r.isSet(f), false); }); }); test("returns ReflectMessage with zero message for unset message field", () => { const f = desc.field.singularMessageField; - assert(f.fieldKind == "message"); + assert.strictEqual(f.fieldKind, "message"); const v = r.get(f); - expect(isReflectMessage(v)).toBe(true); + assert.strictEqual(isReflectMessage(v), true); if (isReflectMessage(v)) { for (const f of v.fields) { - expect(v.isSet(f)).toBe(false); + assert.strictEqual(v.isSet(f), false); } } }); test("returns bigint for jstype=JS_STRING", () => { const f = desc.field.singularInt64JsStringField; msg.singularInt64JsStringField = "123"; - expect(r.get(f)).toBe(protoInt64.parse(123)); + assert.strictEqual(r.get(f), protoInt64.parse(123)); }); test("throws error on foreign field", async () => { const foreignMessage = await compileMessage(` @@ -261,13 +261,13 @@ describe("ReflectMessage", () => { message Foreign { string foreign = 1;} `); const foreignField = foreignMessage.fields[0]; - assert(foreignField.fieldKind == "scalar"); - expect(() => r.get(foreignField)).toThrow( - /^cannot use field Foreign.foreign with message spec.Proto3Message$/, - ); + assert.ok(foreignField.fieldKind == "scalar"); + assert.throws(() => r.get(foreignField), { + message: /^cannot use field Foreign.foreign with message spec.Proto3Message$/, + }); }); }); - describe("set()", () => { + void suite("set()", () => { const desc = proto3_ts.Proto3MessageSchema; let msg: proto3_ts.Proto3Message; let r: ReflectMessage; @@ -278,58 +278,58 @@ describe("ReflectMessage", () => { test("sets enum", () => { const f = desc.field.singularEnumField; r.set(f, proto3_ts.Proto3Enum.YES); - expect(msg.singularEnumField).toBe(proto3_ts.Proto3Enum.YES); + assert.strictEqual(msg.singularEnumField, proto3_ts.Proto3Enum.YES); }); test("sets string", () => { const f = desc.field.singularStringField; r.set(f, "abc"); - expect(msg.singularStringField).toBe("abc"); + assert.strictEqual(msg.singularStringField, "abc"); }); test("sets ReflectMap", () => { const f = desc.field.mapStringStringField; - assert(f.fieldKind == "map"); + assert.strictEqual(f.fieldKind, "map"); const map = reflectMap(f); map.set("foo", "bar"); r.set(f, map); - expect(msg.mapStringStringField).toStrictEqual({ foo: "bar" }); + assert.deepStrictEqual(msg.mapStringStringField, { foo: "bar" }); }); test("sets ReflectList", () => { const f = desc.field.repeatedStringField; - assert(f.fieldKind == "list"); + assert.strictEqual(f.fieldKind, "list"); const list = reflectList(f); list.add("foo"); r.set(f, list); - expect(msg.repeatedStringField).toStrictEqual(["foo"]); + assert.deepStrictEqual(msg.repeatedStringField, ["foo"]); }); test("sets ReflectMessage", () => { const f = desc.field.singularMessageField; const testMessage = create(proto3_ts.Proto3MessageSchema); r.set(f, reflect(proto3_ts.Proto3MessageSchema, testMessage)); - expect(msg.singularMessageField).toBe(testMessage); + assert.strictEqual(msg.singularMessageField, testMessage); }); test("sets number, string, bigint as bigint for 64-bit integer field", () => { const f = desc.field.singularInt64Field; r.set(f, protoInt64.parse(123)); - expect(msg.singularInt64Field === protoInt64.parse(123)).toBe(true); + assert.strictEqual(msg.singularInt64Field === protoInt64.parse(123), true); r.set(f, 123); - expect(msg.singularInt64Field === protoInt64.parse(123)).toBe(true); + assert.strictEqual(msg.singularInt64Field === protoInt64.parse(123), true); r.set(f, "123"); - expect(msg.singularInt64Field === protoInt64.parse(123)).toBe(true); + assert.strictEqual(msg.singularInt64Field === protoInt64.parse(123), true); }); test("sets number, string, bigint as string for 64-bit integer field with jstype=JS_STRING", () => { const f = desc.field.singularInt64JsStringField; r.set(f, protoInt64.parse(123)); - expect(msg.singularInt64JsStringField).toBe("123"); + assert.strictEqual(msg.singularInt64JsStringField, "123"); r.set(f, 123); - expect(msg.singularInt64JsStringField).toBe("123"); + assert.strictEqual(msg.singularInt64JsStringField, "123"); r.set(f, "123"); - expect(msg.singularInt64JsStringField).toBe("123"); + assert.strictEqual(msg.singularInt64JsStringField, "123"); }); test("sets unwrapped value for wrapper field", () => { const f = desc.field.singularWrappedUint32Field; const wrapper = create(UInt32ValueSchema, { value: 123 }); r.set(f, reflect(UInt32ValueSchema, wrapper)); - expect(msg.singularWrappedUint32Field).toBe(123); + assert.strictEqual(msg.singularWrappedUint32Field, 123); }); test("sets google.protobuf.Struct field as JsonObject", () => { const structMessage = create(StructSchema, { @@ -344,11 +344,11 @@ describe("ReflectMessage", () => { }); const structReflect = reflect(StructSchema, structMessage); r.set(desc.field.singularStructField, structReflect); - expect(msg.singularStructField).toStrictEqual({ + assert.deepStrictEqual(msg.singularStructField, { shouldBeJson: true, }); r.set(desc.field.oneofStructField, structReflect); - expect(msg.either).toStrictEqual({ + assert.deepStrictEqual(msg.either, { case: "oneofStructField", value: { shouldBeJson: true }, }); @@ -356,7 +356,7 @@ describe("ReflectMessage", () => { test("sets unknown value for open enum", () => { const f = desc.field.singularEnumField; r.set(f, 99); - expect(msg.singularEnumField).toBe(99); + assert.strictEqual(msg.singularEnumField, 99); }); test("selects oneof field", () => { const f = desc.field.oneofInt32Field; @@ -365,7 +365,7 @@ describe("ReflectMessage", () => { value: 123, }; r.set(f, 123); - expect(msg.either).toStrictEqual({ + assert.deepStrictEqual(msg.either, { case: "oneofInt32Field", value: 123, }); @@ -377,11 +377,11 @@ describe("ReflectMessage", () => { value: 123, }; r.set(oneofBoolField, false); - expect(msg.either).toStrictEqual({ + assert.deepStrictEqual(msg.either, { case: "oneofBoolField", value: false, }); - expect(r.isSet(oneofInt32Field)).toBe(false); + assert.strictEqual(r.isSet(oneofInt32Field), false); }); test("throws error on foreign field", async () => { const foreignMessage = await compileMessage(` @@ -389,135 +389,169 @@ describe("ReflectMessage", () => { message Foreign { string foreign = 1;} `); const foreignField = foreignMessage.fields[0]; - expect(() => r.set(foreignField, "value")).toThrow( - /^cannot use field Foreign.foreign with message spec.Proto3Message$/, - ); + assert.throws(() => r.set(foreignField, "value"), { + message: /^cannot use field Foreign.foreign with message spec.Proto3Message$/, + }); }); test("returns error setting number out of range", () => { const f = desc.field.singularInt32Field; const err = catchFieldError(() => r.set(f, Number.MAX_SAFE_INTEGER)); - expect(err?.message).toMatch( - /^expected number \(int32\): 9007199254740991 out of range$/, - ); - expect(err?.name).toMatch("FieldValueInvalidError"); + assert.ok(err !== undefined); + assert.match(err.message, /^expected number \(int32\): 9007199254740991 out of range$/); + assert.equal(err.name, "FieldValueInvalidError"); }); test("returns error setting float for int", () => { const f = desc.field.singularInt32Field; const err = catchFieldError(() => r.set(f, 3.14)); - expect(err?.message).toMatch(/^expected number \(int32\), got 3.14$/); - expect(err?.name).toMatch("FieldValueInvalidError"); - }); - describe("returns error setting undefined", () => { - test.each(desc.fields)("for proto3 field $name", (f) => { - const err = catchFieldError(() => r.set(f, undefined)); - expect(err).toBeDefined(); - expect(err?.message).toMatch(/^expected .*, got undefined/); - expect(err?.name).toMatch("FieldValueInvalidError"); - }); + assert.ok(err !== undefined); + assert.match(err.message, /^expected number \(int32\), got 3.14$/); + assert.equal(err.name, "FieldValueInvalidError"); }); - describe("returns error setting null", () => { - test.each(desc.fields)("for proto3 field $name", (f) => { - const err = catchFieldError(() => r.set(f, null)); - expect(err).toBeDefined(); - expect(err?.message).toMatch(/^expected .*, got null/); - expect(err?.name).toMatch("FieldValueInvalidError"); - }); + void suite("returns error setting undefined", () => { + for (const f of desc.fields) { + void test(`for proto3 field ${f.name}`, () => { + const err = catchFieldError(() => r.set(f, undefined)); + assert.ok(err !== undefined); + assert.match(err.message, /^expected .*, got undefined/); + assert.equal(err.name, "FieldValueInvalidError"); + }); + } }); - describe("throws error setting array", () => { - test.each(desc.fields)("$name", (f) => { - const err = catchFieldError(() => r.set(f, [1, 2])); - expect(err?.message).toMatch(/^expected .*, got Array\(2\)$/); - expect(err?.name).toMatch("FieldValueInvalidError"); - }); + void suite("returns error setting null", () => { + for (const f of desc.fields) { + void test(`for proto3 field ${f.name}`, () => { + const err = catchFieldError(() => r.set(f, null)); + assert.ok(err !== undefined); + assert.match(err.message, /^expected .*, got null/); + assert.equal(err.name, "FieldValueInvalidError"); + }); + } }); - describe("throws error setting object", () => { - test.each(desc.fields)("$name", (f) => { - const err = catchFieldError(() => r.set(f, new Date())); - expect(err?.message).toMatch(/^expected .*, got object$/); - expect(err?.name).toMatch("FieldValueInvalidError"); - }); + void suite("throws error setting array", () => { + for (const f of desc.fields) { + void test(`${f.name}`, () => { + const err = catchFieldError(() => r.set(f, [1, 2])); + assert.ok(err !== undefined); + assert.match(err.message, /^expected .*, got Array\(2\)$/); + assert.equal(err.name, "FieldValueInvalidError"); + }); + } }); - describe("throws error setting message", () => { - test.each(desc.fields)("$name", (f) => { - const err = catchFieldError(() => - r.set(f, create(proto3_ts.Proto3MessageSchema)), - ); - expect(err?.message).toMatch( - /^expected .*, got message spec.Proto3Message$/, - ); - expect(err?.name).toMatch("FieldValueInvalidError"); - }); + void suite("throws error setting object", () => { + for (const f of desc.fields) { + void test(`${f.name}`, () => { + const err = catchFieldError(() => r.set(f, new Date())); + assert.ok(err !== undefined); + assert.match(err.message, /^expected .*, got object$/); + assert.equal(err.name, "FieldValueInvalidError"); + }); + } }); - describe("throws error setting scalar value for message field", () => { + void suite("throws error setting message", () => { + for (const f of desc.fields) { + void test(`${f.name}`, () => { + const err = catchFieldError(() => + r.set(f, create(proto3_ts.Proto3MessageSchema)), + ); + assert.ok(err !== undefined); + assert.match(err.message, + /^expected .*, got message spec.Proto3Message$/, + ); + assert.equal(err.name, "FieldValueInvalidError"); + }); + } + }); + void suite("throws error setting scalar value for message field", () => { const fields = desc.fields.filter((f) => f.fieldKind == "message"); - test.each(fields)("set $name true", (f) => { - const err = catchFieldError(() => r.set(f, true)); - expect(err?.message).toMatch(/^expected .*, got true$/); - expect(err?.name).toMatch("FieldValueInvalidError"); - }); - test.each(fields)("set $name 'abc'", (f) => { - const err = catchFieldError(() => r.set(f, "abc")); - expect(err?.message).toMatch(/^expected .*, got "abc"$/); - expect(err?.name).toMatch("FieldValueInvalidError"); - }); - test.each(fields)("set $name 123", (f) => { - const err = catchFieldError(() => r.set(f, 123)); - expect(err?.message).toMatch(/^expected .*, got 123$/); - expect(err?.name).toMatch("FieldValueInvalidError"); - }); + for (const f of fields) { + void test(`set ${f.name} true`, () => { + const err = catchFieldError(() => r.set(f, true)); + assert.ok(err !== undefined); + assert.match(err.message, /^expected .*, got true$/); + assert.equal(err.name, "FieldValueInvalidError"); + }); + } + for (const f of fields) { + void test(`set ${f.name} 'abc'`, () => { + const err = catchFieldError(() => r.set(f, "abc")); + assert.ok(err !== undefined); + assert.match(err.message, /^expected .*, got "abc"$/); + assert.equal(err.name, "FieldValueInvalidError"); + }); + } + for (const f of fields) { + void test(`set ${f.name} 123`, () => { + const err = catchFieldError(() => r.set(f, 123)); + assert.ok(err !== undefined); + assert.match(err.message, /^expected .*, got 123$/); + assert.equal(err.name, "FieldValueInvalidError"); + }); + } }); - describe("throws error setting non-integer value for enum field", () => { + void suite("throws error setting non-integer value for enum field", () => { const fields = desc.fields.filter((f) => f.fieldKind == "enum"); - test.each(fields)("set $name true", (f) => { - const err = catchFieldError(() => r.set(f, true)); - expect(err?.message).toMatch(/^expected enum .*, got true$/); - expect(err?.name).toMatch("FieldValueInvalidError"); - }); - test.each(fields)("set $name 'abc'", (f) => { - const err = catchFieldError(() => r.set(f, "abc")); - expect(err?.message).toMatch(/^expected enum .*, got "abc"$/); - expect(err?.name).toMatch("FieldValueInvalidError"); - }); - test.each(fields)("set $name 3.14", (f) => { - const err = catchFieldError(() => r.set(f, 3.14)); - expect(err?.message).toMatch(/^expected enum .*, got 3.14$/); - expect(err?.name).toMatch("FieldValueInvalidError"); - }); + for (const f of fields) { + void test(`set ${f.name} true`, () => { + const err = catchFieldError(() => r.set(f, true)); + assert.ok(err !== undefined); + assert.match(err.message, /^expected enum .*, got true$/); + assert.equal(err.name, "FieldValueInvalidError"); + }); + } + for (const f of fields) { + void test(`set ${f.name} 'abc'`, () => { + const err = catchFieldError(() => r.set(f, "abc")); + assert.ok(err !== undefined); + assert.match(err.message, /^expected enum .*, got "abc"$/); + assert.equal(err.name, "FieldValueInvalidError"); + }); + } + for (const f of fields) { + void test(`set ${f.name} 3.14`, () => { + const err = catchFieldError(() => r.set(f, 3.14)); + assert.ok(err !== undefined); + assert.match(err.message, /^expected enum .*, got 3.14$/); + assert.equal(err.name, "FieldValueInvalidError"); + }); + } }); test("throws error setting incompatible ReflectMessage", () => { const f = desc.field.singularMessageField; const err = catchFieldError(() => r.set(f, reflect(example_ts.UserSchema)), ); - expect(err?.message).toMatch( + assert.ok(err !== undefined); + assert.match(err.message, /^expected ReflectMessage \(spec.Proto3Message\), got ReflectMessage \(example.User\)$/, ); - expect(err?.name).toMatch("FieldValueInvalidError"); + assert.equal(err.name, "FieldValueInvalidError"); }); test("throws error setting incompatible ReflectMap", () => { const { mapStringStringField, mapInt32Int32Field } = desc.field; - assert(mapStringStringField.fieldKind == "map"); - assert(mapInt32Int32Field.fieldKind == "map"); + assert.strictEqual(mapStringStringField.fieldKind, "map"); + assert.strictEqual(mapInt32Int32Field.fieldKind, "map"); const map = reflectMap(mapStringStringField); const err = catchFieldError(() => r.set(mapInt32Int32Field, map)); - expect(err?.message).toMatch( + assert.ok(err !== undefined); + assert.match(err.message, /^expected ReflectMap \(INT32, INT32\), got ReflectMap \(STRING, STRING\)$/, ); - expect(err?.name).toMatch("FieldValueInvalidError"); + assert.equal(err.name, "FieldValueInvalidError"); }); test("throws error setting incompatible ReflectList", () => { const { repeatedStringField, repeatedInt32Field } = desc.field; - assert(repeatedStringField.fieldKind == "list"); - assert(repeatedInt32Field.fieldKind == "list"); + assert.strictEqual(repeatedStringField.fieldKind, "list"); + assert.strictEqual(repeatedInt32Field.fieldKind, "list"); const list = reflectList(repeatedStringField); const err = catchFieldError(() => r.set(repeatedInt32Field, list)); - expect(err?.message).toMatch( + assert.ok(err !== undefined); + assert.match(err.message, /^expected ReflectList \(INT32\), got ReflectList \(STRING\)$/, ); - expect(err?.name).toMatch("FieldValueInvalidError"); + assert.equal(err.name, "FieldValueInvalidError"); }); }); - describe("isSet()", () => { + void suite("isSet()", () => { test("returns true for set fields", () => { const desc = proto3_ts.Proto3MessageSchema; const msg = create(desc); @@ -555,27 +589,27 @@ describe("ReflectMessage", () => { a: "A", }; const r = reflect(desc, msg); - expect(r.isSet(desc.field.singularStringField)).toBe(true); - expect(r.isSet(desc.field.singularBytesField)).toBe(true); - expect(r.isSet(desc.field.singularInt32Field)).toBe(true); - expect(r.isSet(desc.field.singularInt64Field)).toBe(true); - expect(r.isSet(desc.field.singularInt64JsStringField)).toBe(true); - expect(r.isSet(desc.field.singularEnumField)).toBe(true); - expect(r.isSet(desc.field.singularMessageField)).toBe(true); - expect(r.isSet(desc.field.singularWrappedUint32Field)).toBe(true); - expect(r.isSet(desc.field.optionalStringField)).toBe(true); - expect(r.isSet(desc.field.optionalInt64Field)).toBe(true); - expect(r.isSet(desc.field.optionalInt64JsStringField)).toBe(true); - expect(r.isSet(desc.field.optionalMessageField)).toBe(true); - expect(r.isSet(desc.field.optionalWrappedUint32Field)).toBe(true); - expect(r.isSet(desc.field.repeatedStringField)).toBe(true); - expect(r.isSet(desc.field.repeatedWrappedUint32Field)).toBe(true); - expect(r.isSet(desc.field.repeatedInt64Field)).toBe(true); - expect(r.isSet(desc.field.repeatedInt64JsStringField)).toBe(true); - expect(r.isSet(desc.field.repeatedMessageField)).toBe(true); - expect(r.isSet(desc.field.repeatedEnumField)).toBe(true); - expect(r.isSet(desc.field.oneofBoolField)).toBe(true); - expect(r.isSet(desc.field.mapStringStringField)).toBe(true); + assert.strictEqual(r.isSet(desc.field.singularStringField), true); + assert.strictEqual(r.isSet(desc.field.singularBytesField), true); + assert.strictEqual(r.isSet(desc.field.singularInt32Field), true); + assert.strictEqual(r.isSet(desc.field.singularInt64Field), true); + assert.strictEqual(r.isSet(desc.field.singularInt64JsStringField), true); + assert.strictEqual(r.isSet(desc.field.singularEnumField), true); + assert.strictEqual(r.isSet(desc.field.singularMessageField), true); + assert.strictEqual(r.isSet(desc.field.singularWrappedUint32Field), true); + assert.strictEqual(r.isSet(desc.field.optionalStringField), true); + assert.strictEqual(r.isSet(desc.field.optionalInt64Field), true); + assert.strictEqual(r.isSet(desc.field.optionalInt64JsStringField), true); + assert.strictEqual(r.isSet(desc.field.optionalMessageField), true); + assert.strictEqual(r.isSet(desc.field.optionalWrappedUint32Field), true); + assert.strictEqual(r.isSet(desc.field.repeatedStringField), true); + assert.strictEqual(r.isSet(desc.field.repeatedWrappedUint32Field), true); + assert.strictEqual(r.isSet(desc.field.repeatedInt64Field), true); + assert.strictEqual(r.isSet(desc.field.repeatedInt64JsStringField), true); + assert.strictEqual(r.isSet(desc.field.repeatedMessageField), true); + assert.strictEqual(r.isSet(desc.field.repeatedEnumField), true); + assert.strictEqual(r.isSet(desc.field.oneofBoolField), true); + assert.strictEqual(r.isSet(desc.field.mapStringStringField), true); }); test("throws error on foreign field", async () => { const foreignMessage = await compileMessage(` @@ -584,12 +618,12 @@ describe("ReflectMessage", () => { `); const foreignField = foreignMessage.fields[0]; const r = reflect(proto3_ts.Proto3MessageSchema); - expect(() => r.isSet(foreignField)).toThrow( - /^cannot use field Foreign.foreign with message spec.Proto3Message$/, - ); + assert.throws(() => r.isSet(foreignField), { + message: /^cannot use field Foreign.foreign with message spec.Proto3Message$/, + }); }); }); - describe("clear()", () => { + void suite("clear()", () => { let msg: proto3_ts.Proto3Message; let r: ReflectMessage; beforeEach(() => { @@ -632,23 +666,22 @@ describe("ReflectMessage", () => { }; r = reflect(proto3_ts.Proto3MessageSchema, msg); }); - test.each(proto3_ts.Proto3MessageSchema.fields)( - "clears proto3 field $name", - (f) => { + for (const f of proto3_ts.Proto3MessageSchema.fields) { + void test(`clears proto3 field ${f.name}`, () => { r.clear(f); - expect(r.isSet(f)).toBe(false); - }, - ); + assert.strictEqual(r.isSet(f), false); + }); + } test("throws error on foreign field", async () => { const foreignMessage = await compileMessage(` syntax="proto3"; message Foreign { repeated string foreign = 1;} `); const foreignField = foreignMessage.fields[0]; - assert(foreignField.fieldKind == "list"); - expect(() => r.clear(foreignField)).toThrow( - /^cannot use field Foreign.foreign with message spec.Proto3Message$/, - ); + assert.ok(foreignField.fieldKind == "list"); + assert.throws(() => r.clear(foreignField), { + message: /^cannot use field Foreign.foreign with message spec.Proto3Message$/, + }); }); }); }); diff --git a/packages/protoplugin-test/src/target.test.ts b/packages/protoplugin-test/src/target.test.ts index dd06c0b20..590bcf6f1 100644 --- a/packages/protoplugin-test/src/target.test.ts +++ b/packages/protoplugin-test/src/target.test.ts @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { beforeEach, describe, expect, jest, test } from "@jest/globals"; +import { suite, test, beforeEach } from "node:test"; +import * as assert from "node:assert"; import { createTestPluginAndRun } from "./helpers.js"; import type { createEcmaScriptPlugin, @@ -21,7 +22,7 @@ import type { } from "@bufbuild/protoplugin"; import type { CodeGeneratorResponse } from "@bufbuild/protobuf/wkt"; -describe("target", () => { +void suite("target", (context) => { type PluginInit = Parameters< typeof createEcmaScriptPlugin> >[0]; @@ -30,7 +31,7 @@ describe("target", () => { let generateDts: jest.Mock["generateDts"]>; let transpile: jest.Mock["transpile"]>; - beforeEach(() => { + beforeEach((context) => { generateTs = jest.fn((schema: Schema) => schema.generateFile("test.ts").print(`const foo = "ts";`), ); @@ -71,8 +72,8 @@ describe("target", () => { ); }); - describe("unset", () => { - test("should generate .js and .d.ts files", async () => { + void suite("unset", () => { + void test("should generate .js and .d.ts files", async () => { const res = await createTestPluginAndRun({ proto: `syntax="proto3";`, parameter: "", @@ -82,9 +83,9 @@ describe("target", () => { transpile, }); const gotFiles = res.file.map((f) => f.name).sort(); - expect(gotFiles).toStrictEqual(["test.js", "test.d.ts"].sort()); + assert.deepStrictEqual(gotFiles).toStrictEqual(["test.js", "test.d.ts"].sort()); }); - test("should call generateJs and generateDts", async () => { + void test("should call generateJs and generateDts", async () => { await createTestPluginAndRun({ proto: `syntax="proto3";`, parameter: "", @@ -111,7 +112,7 @@ describe("target", () => { ]; describe.each(targetCases)("targets %s", (targetsJoined) => { const targets = targetsJoined.split("+"); - test("should generate expected files", async () => { + void test("should generate expected files", async () => { const res = await createTestPluginAndRun({ proto: `syntax="proto3";`, parameter: `target=${targetsJoined}`, @@ -124,9 +125,9 @@ describe("target", () => { const wantFiles = targets .map((t) => (t == "dts" ? "test.d.ts" : `test.${t}`)) .sort(); - expect(gotFiles).toStrictEqual(wantFiles); + assert.deepStrictEqual(gotFiles).toStrictEqual(wantFiles); }); - test("should call expected generator functions", async () => { + void test("should call expected generator functions", async () => { await createTestPluginAndRun({ proto: `syntax="proto3";`, parameter: `target=${targetsJoined}`, @@ -209,7 +210,7 @@ describe("target", () => { })), ); - test("should call expected generator functions", () => { + void test("should call expected generator functions", () => { expect(generateTs).toHaveBeenCalledTimes( calledGenerators.includes("ts") ? 1 : 0, ); @@ -217,7 +218,7 @@ describe("target", () => { expect(generateDts).toHaveBeenCalledTimes(calledGenerators.includes("dts") ? 1 : 0); // biome-ignore format: want this to read well }); - test("should call transpile function", () => { + void test("should call transpile function", () => { expect(transpile).toHaveBeenCalledTimes(1); expect(transpile).toHaveBeenCalledWith( [ @@ -233,9 +234,9 @@ describe("target", () => { ); }); - test("should generate expected files", () => { + void test("should generate expected files", () => { const gotFiles = res.file.map((f) => f.name).sort(); - expect(gotFiles).toStrictEqual(expectedFiles); + assert.deepStrictEqual(gotFiles, expectedFiles); }); }, ); From 777bc53ff4d5cfd99cd6c27661c16911b0a8d046 Mon Sep 17 00:00:00 2001 From: Timo Stamm Date: Mon, 18 Aug 2025 15:57:57 +0200 Subject: [PATCH 03/16] Migrate protobuf-test wire/base64-encoding --- .../src/wire/base64-encoding.test.ts | 117 ++++++++++-------- 1 file changed, 67 insertions(+), 50 deletions(-) diff --git a/packages/protobuf-test/src/wire/base64-encoding.test.ts b/packages/protobuf-test/src/wire/base64-encoding.test.ts index 509b945eb..cba967f6f 100644 --- a/packages/protobuf-test/src/wire/base64-encoding.test.ts +++ b/packages/protobuf-test/src/wire/base64-encoding.test.ts @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { base64Decode, base64Encode } from "@bufbuild/protobuf/wire"; // The following test cases match https://cs.opensource.google/go/go/+/master:src/encoding/base64/base64_test.go;l=25 @@ -157,23 +158,32 @@ const exampleCases: { }, ]; -describe("base64Decode()", () => { - test.each(exampleCases)("decodes $name", ({ bytes, std }) => { - expect(base64Decode(std)).toStrictEqual( - bytes instanceof Uint8Array ? bytes : new TextEncoder().encode(bytes), - ); - }); - test.each(exampleCases)("decodes std_raw $name", ({ bytes, std_raw }) => { - expect(base64Decode(std_raw)).toStrictEqual( - bytes instanceof Uint8Array ? bytes : new TextEncoder().encode(bytes), - ); - }); - test.each(exampleCases)("decodes url $name", ({ bytes, url }) => { - expect(base64Decode(url)).toStrictEqual( - bytes instanceof Uint8Array ? bytes : new TextEncoder().encode(bytes), - ); - }); - test.each([ +void suite("base64Decode()", () => { + for (const { name, bytes, std } of exampleCases) { + void test(`decodes ${name}`, () => { + assert.deepStrictEqual( + base64Decode(std), + bytes instanceof Uint8Array ? bytes : new TextEncoder().encode(bytes), + ); + }); + } + for (const { name, bytes, std_raw } of exampleCases) { + void test(`decodes std_raw ${name}`, () => { + assert.deepStrictEqual( + base64Decode(std_raw), + bytes instanceof Uint8Array ? bytes : new TextEncoder().encode(bytes), + ); + }); + } + for (const { name, bytes, url } of exampleCases) { + void test(`decodes url ${name}`, () => { + assert.deepStrictEqual( + base64Decode(url), + bytes instanceof Uint8Array ? bytes : new TextEncoder().encode(bytes), + ); + }); + } + for (const b64 of [ "c3VyZQ==", "c3VyZQ== ", "c3VyZQ==\t", @@ -187,26 +197,28 @@ describe("base64Decode()", () => { "c3VyZQ\n==", "c3VyZQ=\n=", "c3VyZQ=\r\n\r\n=", - ])("ignores white-space, including line breaks and tabs in %s", (b64) => { - expect(base64Decode(b64)).toStrictEqual(new TextEncoder().encode("sure")); - }); - test.each([ + ]) { + void test(`ignores white-space, including line breaks and tabs in ${b64}`, () => { + assert.deepStrictEqual(base64Decode(b64), new TextEncoder().encode("sure")); + }); + } + for (const b64 of [ "c3VyZQ==c3VyZQ==", "c3VyZQ==\nc3VyZQ==", "c3VyZQ==\tc3VyZQ==", "c3VyZQ==\rc3VyZQ==", "c3VyZQ== c3VyZQ==", - ])("allows inner padding in %s", (b64) => { - expect(base64Decode(b64)).toStrictEqual( - new TextEncoder().encode("suresure"), - ); - }); - test("does not require padding", () => { - expect(base64Decode("c3VyZQ")).toStrictEqual( + ]) { + void test(`allows inner padding in ${b64}`, () => { + assert.deepStrictEqual(base64Decode(b64), new TextEncoder().encode("suresure")); + }); + } + void test("does not require padding", () => { + assert.deepStrictEqual(base64Decode("c3VyZQ"), new TextEncoder().encode("sure"), ); }); - test.each([ + for (const b64 of [ "c3VyZQ==", "c3VyZQ==\r", "c3VyZQ==\n", @@ -218,30 +230,35 @@ describe("base64Decode()", () => { "c3VyZQ\n==", "c3VyZQ=\n=", "c3VyZQ=\r\n\r\n=", - ])("ignores whitespace in %s", (b64) => { - expect(base64Decode(b64)).toStrictEqual(new TextEncoder().encode("sure")); - }); + ]) { + void test(`ignores whitespace in ${b64}`, () => { + assert.deepStrictEqual(base64Decode(b64), new TextEncoder().encode("sure")); + }); + } test("understands URL encoding", () => { const b64 = "PDw_Pz8-Pg"; const bytes = base64Decode(b64); - expect(bytes).toStrictEqual(new TextEncoder().encode("<>")); + assert.deepStrictEqual(bytes, new TextEncoder().encode("<>")); }); }); -describe("base64Encode()", () => { - test.each(exampleCases)("std encodes $name", ({ bytes, std }) => { - const input = - bytes instanceof Uint8Array ? bytes : new TextEncoder().encode(bytes); - expect(base64Encode(input)).toBe(std); - }); - test.each(exampleCases)("std_raw encodes $name", ({ bytes, std_raw }) => { - const input = - bytes instanceof Uint8Array ? bytes : new TextEncoder().encode(bytes); - expect(base64Encode(input, "std_raw")).toBe(std_raw); - }); - test.each(exampleCases)("url encodes $name", ({ bytes, url }) => { - const input = - bytes instanceof Uint8Array ? bytes : new TextEncoder().encode(bytes); - expect(base64Encode(input, "url")).toBe(url); - }); +void suite("base64Encode()", () => { + for (const { name, bytes, std } of exampleCases) { + void test(`std encodes ${name}`, () => { + const input = bytes instanceof Uint8Array ? bytes : new TextEncoder().encode(bytes); + assert.strictEqual(base64Encode(input), std); + }); + } + for (const { name, bytes, std_raw } of exampleCases) { + void test(`std_raw encodes ${name}`, () => { + const input = bytes instanceof Uint8Array ? bytes : new TextEncoder().encode(bytes); + assert.strictEqual(base64Encode(input, "std_raw"), std_raw); + }); + } + for (const { name, bytes, url } of exampleCases) { + void test(`url encodes ${name}`, () => { + const input = bytes instanceof Uint8Array ? bytes : new TextEncoder().encode(bytes); + assert.strictEqual(base64Encode(input, "url"), url); + }); + } }); From 9957f11f6e38f551caf4494e058223c35cb13184 Mon Sep 17 00:00:00 2001 From: Timo Stamm Date: Mon, 18 Aug 2025 16:50:00 +0200 Subject: [PATCH 04/16] Migrate protobuf-test wire/* --- .../src/wire/binary-encoding.test.ts | 252 ++++++++++-------- .../src/wire/size-delimited.test.ts | 82 +++--- .../src/wire/text-encoding.test.ts | 55 ++-- 3 files changed, 205 insertions(+), 184 deletions(-) diff --git a/packages/protobuf-test/src/wire/binary-encoding.test.ts b/packages/protobuf-test/src/wire/binary-encoding.test.ts index 00287da4e..32fba008d 100644 --- a/packages/protobuf-test/src/wire/binary-encoding.test.ts +++ b/packages/protobuf-test/src/wire/binary-encoding.test.ts @@ -12,13 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, it } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { fromBinary } from "@bufbuild/protobuf"; import { BinaryReader, BinaryWriter, WireType } from "@bufbuild/protobuf/wire"; import { UserSchema } from "../gen/ts/extra/example_pb.js"; -describe("BinaryWriter", () => { - it("example should work as expected", () => { +void suite("BinaryWriter", () => { + void test("example should work as expected", () => { const bytes = new BinaryWriter() // string first_name = 1 .tag(1, WireType.LengthDelimited) @@ -28,11 +29,11 @@ describe("BinaryWriter", () => { .bool(true) .finish(); const user = fromBinary(UserSchema, bytes); - expect(user.firstName).toBe("Homer"); - expect(user.active).toBe(true); + assert.strictEqual(user.firstName, "Homer"); + assert.strictEqual(user.active, true); }); - describe("float32()", () => { - it.each([ + void suite("float32()", () => { + for (const val of [ 1024, 3.14, -3.14, @@ -40,101 +41,118 @@ describe("BinaryWriter", () => { Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY, Number.NaN, - ])("should encode %s", (val) => { - const bytes = new BinaryWriter().float(val).finish(); - expect(bytes.length).toBeGreaterThan(0); - // @ts-expect-error test string - const bytesStr = new BinaryWriter().float(val.toString()).finish(); - expect(bytesStr.length).toBeGreaterThan(0); - expect(bytesStr).toStrictEqual(bytes); - }); - it.each([ + ]) { + void test(`should encode ${val}`, () => { + const bytes = new BinaryWriter().float(val).finish(); + assert.ok(bytes.length >= 0); + // @ts-expect-error test string + const bytesStr = new BinaryWriter().float(val.toString()).finish(); + assert.ok(bytesStr.length > 0); + assert.deepStrictEqual(bytesStr, bytes); + }); + } + for (const {val, err} of [ { val: null, err: "invalid float32: object" }, { val: new Date(), err: "invalid float32: object" }, { val: undefined, err: "invalid float32: undefined" }, - { val: true, err: "invalid float32: bool" }, - ])("should error for wrong type $val", ({ val, err }) => { - // @ts-expect-error test wrong type - expect(() => new BinaryWriter().float(val)).toThrow(err); - }); - it.each([Number.MAX_VALUE, -Number.MAX_VALUE])( - "should error for value out of range %s", - (val) => { - expect(() => new BinaryWriter().float(val)).toThrow( - /^invalid float32: .*/, - ); + { val: true, err: "invalid float32: boolean" }, + ]) { + void test(`should error for value out of range ${val}`, () => { + // @ts-expect-error test wrong type + assert.throws(() => new BinaryWriter().float(val), { + message: err, + }) + }); + } + for (const val of [ + Number.MAX_VALUE, -Number.MAX_VALUE, + ]) { + void test(`should error for value out of range ${val}`, () => { + assert.throws(() => new BinaryWriter().float(val), { + message: /^invalid float32: .*/, + }); // @ts-expect-error test string - expect(() => new BinaryWriter().float(val.toString())).toThrow( - /^invalid float32: .*/, - ); - }, - ); + assert.throws(() => new BinaryWriter().float(val.toString()), { + message: /^invalid float32: .*/, + }); + }); + } }); // sfixed32, sint32, and int32 are signed 32-bit integers, just with different encoding - describe.each(["sfixed32", "sint32", "int32"] as const)("%s()", (type) => { - it.each([-0x80000000, 1024, 0x7fffffff])("should encode %s", (val) => { - const bytes = new BinaryWriter()[type](val).finish(); - expect(bytes.length).toBeGreaterThan(0); - // @ts-expect-error test string - const bytesStr = new BinaryWriter()[type](val.toString()).finish(); - expect(bytesStr.length).toBeGreaterThan(0); - expect(bytesStr).toStrictEqual(bytes); - }); - it.each([ - { val: null, err: "invalid int32: object" }, - { val: new Date(), err: "invalid int32: object" }, - { val: undefined, err: "invalid int32: undefined" }, - { val: true, err: "invalid int32: bool" }, - ])("should error for wrong type $val", ({ val, err }) => { - // @ts-expect-error TS2345 - expect(() => new BinaryWriter()[type](val)).toThrow(err); - }); - it.each([0x7fffffff + 1, -0x80000000 - 1, 3.14])( - "should error for value out of range %s", - (val) => { - expect(() => new BinaryWriter()[type](val)).toThrow( - /^invalid int32: .*/, - ); - // @ts-expect-error test string - expect(() => new BinaryWriter()[type](val.toString())).toThrow( - /^invalid int32: .*/, - ); - }, - ); - }); + for (const type of ["sfixed32", "sint32", "int32"] as const) { + void suite(`${type}()`, () => { + for (const val of [-0x80000000, 1024, 0x7fffffff]) { + void test(`should encode ${val}`, () => { + const bytes = new BinaryWriter()[type](val).finish(); + assert.ok(bytes.length > 0); + // @ts-expect-error test string + const bytesStr = new BinaryWriter()[type](val.toString()).finish(); + assert.ok(bytesStr.length > 0); + assert.deepStrictEqual(bytesStr, bytes); + }); + } + for (const {val, err} of [ + { val: null, err: "invalid int32: object" }, + { val: new Date(), err: "invalid int32: object" }, + { val: undefined, err: "invalid int32: undefined" }, + { val: true, err: "invalid int32: boolean" }, + ]) { + void test(`should error for wrong type ${val}`, () => { + // @ts-expect-error TS2345 + assert.throws(() => new BinaryWriter()[type](val), {message: err}); + }); + } + for (const val of [ + 0x7fffffff + 1, -0x80000000 - 1, 3.14 + ]) { + void test(`should error for value out of range ${val}`, () => { + assert.throws(() => new BinaryWriter()[type](val), {message: /^invalid int32: .*/,}); + // @ts-expect-error test string + assert.throws(() => new BinaryWriter()[type](val.toString()), {message: /^invalid int32: .*/,}); + }); + } + }); + } // fixed32 and uint32 are unsigned 32-bit integers, just with different encoding - describe.each(["fixed32", "uint32"] as const)("%s()", (type) => { - it.each([0, 1024, 0xffffffff])("should encode %s", (val) => { - const bytes = new BinaryWriter()[type](val).finish(); - expect(bytes.length).toBeGreaterThan(0); - // @ts-expect-error test string - const bytesStr = new BinaryWriter()[type](val.toString()).finish(); - expect(bytesStr.length).toBeGreaterThan(0); - expect(bytesStr).toStrictEqual(bytes); - }); - it.each([ - { val: null, err: `invalid uint32: object` }, - { val: new Date(), err: `invalid uint32: object` }, - { val: undefined, err: `invalid uint32: undefined` }, - { val: true, err: `invalid uint32: bool` }, - ])("should error for wrong type $val", ({ val, err }) => { - // @ts-expect-error TS2345 - expect(() => new BinaryWriter()[type](val)).toThrow(err); + for (const type of ["fixed32", "uint32"] as const) { + void suite(`${type}()`, () => { + for (const val of [0, 1024, 0xffffffff]) { + void test(`should encode ${val}`, () => { + const bytes = new BinaryWriter()[type](val).finish(); + assert.ok(bytes.length > 0); + // @ts-expect-error test string + const bytesStr = new BinaryWriter()[type](val.toString()).finish(); + assert.ok(bytesStr.length > 0); + assert.deepStrictEqual(bytesStr, bytes); + }); + } + for (const {val, err} of [ + { val: null, err: `invalid uint32: object` }, + { val: new Date(), err: `invalid uint32: object` }, + { val: undefined, err: `invalid uint32: undefined` }, + { val: true, err: `invalid uint32: boolean` }, + ]) { + void test(`should error for wrong type ${val}`, () => { + // @ts-expect-error TS2345 + assert.throws(() => new BinaryWriter()[type](val), { + message: err, + }); + }); + } + for (const val of [0xffffffff + 1, -1, 3.14]) { + void test(`should error for value out of range ${val}`, () => { + assert.throws(() => new BinaryWriter()[type](val), + {message: /^invalid uint32: .*/} + ); + // @ts-expect-error test string + assert.throws(() => new BinaryWriter()[type](val.toString()), + {message: /^invalid uint32: .*/} + ); + }); + } }); - it.each([0xffffffff + 1, -1, 3.14])( - "should error for value out of range %s", - (val) => { - expect(() => new BinaryWriter()[type](val)).toThrow( - /^invalid uint32: .*/, - ); - // @ts-expect-error test string - expect(() => new BinaryWriter()[type](val.toString())).toThrow( - /^invalid uint32: .*/, - ); - }, - ); - }); - it("should be completely reset after finish", () => { + } + void test("should be completely reset after finish", () => { const writer = new BinaryWriter(); // Make sure we have both a chunk and a buffer writer.raw(new Uint8Array([1, 2, 3])).int32(1); @@ -142,13 +160,13 @@ describe("BinaryWriter", () => { // Reuse the same writer to write the same data writer.raw(new Uint8Array([1, 2, 3])).int32(1); const bytes2 = writer.finish(); - expect(bytes2).toStrictEqual(bytes); + assert.deepStrictEqual(bytes2, bytes); }); }); -describe("BinaryReader", () => { - describe("skip", () => { - it("should skip group", () => { +void suite("BinaryReader", () => { + void suite("skip", () => { + void test("should skip group", () => { const reader = new BinaryReader( new BinaryWriter() .tag(1, WireType.StartGroup) @@ -158,12 +176,12 @@ describe("BinaryReader", () => { .finish(), ); const [fieldNo, wireType] = reader.tag(); - expect(fieldNo).toBe(1); - expect(wireType).toBe(WireType.StartGroup); + assert.strictEqual(fieldNo, 1); + assert.strictEqual(wireType, WireType.StartGroup); reader.skip(WireType.StartGroup, 1); - expect(reader.pos).toBe(reader.len); + assert.strictEqual(reader.pos, reader.len); }); - it("should skip nested group", () => { + void test("should skip nested group", () => { const reader = new BinaryReader( new BinaryWriter() .tag(1, WireType.StartGroup) @@ -173,12 +191,12 @@ describe("BinaryReader", () => { .finish(), ); const [fieldNo, wireType] = reader.tag(); - expect(fieldNo).toBe(1); - expect(wireType).toBe(WireType.StartGroup); + assert.strictEqual(fieldNo, 1); + assert.strictEqual(wireType, WireType.StartGroup); reader.skip(WireType.StartGroup, 1); - expect(reader.pos).toBe(reader.len); + assert.strictEqual(reader.pos, reader.len); }); - it("should error on unexpected end group field number", () => { + void test("should error on unexpected end group field number", () => { const reader = new BinaryReader( new BinaryWriter() .tag(1, WireType.StartGroup) @@ -186,13 +204,13 @@ describe("BinaryReader", () => { .finish(), ); const [fieldNo, wireType] = reader.tag(); - expect(fieldNo).toBe(1); - expect(wireType).toBe(WireType.StartGroup); - expect(() => { + assert.strictEqual(fieldNo, 1); + assert.strictEqual(wireType, WireType.StartGroup); + assert.throws(() => { reader.skip(WireType.StartGroup, 1); - }).toThrow(/^invalid end group tag$/); + }, {message: /^invalid end group tag$/}); }); - it("should return skipped group data", () => { + void test("should return skipped group data", () => { const reader = new BinaryReader( new BinaryWriter() .tag(1, WireType.StartGroup) @@ -206,16 +224,16 @@ describe("BinaryReader", () => { const sr = new BinaryReader(skipped); { const [fieldNo, wireType] = sr.tag(); - expect(fieldNo).toBe(33); - expect(wireType).toBe(WireType.Varint); + assert.strictEqual(fieldNo, 33); + assert.strictEqual(wireType, WireType.Varint); const bool = sr.bool(); - expect(bool).toBe(true); + assert.strictEqual(bool, true); } { const [fieldNo, wireType] = sr.tag(); - expect(fieldNo).toBe(1); - expect(wireType).toBe(WireType.EndGroup); - expect(sr.pos).toBe(sr.len); + assert.strictEqual(fieldNo, 1); + assert.strictEqual(wireType, WireType.EndGroup); + assert.strictEqual(sr.pos, sr.len); } }); }); diff --git a/packages/protobuf-test/src/wire/size-delimited.test.ts b/packages/protobuf-test/src/wire/size-delimited.test.ts index f3128645a..a25b1116b 100644 --- a/packages/protobuf-test/src/wire/size-delimited.test.ts +++ b/packages/protobuf-test/src/wire/size-delimited.test.ts @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, it } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { BinaryReader, BinaryWriter, @@ -27,32 +28,32 @@ import { join } from "node:path"; import { tmpdir } from "node:os"; import { createReadStream, createWriteStream } from "node:fs"; -describe("sizeDelimitedEncode()", () => { +void suite("sizeDelimitedEncode()", () => { const desc = TestAllTypesProto3Schema; const msg = create(desc, { optionalBool: true, }); - it("should store length as varint", () => { + void test("should store length as varint", () => { const bytes = sizeDelimitedEncode(desc, msg); const reader = new BinaryReader(bytes); const storedLength = reader.uint32(); - expect(storedLength).toBe(toBinary(desc, msg).byteLength); + assert.strictEqual(storedLength, toBinary(desc, msg).byteLength); }); - it("should store serialized message", () => { + void test("should store serialized message", () => { const bytes = sizeDelimitedEncode(desc, msg); const storeMessageBytes = new BinaryReader(bytes).bytes(); - expect(storeMessageBytes).toStrictEqual(toBinary(desc, msg)); + assert.deepStrictEqual(storeMessageBytes, toBinary(desc, msg)); }); - it("should not store extra bytes", () => { + void test("should not store extra bytes", () => { const bytes = sizeDelimitedEncode(desc, msg); const reader = new BinaryReader(bytes); reader.skip(WireType.LengthDelimited); - expect(reader.pos).toBe(reader.len); + assert.strictEqual(reader.pos, reader.len); }); }); -describe("sizeDelimitedDecodeStream()", () => { - describe("with async generator", () => { +void suite("sizeDelimitedDecodeStream()", () => { + void suite("with async generator", () => { const desc = TestAllTypesProto3Schema; const testMessages = [ create(desc, { @@ -78,7 +79,7 @@ describe("sizeDelimitedDecodeStream()", () => { } } } - it("should decode stream", async () => { + void test("should decode stream", async () => { const stream = createAsyncIterableBytes( new BinaryWriter() .bytes(toBinary(desc, testMessages[0])) @@ -87,14 +88,14 @@ describe("sizeDelimitedDecodeStream()", () => { ); let i = 0; for await (const dec of sizeDelimitedDecodeStream(desc, stream)) { - expect(dec).toStrictEqual(testMessages[i]); + assert.deepStrictEqual(dec, testMessages[i]); i++; } - expect(i).toBe(2); + assert.strictEqual(i, 2); }); }); - describe("with Node.js APIS", () => { - it("should decode stream", async () => { + void suite("with Node.js APIS", () => { + void test("should decode stream", async () => { const desc = TestAllTypesProto3Schema; const testMessages = [ create(desc, { @@ -116,48 +117,49 @@ describe("sizeDelimitedDecodeStream()", () => { const readStream = createReadStream(path); let i = 0; for await (const m of sizeDelimitedDecodeStream(desc, readStream)) { - expect(m).toStrictEqual(testMessages[i]); + assert.deepStrictEqual(m, testMessages[i]); i++; } }); }); }); -describe("sizeDelimitedPeek()", () => { - describe.each([0, 1, 2, 4, 8, 16, 32, 64, 0xffffffff])( - "with just a size", - (size: number) => { +void suite("sizeDelimitedPeek()", () => { + for (const size of [0, 1, 2, 4, 8, 16, 32, 64, 0xffffffff]) { + void suite(`with just a size ${size}`, () => { const bytes = new BinaryWriter().uint32(size).finish(); - it("should return EOF", () => { + void test("should return EOF", () => { const got = sizeDelimitedPeek(bytes); - expect(got.size).toBe(size); + assert.strictEqual(got.size, size); }); - it("should return expected offset", () => { + void test("should return expected offset", () => { const got = sizeDelimitedPeek(bytes); - expect(got.offset).toBe(bytes.byteLength); + assert.strictEqual(got.offset, bytes.byteLength); }); - }, - ); - describe("with incomplete varint", () => { - const complete = new BinaryWriter().uint32(0xffffffff).finish(); // uint32 max is 5 bytes as varint - it.each([0, 1, 2, 3, 4])("should return EOF for %s", (x) => { - const bytes = complete.slice(0, x); - const got = sizeDelimitedPeek(bytes); - expect(got.eof).toBeTruthy(); }); + } + void suite("with incomplete varint", () => { + const complete = new BinaryWriter().uint32(0xffffffff).finish(); // uint32 max is 5 bytes as varint + for (const x of [0, 1, 2, 3, 4]) { + void test(`should return EOF for ${x}`, () => { + const bytes = complete.slice(0, x); + const got = sizeDelimitedPeek(bytes); + assert.strictEqual(got.eof, true); + }) + } }); - describe("with invalid varint", () => { + void suite("with invalid varint", () => { const invalid = new Uint8Array([ 0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, ]); - it("should raise error", () => { - expect(() => sizeDelimitedPeek(invalid)).toThrow({ + void test("should raise error", () => { + assert.throws(() => sizeDelimitedPeek(invalid), { name: "Error", message: "invalid varint", }); }); }); - describe("with size and message", () => { + void suite("with size and message", () => { const desc = TestAllTypesProto3Schema; const msg = create(desc, { optionalBool: true, @@ -167,13 +169,13 @@ describe("sizeDelimitedPeek()", () => { .uint32(msgBytes.byteLength) .raw(msgBytes) .finish(); - it("should return size", () => { + void test("should return size", () => { const got = sizeDelimitedPeek(bytes); - expect(got.size).toBe(msgBytes.byteLength); + assert.strictEqual(got.size, msgBytes.byteLength); }); - it("should return expected offset", () => { + void test("should return expected offset", () => { const got = sizeDelimitedPeek(bytes); - expect(got.offset).toBe(bytes.byteLength - msgBytes.byteLength); + assert.strictEqual(got.offset, bytes.byteLength - msgBytes.byteLength); }); }); }); diff --git a/packages/protobuf-test/src/wire/text-encoding.test.ts b/packages/protobuf-test/src/wire/text-encoding.test.ts index 089b65de3..cb7f62aab 100644 --- a/packages/protobuf-test/src/wire/text-encoding.test.ts +++ b/packages/protobuf-test/src/wire/text-encoding.test.ts @@ -12,53 +12,54 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { beforeEach, afterEach, describe, expect, test } from "@jest/globals"; +import { suite, test, beforeEach, afterEach } from "node:test"; +import * as assert from "node:assert"; import { getTextEncoding, configureTextEncoding, } from "@bufbuild/protobuf/wire"; -describe("getTextEncoding()", () => { - test("returns TextEncoding", () => { +void suite("getTextEncoding()", () => { + void test("returns TextEncoding", () => { const te = getTextEncoding(); - expect(te).toBeDefined(); + assert.ok(te !== undefined); }); - test("returns same TextEncoding", () => { + void test("returns same TextEncoding", () => { const te1 = getTextEncoding(); const te2 = getTextEncoding(); - expect(te2).toBe(te1); + assert.strictEqual(te2, te1); }); - describe("encodeUtf8()", () => { - test("encodes", () => { + void suite("encodeUtf8()", () => { + void test("encodes", () => { const bytes = getTextEncoding().encodeUtf8("hello 🌍"); - expect(bytes).toStrictEqual( + assert.deepStrictEqual(bytes, new Uint8Array([104, 101, 108, 108, 111, 32, 240, 159, 140, 141]), ); }); }); - describe("decodeUtf8()", () => { - test("decodes", () => { + void suite("decodeUtf8()", () => { + void test("decodes", () => { const text = getTextEncoding().decodeUtf8( new Uint8Array([104, 101, 108, 108, 111, 32, 240, 159, 140, 141]), ); - expect(text).toBe("hello 🌍"); + assert.strictEqual(text, "hello 🌍"); }); }); - describe("checkUtf8()", () => { - test("returns true for valid", () => { + void suite("checkUtf8()", () => { + void test("returns true for valid", () => { const valid = "🌍"; const ok = getTextEncoding().checkUtf8(valid); - expect(ok).toBe(true); + assert.strictEqual(ok, true); }); - test("returns false for invalid", () => { + void test("returns false for invalid", () => { const invalid = "🌍".substring(0, 1); const ok = getTextEncoding().checkUtf8(invalid); - expect(ok).toBe(false); + assert.strictEqual(ok, false); }); }); }); -describe("configureTextEncoding()", () => { +void suite("configureTextEncoding()", () => { let backup: ReturnType; beforeEach(() => { backup = getTextEncoding(); @@ -66,7 +67,7 @@ describe("configureTextEncoding()", () => { afterEach(() => { configureTextEncoding(backup); }); - test("configures checkUtf8", () => { + void test("configures checkUtf8", () => { configureTextEncoding({ checkUtf8(text: string): boolean { if (text === "valid") { @@ -77,10 +78,10 @@ describe("configureTextEncoding()", () => { decodeUtf8: backup.decodeUtf8, encodeUtf8: backup.encodeUtf8, }); - expect(getTextEncoding().checkUtf8("valid")).toBe(true); - expect(getTextEncoding().checkUtf8("no valid")).toBe(false); + assert.strictEqual(getTextEncoding().checkUtf8("valid"), true); + assert.strictEqual(getTextEncoding().checkUtf8("no valid"), false); }); - test("configures decodeUtf8", () => { + void test("configures decodeUtf8", () => { let arg: Uint8Array | undefined; configureTextEncoding({ checkUtf8: backup.checkUtf8, @@ -92,10 +93,10 @@ describe("configureTextEncoding()", () => { }); const bytes = new Uint8Array(10); const text = getTextEncoding().decodeUtf8(bytes); - expect(text).toBe("custom decodeUtf8"); - expect(arg).toBe(bytes); + assert.strictEqual(text, "custom decodeUtf8"); + assert.strictEqual(arg, bytes); }); - test("configures encodeUtf8", () => { + void test("configures encodeUtf8", () => { let arg: string | undefined; configureTextEncoding({ checkUtf8: backup.checkUtf8, @@ -105,9 +106,9 @@ describe("configureTextEncoding()", () => { return new Uint8Array(10); }, }); - expect(getTextEncoding().encodeUtf8("test")).toStrictEqual( + assert.deepStrictEqual(getTextEncoding().encodeUtf8("test"), new Uint8Array(10), ); - expect(arg).toBe("test"); + assert.strictEqual(arg, "test"); }); }); From b87937082890fc489604406a0f95d4ca8a7528e1 Mon Sep 17 00:00:00 2001 From: Timo Stamm Date: Mon, 18 Aug 2025 16:56:55 +0200 Subject: [PATCH 05/16] Migrate protobuf-test wkt/* --- packages/protobuf-test/src/wkt/any.test.ts | 99 ++++++++++--------- .../protobuf-test/src/wkt/timestamp.test.ts | 81 ++++++++------- .../protobuf-test/src/wkt/wrapper.test.ts | 47 ++++----- 3 files changed, 114 insertions(+), 113 deletions(-) diff --git a/packages/protobuf-test/src/wkt/any.test.ts b/packages/protobuf-test/src/wkt/any.test.ts index e33f5f05b..5b937dbeb 100644 --- a/packages/protobuf-test/src/wkt/any.test.ts +++ b/packages/protobuf-test/src/wkt/any.test.ts @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { create, createRegistry, @@ -31,59 +32,59 @@ import { DurationSchema, } from "@bufbuild/protobuf/wkt"; -describe("anyIs", () => { - test(`matches standard type URL`, () => { +void suite("anyIs", () => { + void test(`matches standard type URL`, () => { const any = create(AnySchema, { typeUrl: "type.googleapis.com/google.protobuf.Value", }); - expect(anyIs(any, ValueSchema)).toBe(true); + assert.strictEqual(anyIs(any, ValueSchema), true); }); - test(`matches short type URL`, () => { + void test(`matches short type URL`, () => { const any = create(AnySchema, { typeUrl: "/google.protobuf.Value" }); - expect(anyIs(any, ValueSchema)).toBe(true); + assert.strictEqual(anyIs(any, ValueSchema), true); }); - test(`matches custom type URL`, () => { + void test(`matches custom type URL`, () => { const any = create(AnySchema, { typeUrl: "example.com/google.protobuf.Value", }); - expect(anyIs(any, ValueSchema)).toBe(true); + assert.strictEqual(anyIs(any, ValueSchema), true); }); - test("accepts type name string", () => { + void test("accepts type name string", () => { const any = create(AnySchema, { typeUrl: "/google.protobuf.Value" }); - expect(anyIs(any, "google.protobuf.Value")).toBe(true); - expect(anyIs(any, "google.protobuf.Duration")).toBe(false); + assert.strictEqual(anyIs(any, "google.protobuf.Value"), true); + assert.strictEqual(anyIs(any, "google.protobuf.Duration"), false); }); - test("accepts empty type name string", () => { + void test("accepts empty type name string", () => { const any = create(AnySchema, { typeUrl: "/google.protobuf.Value" }); - expect(anyIs(any, "")).toBe(false); - expect(anyIs(create(AnySchema), "")).toBe(false); + assert.strictEqual(anyIs(any, ""), false); + assert.strictEqual(anyIs(create(AnySchema), ""), false); }); - test("returns false for an empty Any", () => { + void test("returns false for an empty Any", () => { const any = create(AnySchema); - expect(anyIs(any, ValueSchema)).toBe(false); - expect(anyIs(any, "google.protobuf.Value")).toBe(false); - expect(anyIs(any, "")).toBe(false); + assert.strictEqual(anyIs(any, ValueSchema), false); + assert.strictEqual(anyIs(any, "google.protobuf.Value"), false); + assert.strictEqual(anyIs(any, ""), false); }); - test("returns false for different type", () => { + void test("returns false for different type", () => { const any = create(AnySchema, { typeUrl: "type.googleapis.com/google.protobuf.Value", }); - expect(anyIs(any, DurationSchema)).toBe(false); - expect(anyIs(any, "google.protobuf.Duration")).toBe(false); + assert.strictEqual(anyIs(any, DurationSchema), false); + assert.strictEqual(anyIs(any, "google.protobuf.Duration"), false); }); }); -describe("anyUnpack()", () => { - describe("with a schema", () => { - test("returns undefined if the Any is empty", () => { +void suite("anyUnpack()", () => { + void suite("with a schema", () => { + void test("returns undefined if the Any is empty", () => { const any = create(AnySchema, { typeUrl: "", value: new Uint8Array(), }); const unpacked: FieldMask | undefined = anyUnpack(any, FieldMaskSchema); - expect(unpacked).toBeUndefined(); + assert.strictEqual(unpacked, undefined); }); - test("returns undefined if the Any contains a different type", () => { + void test("returns undefined if the Any contains a different type", () => { const any = create(AnySchema, { typeUrl: "type.googleapis.com/google.protobuf.Duration", value: toBinary( @@ -94,9 +95,9 @@ describe("anyUnpack()", () => { ), }); const unpacked: FieldMask | undefined = anyUnpack(any, FieldMaskSchema); - expect(unpacked).toBeUndefined(); + assert.strictEqual(unpacked, undefined); }); - test("returns unpacked", () => { + void test("returns unpacked", () => { const val = create(FieldMaskSchema, { paths: ["foo"], }); @@ -105,48 +106,48 @@ describe("anyUnpack()", () => { value: toBinary(FieldMaskSchema, val), }); const unpacked: FieldMask | undefined = anyUnpack(any, FieldMaskSchema); - expect(unpacked).toBeDefined(); - expect(unpacked?.paths).toStrictEqual(["foo"]); + assert.ok(unpacked !== undefined); + assert.deepStrictEqual(unpacked?.paths, ["foo"]); }); }); - describe("with a registry", () => { - test("returns undefined if the Any is empty", () => { + void suite("with a registry", () => { + void test("returns undefined if the Any is empty", () => { const any = create(AnySchema); const unpacked: Message | undefined = anyUnpack(any, createRegistry()); - expect(unpacked).toBeUndefined(); + assert.strictEqual(unpacked, undefined); }); - test(`returns undefined if message not in the registry`, () => { + void test(`returns undefined if message not in the registry`, () => { const registry = createRegistry(); const val = create(ValueSchema, { kind: { case: "numberValue", value: 1 }, }); const any = anyPack(ValueSchema, val); const unpacked = anyUnpack(any, registry); - expect(unpacked).toBeUndefined(); + assert.strictEqual(unpacked, undefined); }); - test(`returns unpacked`, () => { + void test(`returns unpacked`, () => { const typeRegistry = createRegistry(ValueSchema); const val = create(ValueSchema, { kind: { case: "numberValue", value: 1 }, }); const any = anyPack(ValueSchema, val); const unpacked: Message | undefined = anyUnpack(any, typeRegistry); - expect(unpacked).toStrictEqual(val); + assert.deepStrictEqual(unpacked, val); }); }); }); -describe("anyUnpackTo()", () => { - test("returns undefined if the Any is empty", () => { +void suite("anyUnpackTo()", () => { + void test("returns undefined if the Any is empty", () => { const any = create(AnySchema); const unpacked: FieldMask | undefined = anyUnpackTo( any, FieldMaskSchema, create(FieldMaskSchema), ); - expect(unpacked).toBeUndefined(); + assert.strictEqual(unpacked, undefined); }); - test("returns undefined if the Any contains a different type", () => { + void test("returns undefined if the Any contains a different type", () => { const any = create(AnySchema, { typeUrl: "type.googleapis.com/google.protobuf.Duration", value: toBinary( @@ -161,9 +162,9 @@ describe("anyUnpackTo()", () => { FieldMaskSchema, create(FieldMaskSchema), ); - expect(unpacked).toBeUndefined(); + assert.strictEqual(unpacked, undefined); }); - test("returns unpacked", () => { + void test("returns unpacked", () => { const val = create(FieldMaskSchema, { paths: ["foo"], }); @@ -176,10 +177,10 @@ describe("anyUnpackTo()", () => { FieldMaskSchema, create(FieldMaskSchema), ); - expect(unpacked).toBeDefined(); - expect(unpacked?.paths).toStrictEqual(["foo"]); + assert.ok(unpacked !== undefined); + assert.deepStrictEqual(unpacked?.paths, ["foo"]); }); - test("merges into target", () => { + void test("merges into target", () => { const val = create(FieldMaskSchema, { paths: ["foo"], }); @@ -195,8 +196,8 @@ describe("anyUnpackTo()", () => { FieldMaskSchema, target, ); - expect(unpacked).toBeDefined(); - expect(unpacked?.paths).toStrictEqual(["bar", "foo"]); - expect(target.paths).toStrictEqual(["bar", "foo"]); + assert.ok(unpacked !== undefined); + assert.deepStrictEqual(unpacked?.paths, ["bar", "foo"]); + assert.deepStrictEqual(target.paths, ["bar", "foo"]); }); }); diff --git a/packages/protobuf-test/src/wkt/timestamp.test.ts b/packages/protobuf-test/src/wkt/timestamp.test.ts index 529b445b5..ce1c85b65 100644 --- a/packages/protobuf-test/src/wkt/timestamp.test.ts +++ b/packages/protobuf-test/src/wkt/timestamp.test.ts @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { timestampNow, timestampFromDate, @@ -23,91 +24,89 @@ import { } from "@bufbuild/protobuf/wkt"; import { create, protoInt64 } from "@bufbuild/protobuf"; -describe("timestampNow()", () => { - test("uses current time", () => { +void suite("timestampNow()", () => { + void test("uses current time", () => { const timestamp = timestampNow(); const wantMs = Date.now(); const gotMs = timestampMs(timestamp); const leewayMs = 50; - expect(gotMs).toBeGreaterThanOrEqual(wantMs - leewayMs); - expect(gotMs).toBeLessThanOrEqual(wantMs + leewayMs); + assert.ok(gotMs >= (wantMs - leewayMs)); + assert.ok(gotMs <= (wantMs + leewayMs)); }); }); -describe("timestampMs()", () => { - test("converts Timestamp to unix timestamp with milliseconds", () => { - expect( +void suite("timestampMs()", () => { + void test("converts Timestamp to unix timestamp with milliseconds", () => { + assert.strictEqual( timestampMs( create(TimestampSchema, { seconds: protoInt64.zero, nanos: 0, }), - ), - ).toBe(0); - expect( + ), 0); + assert.strictEqual( timestampMs( create(TimestampSchema, { seconds: protoInt64.parse(818035920), nanos: 123456789, }), - ), - ).toBe(818035920123); + ), 818035920123); }); }); -describe("timestampFromMs()", () => { - test("converts unix timestamp with milliseconds to Timestamp", () => { +void suite("timestampFromMs()", () => { + void test("converts unix timestamp with milliseconds to Timestamp", () => { const timestampZero = timestampFromMs(0); - expect(Number(timestampZero.seconds)).toBe(0); - expect(timestampZero.nanos).toBe(0); + assert.strictEqual(Number(timestampZero.seconds), 0); + assert.strictEqual(timestampZero.nanos, 0); const timestampWithMs = timestampFromMs(818035920123); - expect(Number(timestampWithMs.seconds)).toBe(818035920); - expect(timestampWithMs.nanos).toBe(123000000); + assert.strictEqual(Number(timestampWithMs.seconds), 818035920); + assert.strictEqual(timestampWithMs.nanos, 123000000); }); - test("1000 ms", () => { + void test("1000 ms", () => { const ts = timestampFromMs(1000); - expect(Number(ts.seconds)).toBe(1); - expect(ts.nanos).toBe(0); + assert.strictEqual(Number(ts.seconds), 1); + assert.strictEqual(ts.nanos, 0); }); - test("1020 ms", () => { + void test("1020 ms", () => { const ts = timestampFromMs(1020); - expect(Number(ts.seconds)).toBe(1); - expect(ts.nanos).toBe(20 * 1000000); + assert.strictEqual(Number(ts.seconds), 1); + assert.strictEqual(ts.nanos, 20 * 1000000); }); - test("-1070 ms", () => { + void test("-1070 ms", () => { const ts = timestampFromMs(-1070); - expect(Number(ts.seconds)).toBe(-2); - expect(ts.nanos).toBe(930 * 1000000); + assert.strictEqual(Number(ts.seconds), -2); + assert.strictEqual(ts.nanos, 930 * 1000000); }); - test("-1000 ms", () => { + void test("-1000 ms", () => { const ts = timestampFromMs(-1000); - expect(Number(ts.seconds)).toBe(-1); - expect(ts.nanos).toBe(0); + assert.strictEqual(Number(ts.seconds), -1); + assert.strictEqual(ts.nanos, 0); }); }); -describe("timestampFromDate()", () => { - test("converts Date to Timestamp", () => { +void suite("timestampFromDate()", () => { + void test("converts Date to Timestamp", () => { const timestampZero = timestampFromDate(new Date(0)); - expect(Number(timestampZero.seconds)).toBe(0); - expect(timestampZero.nanos).toBe(0); + assert.strictEqual(Number(timestampZero.seconds), 0); + assert.strictEqual(timestampZero.nanos, 0); const timestampWithMs = timestampFromDate(new Date(818035920123)); - expect(Number(timestampWithMs.seconds)).toBe(818035920); - expect(timestampWithMs.nanos).toBe(123000000); + assert.strictEqual(Number(timestampWithMs.seconds), 818035920); + assert.strictEqual(timestampWithMs.nanos, 123000000); }); }); -describe("timestampDate()", () => { - test("converts Timestamp to Date", () => { +void suite("timestampDate()", () => { + void test("converts Timestamp to Date", () => { const timestampZero = create(TimestampSchema, { seconds: protoInt64.zero, nanos: 0, }); - expect(timestampDate(timestampZero).getTime()).toBe(0); + assert.strictEqual(timestampDate(timestampZero).getTime(), 0); const timestampWithMs = create(TimestampSchema, { seconds: protoInt64.parse(818035920), nanos: 123000000, }); - expect(timestampDate(timestampWithMs).getTime()).toBe(818035920123); + assert.strictEqual(timestampDate(timestampWithMs).getTime(), 818035920123); }); }); diff --git a/packages/protobuf-test/src/wkt/wrapper.test.ts b/packages/protobuf-test/src/wkt/wrapper.test.ts index 8ed742f81..b3e1acbdc 100644 --- a/packages/protobuf-test/src/wkt/wrapper.test.ts +++ b/packages/protobuf-test/src/wkt/wrapper.test.ts @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { create } from "@bufbuild/protobuf"; import { isWrapper, @@ -28,30 +29,30 @@ import { UInt64ValueSchema, } from "@bufbuild/protobuf/wkt"; -describe("isWrapper()", () => { - test("returns true for any of the wrapper messages from wrappers.proto", () => { - expect(isWrapper(create(DoubleValueSchema))).toBe(true); - expect(isWrapper(create(FloatValueSchema))).toBe(true); - expect(isWrapper(create(Int64ValueSchema))).toBe(true); - expect(isWrapper(create(UInt64ValueSchema))).toBe(true); - expect(isWrapper(create(Int32ValueSchema))).toBe(true); - expect(isWrapper(create(UInt32ValueSchema))).toBe(true); - expect(isWrapper(create(BoolValueSchema))).toBe(true); - expect(isWrapper(create(StringValueSchema))).toBe(true); - expect(isWrapper(create(BytesValueSchema))).toBe(true); +void suite("isWrapper()", () => { + void test("returns true for any of the wrapper messages from wrappers.proto", () => { + assert.strictEqual(isWrapper(create(DoubleValueSchema)), true); + assert.strictEqual(isWrapper(create(FloatValueSchema)), true); + assert.strictEqual(isWrapper(create(Int64ValueSchema)), true); + assert.strictEqual(isWrapper(create(UInt64ValueSchema)), true); + assert.strictEqual(isWrapper(create(Int32ValueSchema)), true); + assert.strictEqual(isWrapper(create(UInt32ValueSchema)), true); + assert.strictEqual(isWrapper(create(BoolValueSchema)), true); + assert.strictEqual(isWrapper(create(StringValueSchema)), true); + assert.strictEqual(isWrapper(create(BytesValueSchema)), true); }); }); -describe("isWrapperDesc()", () => { - test("returns true for any of the wrapper messages from wrappers.proto", () => { - expect(isWrapperDesc(DoubleValueSchema)).toBe(true); - expect(isWrapperDesc(FloatValueSchema)).toBe(true); - expect(isWrapperDesc(Int64ValueSchema)).toBe(true); - expect(isWrapperDesc(UInt64ValueSchema)).toBe(true); - expect(isWrapperDesc(Int32ValueSchema)).toBe(true); - expect(isWrapperDesc(UInt32ValueSchema)).toBe(true); - expect(isWrapperDesc(BoolValueSchema)).toBe(true); - expect(isWrapperDesc(StringValueSchema)).toBe(true); - expect(isWrapperDesc(BytesValueSchema)).toBe(true); +void suite("isWrapperDesc()", () => { + void test("returns true for any of the wrapper messages from wrappers.proto", () => { + assert.strictEqual(isWrapperDesc(DoubleValueSchema), true); + assert.strictEqual(isWrapperDesc(FloatValueSchema), true); + assert.strictEqual(isWrapperDesc(Int64ValueSchema), true); + assert.strictEqual(isWrapperDesc(UInt64ValueSchema), true); + assert.strictEqual(isWrapperDesc(Int32ValueSchema), true); + assert.strictEqual(isWrapperDesc(UInt32ValueSchema), true); + assert.strictEqual(isWrapperDesc(BoolValueSchema), true); + assert.strictEqual(isWrapperDesc(StringValueSchema), true); + assert.strictEqual(isWrapperDesc(BytesValueSchema), true); }); }); From ea53e590e3d3ae5ab2fe03febd71c396f886e99e Mon Sep 17 00:00:00 2001 From: Timo Stamm Date: Mon, 18 Aug 2025 17:59:33 +0200 Subject: [PATCH 06/16] Migrate protobuf-test --- packages/protobuf-test/src/binary.test.ts | 41 +- packages/protobuf-test/src/clone.test.ts | 183 +-- packages/protobuf-test/src/create.test.ts | 1122 +++++++++-------- .../src/edition2023-serialize.test.ts | 73 +- .../src/enum-open-closed.test.ts | 35 +- packages/protobuf-test/src/equals.test.ts | 138 +- packages/protobuf-test/src/extensions.test.ts | 344 +++-- 7 files changed, 975 insertions(+), 961 deletions(-) diff --git a/packages/protobuf-test/src/binary.test.ts b/packages/protobuf-test/src/binary.test.ts index cb31c85f3..dee564cb2 100644 --- a/packages/protobuf-test/src/binary.test.ts +++ b/packages/protobuf-test/src/binary.test.ts @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { create, setExtension, @@ -35,7 +36,6 @@ import { MapsMessageSchema, } from "./gen/ts/extra/msg-maps_pb.js"; import { MessageFieldMessageSchema } from "./gen/ts/extra/msg-message_pb.js"; - import { Proto2ExtendeeSchema, string_ext, @@ -44,7 +44,8 @@ import { OneofMessageSchema } from "./gen/ts/extra/msg-oneof_pb.js"; import { JsonNamesMessageSchema } from "./gen/ts/extra/msg-json-names_pb.js"; import { JSTypeProto2NormalMessageSchema } from "./gen/ts/extra/jstype-proto2_pb.js"; -describe(`binary serialization`, () => { + +void suite(`binary serialization`, () => { testBinary(ScalarValuesMessageSchema, { doubleField: 0.75, floatField: -0.75, @@ -119,7 +120,7 @@ describe(`binary serialization`, () => { int32EnuField: { 1: 0, 2: 1, 0: 2 }, int64EnuField: { "-1": 0, "2": 1, "0": 2 }, }); - test(MapsMessageBug1183Schema.typeName, () => { + void test(MapsMessageBug1183Schema.typeName, () => { const str128bytes = "x".repeat(128); const msg = create(MapsMessageBug1183Schema, { map: { @@ -128,10 +129,10 @@ describe(`binary serialization`, () => { }); const bytes = toBinary(MapsMessageBug1183Schema, msg); const msg2 = fromBinary(MapsMessageBug1183Schema, bytes); - expect(msg2.map).toStrictEqual({ + assert.deepStrictEqual(msg2.map, { [str128bytes]: 1, }); - expect(msg2.$unknown).toBeUndefined(); + assert.strictEqual(msg2.$unknown, undefined); }); testBinary(OneofMessageSchema, { message: { @@ -167,11 +168,11 @@ describe(`binary serialization`, () => { b: { kind: { case: "stringValue", value: "abc" } }, }, }); - describe("Value", () => { + void suite("Value", () => { testBinary(ValueSchema, { kind: { case: "boolValue", value: true }, }); - describe("Value with Struct field", () => { + void suite("Value with Struct field", () => { testBinary(ValueSchema, { kind: { case: "structValue", @@ -184,11 +185,11 @@ describe(`binary serialization`, () => { }); }); }); - describe("extensions", () => { - test("encode and decode an extension", () => { + void suite("extensions", () => { + void test("encode and decode an extension", () => { const extendee = create(Proto2ExtendeeSchema); setExtension(extendee, string_ext, "foo"); - expect( + assert.strictEqual( getExtension( fromBinary( Proto2ExtendeeSchema, @@ -196,18 +197,18 @@ describe(`binary serialization`, () => { ), string_ext, ), - ).toEqual("foo"); + "foo", + ); }); }); - test("error for invalid data", () => { + void test("error for invalid data", () => { const msg = create(ScalarValuesMessageSchema, { uint32Field: -1, // -1 is invalid for a uint }); - expect(() => toBinary(ScalarValuesMessageSchema, msg)).toThrow( - new Error( - "cannot encode field spec.ScalarValuesMessage.uint32_field to binary: invalid uint32: -1", - ), - ); + assert.throws(() => toBinary(ScalarValuesMessageSchema, msg), { + name: "Error", + message: "cannot encode field spec.ScalarValuesMessage.uint32_field to binary: invalid uint32: -1", + }); }); }); @@ -215,8 +216,8 @@ function testBinary( desc: Desc, init: MessageInitShape, ) { - test(desc.typeName, () => { + void test(desc.typeName, () => { const msg = create(desc, init); - expect(fromBinary(desc, toBinary(desc, msg))).toStrictEqual(msg); + assert.deepStrictEqual(fromBinary(desc, toBinary(desc, msg)), msg); }); } diff --git a/packages/protobuf-test/src/clone.test.ts b/packages/protobuf-test/src/clone.test.ts index 9db2b7d32..d1f14b91d 100644 --- a/packages/protobuf-test/src/clone.test.ts +++ b/packages/protobuf-test/src/clone.test.ts @@ -12,38 +12,39 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { beforeEach, describe, expect, test } from "@jest/globals"; +import { suite, test, beforeEach } from "node:test"; +import * as assert from "node:assert"; import { clone, create, protoInt64 } from "@bufbuild/protobuf"; import { WireType } from "@bufbuild/protobuf/wire"; import { reflect } from "@bufbuild/protobuf/reflect"; import * as proto3_ts from "./gen/ts/extra/proto3_pb.js"; import * as proto2_ts from "./gen/ts/extra/proto2_pb.js"; -describe("clone()", () => { - test("clones unknown fields", () => { +void suite("clone()", () => { + void test("clones unknown fields", () => { const msg = create(proto3_ts.Proto3MessageSchema); msg.$unknown = [ { no: 10100, wireType: WireType.Varint, data: new Uint8Array([0]) }, ]; const copy = clone(proto3_ts.Proto3MessageSchema, msg); - expect(copy.$unknown).toStrictEqual(msg.$unknown); + assert.deepStrictEqual(copy.$unknown, msg.$unknown); }); - test("clones unknown fields in message field", () => { + void test("clones unknown fields in message field", () => { const msg = create(proto3_ts.Proto3MessageSchema); msg.singularMessageField = create(proto3_ts.Proto3MessageSchema); msg.singularMessageField.$unknown = [ { no: 10100, wireType: WireType.Varint, data: new Uint8Array([0]) }, ]; const copy = clone(proto3_ts.Proto3MessageSchema, msg); - expect(copy.singularMessageField?.$unknown).toStrictEqual( + assert.deepStrictEqual(copy.singularMessageField?.$unknown, msg.singularMessageField.$unknown, ); // Make sure it is copy - expect(copy.singularMessageField?.$unknown).not.toBe( + assert.notStrictEqual(copy.singularMessageField?.$unknown, msg.singularMessageField.$unknown, ); }); - describe("clones proto3 message", () => { + void suite("clones proto3 message", () => { const desc = proto3_ts.Proto3MessageSchema; let msg: proto3_ts.Proto3Message; beforeEach(() => { @@ -74,85 +75,87 @@ describe("clone()", () => { // oneof msg.either = { case: "oneofBoolField", value: false }; }); - test.each(desc.fields)("$name presence", (field) => { + for (const field of desc.fields) { + void test(`${field.toString()} presence`, () => { + const copy = clone(desc, msg); + const reflectMsg = reflect(desc, msg); + const reflectCopy = reflect(desc, copy); + assert.strictEqual(reflectCopy.isSet(field), reflectMsg.isSet(field)); + }); + } + void test("singularStringField", () => { const copy = clone(desc, msg); - const reflectMsg = reflect(desc, msg); - const reflectCopy = reflect(desc, copy); - expect(reflectCopy.isSet(field)).toBe(reflectMsg.isSet(field)); + assert.strictEqual(copy.singularStringField, msg.singularStringField); }); - test("singularStringField", () => { + void test("singularBytesField", () => { const copy = clone(desc, msg); - expect(copy.singularStringField).toBe(msg.singularStringField); + assert.notStrictEqual(copy.singularBytesField, msg.singularBytesField); + assert.deepStrictEqual(copy.singularBytesField, msg.singularBytesField); }); - test("singularBytesField", () => { + void test("singularMessageField", () => { const copy = clone(desc, msg); - expect(copy.singularBytesField).not.toBe(msg.singularBytesField); - expect(copy.singularBytesField).toStrictEqual(msg.singularBytesField); + assert.notStrictEqual(copy.singularMessageField, msg.singularMessageField); + assert.deepStrictEqual(copy.singularMessageField, msg.singularMessageField); }); - test("singularMessageField", () => { + void test("optionalWrappedUint32Field", () => { const copy = clone(desc, msg); - expect(copy.singularMessageField).not.toBe(msg.singularMessageField); - expect(copy.singularMessageField).toStrictEqual(msg.singularMessageField); - }); - test("optionalWrappedUint32Field", () => { - const copy = clone(desc, msg); - expect(copy.optionalWrappedUint32Field).toBe( + assert.strictEqual(copy.optionalWrappedUint32Field, msg.optionalWrappedUint32Field, ); - expect(copy.optionalWrappedUint32Field).toStrictEqual( + assert.deepStrictEqual(copy.optionalWrappedUint32Field, msg.optionalWrappedUint32Field, ); }); - test("repeatedStringField", () => { + void test("repeatedStringField", () => { const copy = clone(desc, msg); - expect(copy.repeatedStringField).not.toBe(msg.repeatedStringField); - expect(copy.repeatedStringField).toStrictEqual(msg.repeatedStringField); + assert.notStrictEqual(copy.repeatedStringField, msg.repeatedStringField); + assert.deepStrictEqual(copy.repeatedStringField, msg.repeatedStringField); }); - test("repeatedMessageField", () => { + void test("repeatedMessageField", () => { const copy = clone(desc, msg); - expect(copy.repeatedMessageField).not.toBe(msg.repeatedMessageField); - expect(copy.repeatedMessageField.length).toBe(2); - expect(copy.repeatedMessageField[0]).not.toBe( + assert.notStrictEqual(copy.repeatedMessageField, msg.repeatedMessageField); + assert.strictEqual(copy.repeatedMessageField.length, 2); + assert.notStrictEqual(copy.repeatedMessageField[0], msg.repeatedMessageField[0], ); - expect(copy.repeatedMessageField[0]).toStrictEqual( + assert.deepStrictEqual(copy.repeatedMessageField[0], msg.repeatedMessageField[0], ); - expect(copy.repeatedMessageField[1]).not.toBe( + assert.notStrictEqual(copy.repeatedMessageField[1], msg.repeatedMessageField[1], ); - expect(copy.repeatedMessageField[1]).toStrictEqual( + assert.deepStrictEqual(copy.repeatedMessageField[1], msg.repeatedMessageField[1], ); }); - test("mapStringStringField", () => { + void test("mapStringStringField", () => { const copy = clone(desc, msg); - expect(copy.mapStringStringField).not.toBe(msg.mapStringStringField); - expect(copy.mapStringStringField).toStrictEqual(msg.mapStringStringField); + assert.notStrictEqual(copy.mapStringStringField, msg.mapStringStringField); + assert.deepStrictEqual(copy.mapStringStringField, msg.mapStringStringField); }); - test("mapInt32MessageField", () => { + void test("mapInt32MessageField", () => { const copy = clone(desc, msg); - expect(copy.mapInt32MessageField).not.toBe(msg.mapInt32MessageField); - expect(Object.keys(copy)).toStrictEqual(Object.keys(msg)); - expect(copy.mapInt32MessageField[123]).not.toBe( + assert.notStrictEqual(copy.mapInt32MessageField, msg.mapInt32MessageField); + assert.deepStrictEqual(Object.keys(copy), Object.keys(msg)); + assert.notStrictEqual(copy.mapInt32MessageField[123], msg.mapInt32MessageField[123], ); - expect(copy.mapInt32MessageField[123]).toStrictEqual( + assert.deepStrictEqual(copy.mapInt32MessageField[123], msg.mapInt32MessageField[123], ); }); - test("oneofBoolField", () => { + void test("oneofBoolField", () => { const copy = clone(desc, msg); - expect(copy.either).toStrictEqual(msg.either); + assert.deepStrictEqual(copy.either, msg.either); }); - test("oneofMessageField", () => { + void test("oneofMessageField", () => { msg.either = { case: "oneofMessageField", value: create(desc) }; const copy = clone(desc, msg); - expect(copy.either.case).toBe(msg.either.case); - expect(copy.either.value).not.toBe(msg.either.value); + assert.strictEqual(copy.either.case, msg.either.case); + assert.notStrictEqual(copy.either.value, msg.either.value); }); }); - describe("clones proto2 message", () => { + void suite("clones proto2 message", () => { const desc = proto2_ts.Proto2MessageSchema; let msg: proto2_ts.Proto2Message; beforeEach(() => { @@ -214,82 +217,84 @@ describe("clone()", () => { // oneof msg.either = { case: "oneofBoolField", value: false }; }); - test.each(desc.fields)("$name presence", (field) => { - const copy = clone(desc, msg); - const reflectMsg = reflect(desc, msg); - const reflectCopy = reflect(desc, copy); - expect(reflectCopy.isSet(field)).toBe(reflectMsg.isSet(field)); - }); - test("requiredStringField", () => { + for (const field of desc.fields) { + void test(`${field.toString()} presence`, () => { + const copy = clone(desc, msg); + const reflectMsg = reflect(desc, msg); + const reflectCopy = reflect(desc, copy); + assert.strictEqual(reflectCopy.isSet(field), reflectMsg.isSet(field)); + }); + } + void test("requiredStringField", () => { const copy = clone(desc, msg); - expect(copy.requiredStringField).toBe(msg.requiredStringField); + assert.strictEqual(copy.requiredStringField, msg.requiredStringField); }); - test("requiredBytesField", () => { + void test("requiredBytesField", () => { const copy = clone(desc, msg); - expect(copy.requiredBytesField).not.toBe(msg.requiredBytesField); - expect(copy.requiredBytesField).toStrictEqual(msg.requiredBytesField); + assert.notStrictEqual(copy.requiredBytesField, msg.requiredBytesField); + assert.deepStrictEqual(copy.requiredBytesField, msg.requiredBytesField); }); - test("requiredMessageField", () => { + void test("requiredMessageField", () => { const copy = clone(desc, msg); - expect(copy.requiredMessageField).not.toBe(msg.requiredMessageField); - expect(copy.requiredMessageField).toStrictEqual(msg.requiredMessageField); + assert.notStrictEqual(copy.requiredMessageField, msg.requiredMessageField); + assert.deepStrictEqual(copy.requiredMessageField, msg.requiredMessageField); }); - test("optionalWrappedUint32Field", () => { + void test("optionalWrappedUint32Field", () => { const copy = clone(desc, msg); - expect(copy.optionalWrappedUint32Field).toBe( + assert.strictEqual(copy.optionalWrappedUint32Field, msg.optionalWrappedUint32Field, ); - expect(copy.optionalWrappedUint32Field).toStrictEqual( + assert.deepStrictEqual(copy.optionalWrappedUint32Field, msg.optionalWrappedUint32Field, ); }); - test("repeatedStringField", () => { + void test("repeatedStringField", () => { const copy = clone(desc, msg); - expect(copy.repeatedStringField).not.toBe(msg.repeatedStringField); - expect(copy.repeatedStringField).toStrictEqual(msg.repeatedStringField); + assert.notStrictEqual(copy.repeatedStringField, msg.repeatedStringField); + assert.deepStrictEqual(copy.repeatedStringField, msg.repeatedStringField); }); - test("repeatedMessageField", () => { + void test("repeatedMessageField", () => { const copy = clone(desc, msg); - expect(copy.repeatedMessageField).not.toBe(msg.repeatedMessageField); - expect(copy.repeatedMessageField.length).toBe(2); - expect(copy.repeatedMessageField[0]).not.toBe( + assert.notStrictEqual(copy.repeatedMessageField, msg.repeatedMessageField); + assert.strictEqual(copy.repeatedMessageField.length, 2); + assert.notStrictEqual(copy.repeatedMessageField[0], msg.repeatedMessageField[0], ); - expect(copy.repeatedMessageField[0]).toStrictEqual( + assert.deepStrictEqual(copy.repeatedMessageField[0], msg.repeatedMessageField[0], ); - expect(copy.repeatedMessageField[1]).not.toBe( + assert.notStrictEqual(copy.repeatedMessageField[1], msg.repeatedMessageField[1], ); - expect(copy.repeatedMessageField[1]).toStrictEqual( + assert.deepStrictEqual(copy.repeatedMessageField[1], msg.repeatedMessageField[1], ); }); - test("mapStringStringField", () => { + void test("mapStringStringField", () => { const copy = clone(desc, msg); - expect(copy.mapStringStringField).not.toBe(msg.mapStringStringField); - expect(copy.mapStringStringField).toStrictEqual(msg.mapStringStringField); + assert.notStrictEqual(copy.mapStringStringField, msg.mapStringStringField); + assert.deepStrictEqual(copy.mapStringStringField, msg.mapStringStringField); }); - test("mapInt32MessageField", () => { + void test("mapInt32MessageField", () => { const copy = clone(desc, msg); - expect(copy.mapInt32MessageField).not.toBe(msg.mapInt32MessageField); - expect(Object.keys(copy).sort()).toStrictEqual(Object.keys(msg).sort()); - expect(copy.mapInt32MessageField[123]).not.toBe( + assert.notStrictEqual(copy.mapInt32MessageField, msg.mapInt32MessageField); + assert.deepStrictEqual(Object.keys(copy).sort(), Object.keys(msg).sort()); + assert.notStrictEqual(copy.mapInt32MessageField[123], msg.mapInt32MessageField[123], ); - expect(copy.mapInt32MessageField[123]).toStrictEqual( + assert.deepStrictEqual(copy.mapInt32MessageField[123], msg.mapInt32MessageField[123], ); }); - test("oneofBoolField", () => { + void test("oneofBoolField", () => { const copy = clone(desc, msg); - expect(copy.either).toStrictEqual(msg.either); + assert.deepStrictEqual(copy.either, msg.either); }); - test("oneofMessageField", () => { + void test("oneofMessageField", () => { msg.either = { case: "oneofMessageField", value: create(desc) }; const copy = clone(desc, msg); - expect(copy.either.case).toBe(msg.either.case); - expect(copy.either.value).not.toBe(msg.either.value); + assert.strictEqual(copy.either.case, msg.either.case); + assert.notStrictEqual(copy.either.value, msg.either.value); }); }); }); diff --git a/packages/protobuf-test/src/create.test.ts b/packages/protobuf-test/src/create.test.ts index d1681edf8..0bed909a3 100644 --- a/packages/protobuf-test/src/create.test.ts +++ b/packages/protobuf-test/src/create.test.ts @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { create, isFieldSet, @@ -20,7 +22,6 @@ import { type MessageInitShape, type DescMessage, } from "@bufbuild/protobuf"; -import { describe, expect, test } from "@jest/globals"; import { reflect } from "@bufbuild/protobuf/reflect"; import * as example_ts from "./gen/ts/extra/example_pb.js"; import * as proto3_ts from "./gen/ts/extra/proto3_pb.js"; @@ -37,630 +38,644 @@ import { fillProto2Message, fillProto2MessageNames } from "./helpers-proto2.js"; /* eslint-disable @typescript-eslint/ban-ts-comment -- to support older TS versions in the TS compat tests, we cannot use ts-expect-error */ -describe("create()", () => { - describe("with a generated descriptor", () => { - test("creates a typed message", () => { +void suite("create()", () => { + void suite("with a generated descriptor", () => { + void test("creates a typed message", () => { const user: example_ts.User = create(example_ts.UserSchema); - expect(user).toBeDefined(); - expect(user.$typeName).toBe("example.User"); - expect(user.firstName).toBeDefined(); + assert.ok(user !== undefined); + assert.strictEqual(user.$typeName, "example.User"); + assert.ok(user.firstName !== undefined); }); }); - describe("with an anonymous descriptor", () => { - test("creates an anonymous message", () => { + void suite("with an anonymous descriptor", () => { + void test("creates an anonymous message", () => { const user = create(example_ts.UserSchema as DescMessage); - expect(user).toBeDefined(); - expect(user.$typeName).toBe("example.User"); + assert.ok(user !== undefined); + assert.strictEqual(user.$typeName, "example.User"); // @ts-expect-error property is unknown to the type system, but still there - expect(user.firstName).toBeDefined(); + assert.ok(user.firstName !== undefined); }); }); - describe("creates a zero message", () => { - describe("from proto3", () => { + void suite("creates a zero message", () => { + void suite("from proto3", () => { const desc = proto3_ts.Proto3MessageSchema; - test("with expected properties", () => { + void test("with expected properties", () => { const msg = create(desc); function hasOwn(prop: keyof typeof msg) { return Object.prototype.hasOwnProperty.call(msg, prop); } // singular - expect(msg.singularStringField).toBe(""); - expect(hasOwn("singularStringField")).toBe(true); - expect(msg.singularBytesField).toBeInstanceOf(Uint8Array); - expect(msg.singularBytesField.length).toBe(0); - expect(hasOwn("singularBytesField")).toBe(true); - expect(msg.singularInt32Field).toBe(0); - expect(hasOwn("singularInt32Field")).toBe(true); - expect(msg.singularInt64Field).toBe(protoInt64.zero); - expect(hasOwn("singularInt64Field")).toBe(true); - expect(msg.singularInt64JsNumberField).toBe(protoInt64.zero); - expect(hasOwn("singularInt64JsNumberField")).toBe(true); - expect(typeof msg.singularInt64JsStringField).toBe("string"); - expect(msg.singularInt64JsStringField).toBe("0"); - expect(hasOwn("singularInt64JsStringField")).toBe(true); - expect(msg.singularFloatField).toBe(0); - expect(hasOwn("singularFloatField")).toBe(true); - expect(msg.singularBoolField).toBe(false); - expect(hasOwn("singularBoolField")).toBe(true); - expect(msg.singularEnumField).toBe(proto3_ts.Proto3Enum.UNSPECIFIED); - expect(hasOwn("singularEnumField")).toBe(true); - expect(msg.singularMessageField).toBeUndefined(); - expect(hasOwn("singularMessageField")).toBe(false); - expect(msg.singularWrappedUint32Field).toBeUndefined(); - expect(hasOwn("singularWrappedUint32Field")).toBe(false); + assert.strictEqual(msg.singularStringField, ""); + assert.strictEqual(hasOwn("singularStringField"), true); + assert.ok(msg.singularBytesField instanceof Uint8Array); + assert.strictEqual(msg.singularBytesField.length, 0); + assert.strictEqual(hasOwn("singularBytesField"), true); + assert.strictEqual(msg.singularInt32Field, 0); + assert.strictEqual(hasOwn("singularInt32Field"), true); + assert.strictEqual(msg.singularInt64Field, protoInt64.zero); + assert.strictEqual(hasOwn("singularInt64Field"), true); + assert.strictEqual(msg.singularInt64JsNumberField, protoInt64.zero); + assert.strictEqual(hasOwn("singularInt64JsNumberField"), true); + assert.strictEqual(typeof msg.singularInt64JsStringField, "string"); + assert.strictEqual(msg.singularInt64JsStringField, "0"); + assert.strictEqual(hasOwn("singularInt64JsStringField"), true); + assert.strictEqual(msg.singularFloatField, 0); + assert.strictEqual(hasOwn("singularFloatField"), true); + assert.strictEqual(msg.singularBoolField, false); + assert.strictEqual(hasOwn("singularBoolField"), true); + assert.strictEqual(msg.singularEnumField, proto3_ts.Proto3Enum.UNSPECIFIED); + assert.strictEqual(hasOwn("singularEnumField"), true); + assert.strictEqual(msg.singularMessageField, undefined); + assert.strictEqual(hasOwn("singularMessageField"), false); + assert.strictEqual(msg.singularWrappedUint32Field, undefined); + assert.strictEqual(hasOwn("singularWrappedUint32Field"), false); // repeated - expect(msg.repeatedStringField).toStrictEqual([]); - expect(hasOwn("repeatedStringField")).toBe(true); - expect(msg.repeatedBytesField).toStrictEqual([]); - expect(hasOwn("repeatedBytesField")).toBe(true); - expect(msg.repeatedInt32Field).toStrictEqual([]); - expect(hasOwn("repeatedInt32Field")).toBe(true); - expect(msg.repeatedInt64Field).toStrictEqual([]); - expect(hasOwn("repeatedInt64Field")).toBe(true); - expect(msg.repeatedInt64JsNumberField).toStrictEqual([]); - expect(hasOwn("repeatedInt64JsNumberField")).toBe(true); - expect(msg.repeatedInt64JsStringField).toStrictEqual([]); - expect(hasOwn("repeatedInt64JsStringField")).toBe(true); - expect(msg.repeatedFloatField).toStrictEqual([]); - expect(hasOwn("repeatedFloatField")).toBe(true); - expect(msg.repeatedBoolField).toStrictEqual([]); - expect(hasOwn("repeatedBoolField")).toBe(true); - expect(msg.repeatedEnumField).toStrictEqual([]); - expect(hasOwn("repeatedEnumField")).toBe(true); - expect(msg.repeatedMessageField).toStrictEqual([]); - expect(hasOwn("repeatedMessageField")).toBe(true); - expect(msg.repeatedWrappedUint32Field).toStrictEqual([]); - expect(hasOwn("repeatedWrappedUint32Field")).toBe(true); + assert.deepStrictEqual(msg.repeatedStringField, []); + assert.strictEqual(hasOwn("repeatedStringField"), true); + assert.deepStrictEqual(msg.repeatedBytesField, []); + assert.strictEqual(hasOwn("repeatedBytesField"), true); + assert.deepStrictEqual(msg.repeatedInt32Field, []); + assert.strictEqual(hasOwn("repeatedInt32Field"), true); + assert.deepStrictEqual(msg.repeatedInt64Field, []); + assert.strictEqual(hasOwn("repeatedInt64Field"), true); + assert.deepStrictEqual(msg.repeatedInt64JsNumberField, []); + assert.strictEqual(hasOwn("repeatedInt64JsNumberField"), true); + assert.deepStrictEqual(msg.repeatedInt64JsStringField, []); + assert.strictEqual(hasOwn("repeatedInt64JsStringField"), true); + assert.deepStrictEqual(msg.repeatedFloatField, []); + assert.strictEqual(hasOwn("repeatedFloatField"), true); + assert.deepStrictEqual(msg.repeatedBoolField, []); + assert.strictEqual(hasOwn("repeatedBoolField"), true); + assert.deepStrictEqual(msg.repeatedEnumField, []); + assert.strictEqual(hasOwn("repeatedEnumField"), true); + assert.deepStrictEqual(msg.repeatedMessageField, []); + assert.strictEqual(hasOwn("repeatedMessageField"), true); + assert.deepStrictEqual(msg.repeatedWrappedUint32Field, []); + assert.strictEqual(hasOwn("repeatedWrappedUint32Field"), true); // optional - expect(msg.optionalStringField).toBeUndefined(); - expect(hasOwn("optionalStringField")).toBe(false); - expect(msg.optionalBytesField).toBeUndefined(); - expect(hasOwn("optionalBytesField")).toBe(false); - expect(msg.optionalInt32Field).toBeUndefined(); - expect(hasOwn("optionalInt32Field")).toBe(false); - expect(msg.optionalInt64Field).toBeUndefined(); - expect(hasOwn("optionalInt64Field")).toBe(false); - expect(msg.optionalInt64JsNumberField).toBeUndefined(); - expect(hasOwn("optionalInt64JsNumberField")).toBe(false); - expect(msg.optionalInt64JsStringField).toBeUndefined(); - expect(hasOwn("optionalInt64JsStringField")).toBe(false); - expect(msg.optionalFloatField).toBeUndefined(); - expect(hasOwn("optionalFloatField")).toBe(false); - expect(msg.optionalBoolField).toBeUndefined(); - expect(hasOwn("optionalBoolField")).toBe(false); - expect(msg.optionalEnumField).toBeUndefined(); - expect(hasOwn("optionalEnumField")).toBe(false); - expect(msg.optionalMessageField).toBeUndefined(); - expect(hasOwn("optionalMessageField")).toBe(false); - expect(msg.optionalWrappedUint32Field).toBeUndefined(); - expect(hasOwn("optionalWrappedUint32Field")).toBe(false); + assert.strictEqual(msg.optionalStringField, undefined); + assert.strictEqual(hasOwn("optionalStringField"), false); + assert.strictEqual(msg.optionalBytesField, undefined); + assert.strictEqual(hasOwn("optionalBytesField"), false); + assert.strictEqual(msg.optionalInt32Field, undefined); + assert.strictEqual(hasOwn("optionalInt32Field"), false); + assert.strictEqual(msg.optionalInt64Field, undefined); + assert.strictEqual(hasOwn("optionalInt64Field"), false); + assert.strictEqual(msg.optionalInt64JsNumberField, undefined); + assert.strictEqual(hasOwn("optionalInt64JsNumberField"), false); + assert.strictEqual(msg.optionalInt64JsStringField, undefined); + assert.strictEqual(hasOwn("optionalInt64JsStringField"), false); + assert.strictEqual(msg.optionalFloatField, undefined); + assert.strictEqual(hasOwn("optionalFloatField"), false); + assert.strictEqual(msg.optionalBoolField, undefined); + assert.strictEqual(hasOwn("optionalBoolField"), false); + assert.strictEqual(msg.optionalEnumField, undefined); + assert.strictEqual(hasOwn("optionalEnumField"), false); + assert.strictEqual(msg.optionalMessageField, undefined); + assert.strictEqual(hasOwn("optionalMessageField"), false); + assert.strictEqual(msg.optionalWrappedUint32Field, undefined); + assert.strictEqual(hasOwn("optionalWrappedUint32Field"), false); // oneof - expect(msg.either).toStrictEqual({ case: undefined }); - expect(hasOwn("either")).toBe(true); + assert.deepStrictEqual(msg.either, { case: undefined }); + assert.strictEqual(hasOwn("either"), true); // map - expect(msg.mapStringStringField).toStrictEqual({}); - expect(hasOwn("mapStringStringField")).toBe(true); - expect(msg.mapInt32Int32Field).toStrictEqual({}); - expect(hasOwn("mapInt32Int32Field")).toBe(true); - expect(msg.mapBoolBoolField).toStrictEqual({}); - expect(hasOwn("mapBoolBoolField")).toBe(true); - expect(msg.mapInt64Int64Field).toStrictEqual({}); - expect(hasOwn("mapInt64Int64Field")).toBe(true); - expect(msg.mapInt32EnumField).toStrictEqual({}); - expect(hasOwn("mapInt32EnumField")).toBe(true); - expect(msg.mapInt32MessageField).toStrictEqual({}); - expect(hasOwn("mapInt32MessageField")).toBe(true); - expect(msg.mapInt32WrappedUint32Field).toStrictEqual({}); - expect(hasOwn("mapInt32WrappedUint32Field")).toBe(true); + assert.deepStrictEqual(msg.mapStringStringField, {}); + assert.strictEqual(hasOwn("mapStringStringField"), true); + assert.deepStrictEqual(msg.mapInt32Int32Field, {}); + assert.strictEqual(hasOwn("mapInt32Int32Field"), true); + assert.deepStrictEqual(msg.mapBoolBoolField, {}); + assert.strictEqual(hasOwn("mapBoolBoolField"), true); + assert.deepStrictEqual(msg.mapInt64Int64Field, {}); + assert.strictEqual(hasOwn("mapInt64Int64Field"), true); + assert.deepStrictEqual(msg.mapInt32EnumField, {}); + assert.strictEqual(hasOwn("mapInt32EnumField"), true); + assert.deepStrictEqual(msg.mapInt32MessageField, {}); + assert.strictEqual(hasOwn("mapInt32MessageField"), true); + assert.deepStrictEqual(msg.mapInt32WrappedUint32Field, {}); + assert.strictEqual(hasOwn("mapInt32WrappedUint32Field"), true); }); - test("without custom prototype", () => { + void test("without custom prototype", () => { const msg = create(desc); const hasCustomPrototype = Object.getPrototypeOf(msg) !== Object.prototype; - expect(hasCustomPrototype).toBe(false); + assert.strictEqual(hasCustomPrototype, false); }); }); - describe("from proto2", () => { + void suite("from proto2", () => { const desc = proto2_ts.Proto2MessageSchema; - test("with expected properties", () => { + void test("with expected properties", () => { const msg = create(desc); function hasOwn(prop: keyof typeof msg) { return Object.prototype.hasOwnProperty.call(msg, prop); } // required - expect(msg.requiredStringField).toBe(""); - expect(hasOwn("requiredStringField")).toBe(false); - expect(msg.requiredBytesField).toBeInstanceOf(Uint8Array); - expect(msg.requiredBytesField.length).toBe(0); - expect(hasOwn("requiredBytesField")).toBe(false); - expect(msg.requiredInt32Field).toBe(0); - expect(hasOwn("requiredInt32Field")).toBe(false); - expect(msg.requiredInt64Field).toBe(protoInt64.zero); - expect(hasOwn("requiredInt64Field")).toBe(false); - expect(msg.requiredInt64JsNumberField).toBe(protoInt64.zero); - expect(hasOwn("requiredInt64JsNumberField")).toBe(false); - expect(typeof msg.requiredInt64JsStringField).toBe("string"); - expect(msg.requiredInt64JsStringField).toBe("0"); - expect(hasOwn("requiredInt64JsStringField")).toBe(false); - expect(msg.requiredFloatField).toBe(0); - expect(hasOwn("requiredFloatField")).toBe(false); - expect(msg.requiredBoolField).toBe(false); - expect(hasOwn("requiredBoolField")).toBe(false); - expect(msg.requiredEnumField).toBe(proto2_ts.Proto2Enum.YES); - expect(hasOwn("requiredEnumField")).toBe(false); - expect(msg.requiredMessageField).toBeUndefined(); - expect(hasOwn("requiredMessageField")).toBe(false); - expect(msg.requireddefaultgroup).toBeUndefined(); - expect(hasOwn("requireddefaultgroup")).toBe(false); - expect(msg.requiredWrappedUint32Field).toBeUndefined(); - expect(hasOwn("requiredWrappedUint32Field")).toBe(false); + assert.strictEqual(msg.requiredStringField, ""); + assert.strictEqual(hasOwn("requiredStringField"), false); + assert.ok(msg.requiredBytesField instanceof Uint8Array); + assert.strictEqual(msg.requiredBytesField.length, 0); + assert.strictEqual(hasOwn("requiredBytesField"), false); + assert.strictEqual(msg.requiredInt32Field, 0); + assert.strictEqual(hasOwn("requiredInt32Field"), false); + assert.strictEqual(msg.requiredInt64Field, protoInt64.zero); + assert.strictEqual(hasOwn("requiredInt64Field"), false); + assert.strictEqual(msg.requiredInt64JsNumberField, protoInt64.zero); + assert.strictEqual(hasOwn("requiredInt64JsNumberField"), false); + assert.strictEqual(typeof msg.requiredInt64JsStringField, "string"); + assert.strictEqual(msg.requiredInt64JsStringField, "0"); + assert.strictEqual(hasOwn("requiredInt64JsStringField"), false); + assert.strictEqual(msg.requiredFloatField, 0); + assert.strictEqual(hasOwn("requiredFloatField"), false); + assert.strictEqual(msg.requiredBoolField, false); + assert.strictEqual(hasOwn("requiredBoolField"), false); + assert.strictEqual(msg.requiredEnumField, proto2_ts.Proto2Enum.YES); + assert.strictEqual(hasOwn("requiredEnumField"), false); + assert.strictEqual(msg.requiredMessageField, undefined); + assert.strictEqual(hasOwn("requiredMessageField"), false); + assert.strictEqual(msg.requireddefaultgroup, undefined); + assert.strictEqual(hasOwn("requireddefaultgroup"), false); + assert.strictEqual(msg.requiredWrappedUint32Field, undefined); + assert.strictEqual(hasOwn("requiredWrappedUint32Field"), false); // required with default - expect(msg.requiredDefaultStringField).toBe('hello " */ '); - expect(hasOwn("requiredStringField")).toBe(false); - expect(msg.requiredDefaultBytesField).toBeInstanceOf(Uint8Array); - expect(hasOwn("requiredBytesField")).toBe(false); - expect(msg.requiredDefaultBytesField.length).toBe(17); - expect(hasOwn("requiredInt32Field")).toBe(false); - expect(msg.requiredDefaultInt32Field).toBe(128); - expect(hasOwn("requiredInt64Field")).toBe(false); - expect(msg.requiredDefaultInt64Field).toBe(protoInt64.parse(-256)); - expect(hasOwn("requiredInt64Field")).toBe(false); - expect(msg.requiredDefaultInt64JsNumberField).toBe( + assert.strictEqual(msg.requiredDefaultStringField, 'hello " */ '); + assert.strictEqual(hasOwn("requiredStringField"), false); + assert.ok(msg.requiredDefaultBytesField instanceof Uint8Array); + assert.strictEqual(hasOwn("requiredBytesField"), false); + assert.strictEqual(msg.requiredDefaultBytesField.length, 17); + assert.strictEqual(hasOwn("requiredInt32Field"), false); + assert.strictEqual(msg.requiredDefaultInt32Field, 128); + assert.strictEqual(hasOwn("requiredInt64Field"), false); + assert.strictEqual(msg.requiredDefaultInt64Field, protoInt64.parse(-256)); + assert.strictEqual(hasOwn("requiredInt64Field"), false); + assert.strictEqual(msg.requiredDefaultInt64JsNumberField, protoInt64.parse(-256), ); - expect(hasOwn("requiredDefaultInt64JsNumberField")).toBe(false); - expect(typeof msg.requiredDefaultInt64JsStringField).toBe("string"); - expect(msg.requiredDefaultInt64JsStringField).toBe("-256"); - expect(hasOwn("requiredDefaultInt64JsStringField")).toBe(false); - expect(hasOwn("requiredFloatField")).toBe(false); - expect(msg.requiredDefaultFloatField).toBe(-512.13); - expect(hasOwn("requiredBoolField")).toBe(false); - expect(msg.requiredDefaultBoolField).toBe(true); - expect(hasOwn("requiredEnumField")).toBe(false); - expect(msg.requiredDefaultEnumField).toBe(proto2_ts.Proto2Enum.YES); - expect(hasOwn("requiredDefaultEnumField")).toBe(false); - expect(msg.requiredDefaultMessageField).toBeUndefined(); - expect(hasOwn("requiredDefaultMessageField")).toBe(false); - expect(msg.requireddefaultgroup).toBeUndefined(); - expect(hasOwn("requireddefaultgroup")).toBe(false); - expect(msg.requiredDefaultWrappedUint32Field).toBeUndefined(); - expect(hasOwn("requiredDefaultWrappedUint32Field")).toBe(false); + assert.strictEqual(hasOwn("requiredDefaultInt64JsNumberField"), false); + assert.strictEqual(typeof msg.requiredDefaultInt64JsStringField, "string"); + assert.strictEqual(msg.requiredDefaultInt64JsStringField, "-256"); + assert.strictEqual(hasOwn("requiredDefaultInt64JsStringField"), false); + assert.strictEqual(hasOwn("requiredFloatField"), false); + assert.strictEqual(msg.requiredDefaultFloatField, -512.13); + assert.strictEqual(hasOwn("requiredBoolField"), false); + assert.strictEqual(msg.requiredDefaultBoolField, true); + assert.strictEqual(hasOwn("requiredEnumField"), false); + assert.strictEqual(msg.requiredDefaultEnumField, proto2_ts.Proto2Enum.YES); + assert.strictEqual(hasOwn("requiredDefaultEnumField"), false); + assert.strictEqual(msg.requiredDefaultMessageField, undefined); + assert.strictEqual(hasOwn("requiredDefaultMessageField"), false); + assert.strictEqual(msg.requireddefaultgroup, undefined); + assert.strictEqual(hasOwn("requireddefaultgroup"), false); + assert.strictEqual(msg.requiredDefaultWrappedUint32Field, undefined); + assert.strictEqual(hasOwn("requiredDefaultWrappedUint32Field"), false); // repeated - expect(msg.repeatedStringField).toStrictEqual([]); - expect(hasOwn("repeatedStringField")).toBe(true); - expect(msg.repeatedBytesField).toStrictEqual([]); - expect(hasOwn("repeatedBytesField")).toBe(true); - expect(msg.repeatedInt32Field).toStrictEqual([]); - expect(hasOwn("repeatedInt32Field")).toBe(true); - expect(msg.repeatedInt64Field).toStrictEqual([]); - expect(hasOwn("repeatedInt64Field")).toBe(true); - expect(msg.repeatedInt64JsNumberField).toStrictEqual([]); - expect(hasOwn("repeatedInt64JsNumberField")).toBe(true); - expect(msg.repeatedInt64JsStringField).toStrictEqual([]); - expect(hasOwn("repeatedInt64JsStringField")).toBe(true); - expect(msg.repeatedFloatField).toStrictEqual([]); - expect(hasOwn("repeatedFloatField")).toBe(true); - expect(msg.repeatedBoolField).toStrictEqual([]); - expect(hasOwn("repeatedBoolField")).toBe(true); - expect(msg.repeatedEnumField).toStrictEqual([]); - expect(hasOwn("repeatedEnumField")).toBe(true); - expect(msg.repeatedMessageField).toStrictEqual([]); - expect(hasOwn("repeatedMessageField")).toBe(true); - expect(msg.repeatedWrappedUint32Field).toStrictEqual([]); - expect(hasOwn("repeatedWrappedUint32Field")).toBe(true); + assert.deepStrictEqual(msg.repeatedStringField, []); + assert.strictEqual(hasOwn("repeatedStringField"), true); + assert.deepStrictEqual(msg.repeatedBytesField, []); + assert.strictEqual(hasOwn("repeatedBytesField"), true); + assert.deepStrictEqual(msg.repeatedInt32Field, []); + assert.strictEqual(hasOwn("repeatedInt32Field"), true); + assert.deepStrictEqual(msg.repeatedInt64Field, []); + assert.strictEqual(hasOwn("repeatedInt64Field"), true); + assert.deepStrictEqual(msg.repeatedInt64JsNumberField, []); + assert.strictEqual(hasOwn("repeatedInt64JsNumberField"), true); + assert.deepStrictEqual(msg.repeatedInt64JsStringField, []); + assert.strictEqual(hasOwn("repeatedInt64JsStringField"), true); + assert.deepStrictEqual(msg.repeatedFloatField, []); + assert.strictEqual(hasOwn("repeatedFloatField"), true); + assert.deepStrictEqual(msg.repeatedBoolField, []); + assert.strictEqual(hasOwn("repeatedBoolField"), true); + assert.deepStrictEqual(msg.repeatedEnumField, []); + assert.strictEqual(hasOwn("repeatedEnumField"), true); + assert.deepStrictEqual(msg.repeatedMessageField, []); + assert.strictEqual(hasOwn("repeatedMessageField"), true); + assert.deepStrictEqual(msg.repeatedWrappedUint32Field, []); + assert.strictEqual(hasOwn("repeatedWrappedUint32Field"), true); // optional - expect(msg.optionalStringField).toBe(""); - expect(hasOwn("optionalStringField")).toBe(false); - expect(msg.optionalBytesField).toBeInstanceOf(Uint8Array); - expect(msg.optionalBytesField.length).toBe(0); - expect(hasOwn("optionalBytesField")).toBe(false); - expect(msg.optionalInt32Field).toBe(0); - expect(hasOwn("optionalInt32Field")).toBe(false); - expect(msg.optionalInt64Field).toBe(protoInt64.zero); - expect(hasOwn("optionalInt64Field")).toBe(false); - expect(msg.optionalInt64JsNumberField).toBe(protoInt64.zero); - expect(hasOwn("optionalInt64JsNumberField")).toBe(false); - expect(typeof msg.optionalInt64JsStringField).toBe("string"); - expect(msg.optionalInt64JsStringField).toBe("0"); - expect(hasOwn("optionalInt64JsStringField")).toBe(false); - expect(msg.optionalFloatField).toBe(0); - expect(hasOwn("optionalFloatField")).toBe(false); - expect(msg.optionalBoolField).toBe(false); - expect(hasOwn("optionalBoolField")).toBe(false); - expect(msg.optionalEnumField).toBe(1); - expect(hasOwn("optionalEnumField")).toBe(false); - expect(msg.optionalMessageField).toBeUndefined(); - expect(hasOwn("optionalMessageField")).toBe(false); - expect(msg.optionalgroup).toBeUndefined(); - expect(hasOwn("optionalgroup")).toBe(false); - expect(msg.optionalWrappedUint32Field).toBeUndefined(); - expect(hasOwn("optionalWrappedUint32Field")).toBe(false); + assert.strictEqual(msg.optionalStringField, ""); + assert.strictEqual(hasOwn("optionalStringField"), false); + assert.ok(msg.optionalBytesField instanceof Uint8Array); + assert.strictEqual(msg.optionalBytesField.length, 0); + assert.strictEqual(hasOwn("optionalBytesField"), false); + assert.strictEqual(msg.optionalInt32Field, 0); + assert.strictEqual(hasOwn("optionalInt32Field"), false); + assert.strictEqual(msg.optionalInt64Field, protoInt64.zero); + assert.strictEqual(hasOwn("optionalInt64Field"), false); + assert.strictEqual(msg.optionalInt64JsNumberField, protoInt64.zero); + assert.strictEqual(hasOwn("optionalInt64JsNumberField"), false); + assert.strictEqual(typeof msg.optionalInt64JsStringField, "string"); + assert.strictEqual(msg.optionalInt64JsStringField, "0"); + assert.strictEqual(hasOwn("optionalInt64JsStringField"), false); + assert.strictEqual(msg.optionalFloatField, 0); + assert.strictEqual(hasOwn("optionalFloatField"), false); + assert.strictEqual(msg.optionalBoolField, false); + assert.strictEqual(hasOwn("optionalBoolField"), false); + assert.strictEqual(msg.optionalEnumField, 1); + assert.strictEqual(hasOwn("optionalEnumField"), false); + assert.strictEqual(msg.optionalMessageField, undefined); + assert.strictEqual(hasOwn("optionalMessageField"), false); + assert.strictEqual(msg.optionalgroup, undefined); + assert.strictEqual(hasOwn("optionalgroup"), false); + assert.strictEqual(msg.optionalWrappedUint32Field, undefined); + assert.strictEqual(hasOwn("optionalWrappedUint32Field"), false); // optional with default - expect(msg.optionalDefaultStringField).toBe('hello " */ '); - expect(hasOwn("optionalDefaultStringField")).toBe(false); - expect(msg.optionalDefaultBytesField).toBeInstanceOf(Uint8Array); - expect(hasOwn("optionalDefaultBytesField")).toBe(false); - expect(msg.optionalDefaultBytesField.length).toBe(17); - expect(hasOwn("optionalDefaultBytesField")).toBe(false); - expect(msg.optionalDefaultInt32Field).toBe(128); - expect(hasOwn("optionalDefaultInt32Field")).toBe(false); - expect(msg.optionalDefaultInt64Field).toBe(protoInt64.parse(-256)); - expect(hasOwn("optionalDefaultInt64Field")).toBe(false); - expect(msg.optionalDefaultInt64JsNumberField).toBe( + assert.strictEqual(msg.optionalDefaultStringField, 'hello " */ '); + assert.strictEqual(hasOwn("optionalDefaultStringField"), false); + assert.ok(msg.optionalDefaultBytesField instanceof Uint8Array); + assert.strictEqual(hasOwn("optionalDefaultBytesField"), false); + assert.strictEqual(msg.optionalDefaultBytesField.length, 17); + assert.strictEqual(hasOwn("optionalDefaultBytesField"), false); + assert.strictEqual(msg.optionalDefaultInt32Field, 128); + assert.strictEqual(hasOwn("optionalDefaultInt32Field"), false); + assert.strictEqual(msg.optionalDefaultInt64Field, protoInt64.parse(-256)); + assert.strictEqual(hasOwn("optionalDefaultInt64Field"), false); + assert.strictEqual(msg.optionalDefaultInt64JsNumberField, protoInt64.parse(-256), ); - expect(hasOwn("optionalDefaultInt64JsNumberField")).toBe(false); - expect(msg.optionalDefaultInt64JsStringField).toBe("-256"); - expect(hasOwn("optionalDefaultInt64JsStringField")).toBe(false); - expect(msg.optionalDefaultFloatField).toBe(-512.13); - expect(hasOwn("optionalDefaultFloatField")).toBe(false); - expect(msg.optionalDefaultBoolField).toBe(true); - expect(hasOwn("optionalDefaultBoolField")).toBe(false); - expect(msg.optionalDefaultEnumField).toBe(proto2_ts.Proto2Enum.YES); - expect(hasOwn("optionalDefaultEnumField")).toBe(false); - expect(msg.optionalDefaultMessageField).toBeUndefined(); - expect(hasOwn("optionalDefaultMessageField")).toBe(false); - expect(msg.optionaldefaultgroup).toBeUndefined(); - expect(hasOwn("optionaldefaultgroup")).toBe(false); - expect(msg.optionalWrappedUint32Field).toBeUndefined(); - expect(hasOwn("optionalWrappedUint32Field")).toBe(false); + assert.strictEqual(hasOwn("optionalDefaultInt64JsNumberField"), false); + assert.strictEqual(msg.optionalDefaultInt64JsStringField, "-256"); + assert.strictEqual(hasOwn("optionalDefaultInt64JsStringField"), false); + assert.strictEqual(msg.optionalDefaultFloatField, -512.13); + assert.strictEqual(hasOwn("optionalDefaultFloatField"), false); + assert.strictEqual(msg.optionalDefaultBoolField, true); + assert.strictEqual(hasOwn("optionalDefaultBoolField"), false); + assert.strictEqual(msg.optionalDefaultEnumField, proto2_ts.Proto2Enum.YES); + assert.strictEqual(hasOwn("optionalDefaultEnumField"), false); + assert.strictEqual(msg.optionalDefaultMessageField, undefined); + assert.strictEqual(hasOwn("optionalDefaultMessageField"), false); + assert.strictEqual(msg.optionaldefaultgroup, undefined); + assert.strictEqual(hasOwn("optionaldefaultgroup"), false); + assert.strictEqual(msg.optionalWrappedUint32Field, undefined); + assert.strictEqual(hasOwn("optionalWrappedUint32Field"), false); // oneof - expect(msg.either).toStrictEqual({ case: undefined }); - expect(hasOwn("either")).toBe(true); + assert.deepStrictEqual(msg.either, { case: undefined }); + assert.strictEqual(hasOwn("either"), true); // map - expect(msg.mapStringStringField).toStrictEqual({}); - expect(hasOwn("mapStringStringField")).toBe(true); - expect(msg.mapInt32Int32Field).toStrictEqual({}); - expect(hasOwn("mapInt32Int32Field")).toBe(true); - expect(msg.mapBoolBoolField).toStrictEqual({}); - expect(hasOwn("mapBoolBoolField")).toBe(true); - expect(msg.mapInt64Int64Field).toStrictEqual({}); - expect(hasOwn("mapInt64Int64Field")).toBe(true); - expect(msg.mapInt32EnumField).toStrictEqual({}); - expect(hasOwn("mapInt32EnumField")).toBe(true); - expect(msg.mapInt32MessageField).toStrictEqual({}); - expect(hasOwn("mapInt32MessageField")).toBe(true); - expect(msg.mapInt32WrappedUint32Field).toStrictEqual({}); - expect(hasOwn("mapInt32WrappedUint32Field")).toBe(true); + assert.deepStrictEqual(msg.mapStringStringField, {}); + assert.strictEqual(hasOwn("mapStringStringField"), true); + assert.deepStrictEqual(msg.mapInt32Int32Field, {}); + assert.strictEqual(hasOwn("mapInt32Int32Field"), true); + assert.deepStrictEqual(msg.mapBoolBoolField, {}); + assert.strictEqual(hasOwn("mapBoolBoolField"), true); + assert.deepStrictEqual(msg.mapInt64Int64Field, {}); + assert.strictEqual(hasOwn("mapInt64Int64Field"), true); + assert.deepStrictEqual(msg.mapInt32EnumField, {}); + assert.strictEqual(hasOwn("mapInt32EnumField"), true); + assert.deepStrictEqual(msg.mapInt32MessageField, {}); + assert.strictEqual(hasOwn("mapInt32MessageField"), true); + assert.deepStrictEqual(msg.mapInt32WrappedUint32Field, {}); + assert.strictEqual(hasOwn("mapInt32WrappedUint32Field"), true); }); - test("with custom prototype", () => { + void test("with custom prototype", () => { const msg = create(desc); const hasCustomPrototype = Object.getPrototypeOf(msg) !== Object.prototype; - expect(hasCustomPrototype).toBe(true); + assert.strictEqual(hasCustomPrototype, true); }); }); - describe("from edition2023", () => { + void suite("from edition2023", () => { const desc = edition2023_ts.Edition2023MessageSchema; - test("with expected properties", () => { + void test("with expected properties", () => { const msg = create(desc); function hasOwn(prop: keyof typeof msg) { return Object.prototype.hasOwnProperty.call(msg, prop); } // explicit - expect(msg.explicitStringField).toBe(""); - expect(hasOwn("explicitStringField")).toBe(false); - expect(msg.explicitBytesField).toBeInstanceOf(Uint8Array); - expect(msg.explicitBytesField.length).toBe(0); - expect(hasOwn("explicitBytesField")).toBe(false); - expect(msg.explicitInt32Field).toBe(0); - expect(hasOwn("explicitInt32Field")).toBe(false); - expect(msg.explicitInt64Field).toBe(protoInt64.zero); - expect(hasOwn("explicitInt64Field")).toBe(false); - expect(msg.explicitInt64JsNumberField).toBe(protoInt64.zero); - expect(hasOwn("explicitInt64JsNumberField")).toBe(false); - expect(typeof msg.explicitInt64JsStringField).toBe("string"); - expect(msg.explicitInt64JsStringField).toBe("0"); - expect(hasOwn("explicitInt64JsStringField")).toBe(false); - expect(msg.explicitFloatField).toBe(0); - expect(hasOwn("explicitFloatField")).toBe(false); - expect(msg.explicitBoolField).toBe(false); - expect(hasOwn("explicitBoolField")).toBe(false); - expect(msg.explicitEnumOpenField).toBe( + assert.strictEqual(msg.explicitStringField, ""); + assert.strictEqual(hasOwn("explicitStringField"), false); + assert.ok(msg.explicitBytesField instanceof Uint8Array); + assert.strictEqual(msg.explicitBytesField.length, 0); + assert.strictEqual(hasOwn("explicitBytesField"), false); + assert.strictEqual(msg.explicitInt32Field, 0); + assert.strictEqual(hasOwn("explicitInt32Field"), false); + assert.strictEqual(msg.explicitInt64Field, protoInt64.zero); + assert.strictEqual(hasOwn("explicitInt64Field"), false); + assert.strictEqual(msg.explicitInt64JsNumberField, protoInt64.zero); + assert.strictEqual(hasOwn("explicitInt64JsNumberField"), false); + assert.strictEqual(typeof msg.explicitInt64JsStringField, "string"); + assert.strictEqual(msg.explicitInt64JsStringField, "0"); + assert.strictEqual(hasOwn("explicitInt64JsStringField"), false); + assert.strictEqual(msg.explicitFloatField, 0); + assert.strictEqual(hasOwn("explicitFloatField"), false); + assert.strictEqual(msg.explicitBoolField, false); + assert.strictEqual(hasOwn("explicitBoolField"), false); + assert.strictEqual(msg.explicitEnumOpenField, edition2023_ts.Edition2023EnumOpen.UNSPECIFIED, ); - expect(hasOwn("explicitEnumOpenField")).toBe(false); - expect(msg.explicitEnumClosedField).toBe( + assert.strictEqual(hasOwn("explicitEnumOpenField"), false); + assert.strictEqual(msg.explicitEnumClosedField, edition2023_ts.Edition2023EnumClosed.A, ); - expect(hasOwn("explicitEnumClosedField")).toBe(false); - expect(msg.explicitMessageField).toBeUndefined(); - expect(hasOwn("explicitMessageField")).toBe(false); - expect(msg.explicitMessageDelimitedField).toBeUndefined(); - expect(hasOwn("explicitMessageDelimitedField")).toBe(false); - expect(msg.explicitWrappedUint32Field).toBeUndefined(); - expect(hasOwn("explicitWrappedUint32Field")).toBe(false); + assert.strictEqual(hasOwn("explicitEnumClosedField"), false); + assert.strictEqual(msg.explicitMessageField, undefined); + assert.strictEqual(hasOwn("explicitMessageField"), false); + assert.strictEqual(msg.explicitMessageDelimitedField, undefined); + assert.strictEqual(hasOwn("explicitMessageDelimitedField"), false); + assert.strictEqual(msg.explicitWrappedUint32Field, undefined); + assert.strictEqual(hasOwn("explicitWrappedUint32Field"), false); // implicit - expect(msg.implicitStringField).toBe(""); - expect(hasOwn("implicitStringField")).toBe(true); - expect(msg.implicitBytesField).toBeInstanceOf(Uint8Array); - expect(msg.implicitBytesField.length).toBe(0); - expect(hasOwn("implicitBytesField")).toBe(true); - expect(msg.implicitInt32Field).toBe(0); - expect(hasOwn("implicitInt32Field")).toBe(true); - expect(msg.implicitInt64Field).toBe(protoInt64.zero); - expect(hasOwn("implicitInt64Field")).toBe(true); - expect(msg.implicitInt64JsNumberField).toBe(protoInt64.zero); - expect(hasOwn("implicitInt64JsNumberField")).toBe(true); - expect(typeof msg.implicitInt64JsStringField).toBe("string"); - expect(msg.implicitInt64JsStringField).toBe("0"); - expect(hasOwn("implicitInt64JsStringField")).toBe(true); - expect(msg.implicitFloatField).toBe(0); - expect(hasOwn("implicitFloatField")).toBe(true); - expect(msg.implicitBoolField).toBe(false); - expect(hasOwn("implicitBoolField")).toBe(true); - expect(msg.implicitEnumOpenField).toBe( + assert.strictEqual(msg.implicitStringField, ""); + assert.strictEqual(hasOwn("implicitStringField"), true); + assert.ok(msg.implicitBytesField instanceof Uint8Array); + assert.strictEqual(msg.implicitBytesField.length, 0); + assert.strictEqual(hasOwn("implicitBytesField"), true); + assert.strictEqual(msg.implicitInt32Field, 0); + assert.strictEqual(hasOwn("implicitInt32Field"), true); + assert.strictEqual(msg.implicitInt64Field, protoInt64.zero); + assert.strictEqual(hasOwn("implicitInt64Field"), true); + assert.strictEqual(msg.implicitInt64JsNumberField, protoInt64.zero); + assert.strictEqual(hasOwn("implicitInt64JsNumberField"), true); + assert.strictEqual(typeof msg.implicitInt64JsStringField, "string"); + assert.strictEqual(msg.implicitInt64JsStringField, "0"); + assert.strictEqual(hasOwn("implicitInt64JsStringField"), true); + assert.strictEqual(msg.implicitFloatField, 0); + assert.strictEqual(hasOwn("implicitFloatField"), true); + assert.strictEqual(msg.implicitBoolField, false); + assert.strictEqual(hasOwn("implicitBoolField"), true); + assert.strictEqual(msg.implicitEnumOpenField, edition2023_ts.Edition2023EnumOpen.UNSPECIFIED, ); - expect(hasOwn("implicitEnumOpenField")).toBe(true); + assert.strictEqual(hasOwn("implicitEnumOpenField"), true); // required - expect(msg.requiredStringField).toBe(""); - expect(hasOwn("requiredStringField")).toBe(false); - expect(msg.requiredBytesField).toBeInstanceOf(Uint8Array); - expect(msg.requiredBytesField.length).toBe(0); - expect(hasOwn("requiredBytesField")).toBe(false); - expect(msg.requiredInt32Field).toBe(0); - expect(hasOwn("requiredInt32Field")).toBe(false); - expect(msg.requiredInt64Field).toBe(protoInt64.zero); - expect(hasOwn("requiredInt64Field")).toBe(false); - expect(msg.requiredInt64JsNumberField).toBe(protoInt64.zero); - expect(hasOwn("requiredInt64JsNumberField")).toBe(false); - expect(typeof msg.requiredInt64JsStringField).toBe("string"); - expect(msg.requiredInt64JsStringField).toBe("0"); - expect(hasOwn("requiredInt64JsStringField")).toBe(false); - expect(msg.requiredFloatField).toBe(0); - expect(hasOwn("requiredFloatField")).toBe(false); - expect(msg.requiredBoolField).toBe(false); - expect(hasOwn("requiredBoolField")).toBe(false); - expect(msg.requiredEnumOpenField).toBe( + assert.strictEqual(msg.requiredStringField, ""); + assert.strictEqual(hasOwn("requiredStringField"), false); + assert.ok(msg.requiredBytesField instanceof Uint8Array); + assert.strictEqual(msg.requiredBytesField.length, 0); + assert.strictEqual(hasOwn("requiredBytesField"), false); + assert.strictEqual(msg.requiredInt32Field, 0); + assert.strictEqual(hasOwn("requiredInt32Field"), false); + assert.strictEqual(msg.requiredInt64Field, protoInt64.zero); + assert.strictEqual(hasOwn("requiredInt64Field"), false); + assert.strictEqual(msg.requiredInt64JsNumberField, protoInt64.zero); + assert.strictEqual(hasOwn("requiredInt64JsNumberField"), false); + assert.strictEqual(typeof msg.requiredInt64JsStringField, "string"); + assert.strictEqual(msg.requiredInt64JsStringField, "0"); + assert.strictEqual(hasOwn("requiredInt64JsStringField"), false); + assert.strictEqual(msg.requiredFloatField, 0); + assert.strictEqual(hasOwn("requiredFloatField"), false); + assert.strictEqual(msg.requiredBoolField, false); + assert.strictEqual(hasOwn("requiredBoolField"), false); + assert.strictEqual(msg.requiredEnumOpenField, edition2023_ts.Edition2023EnumOpen.UNSPECIFIED, ); - expect(hasOwn("requiredEnumOpenField")).toBe(false); - expect(msg.requiredEnumClosedField).toBe( + assert.strictEqual(hasOwn("requiredEnumOpenField"), false); + assert.strictEqual(msg.requiredEnumClosedField, edition2023_ts.Edition2023EnumClosed.A, ); - expect(hasOwn("requiredEnumClosedField")).toBe(false); - expect(msg.requiredMessageField).toBeUndefined(); - expect(hasOwn("requiredMessageField")).toBe(false); - expect(msg.requiredMessageDelimitedField).toBeUndefined(); - expect(hasOwn("requiredMessageDelimitedField")).toBe(false); - expect(msg.requiredWrappedUint32Field).toBeUndefined(); - expect(hasOwn("requiredWrappedUint32Field")).toBe(false); + assert.strictEqual(hasOwn("requiredEnumClosedField"), false); + assert.strictEqual(msg.requiredMessageField, undefined); + assert.strictEqual(hasOwn("requiredMessageField"), false); + assert.strictEqual(msg.requiredMessageDelimitedField, undefined); + assert.strictEqual(hasOwn("requiredMessageDelimitedField"), false); + assert.strictEqual(msg.requiredWrappedUint32Field, undefined); + assert.strictEqual(hasOwn("requiredWrappedUint32Field"), false); // required with default - expect(msg.requiredDefaultStringField).toBe('hello " */ '); - expect(hasOwn("requiredStringField")).toBe(false); - expect(msg.requiredDefaultBytesField).toBeInstanceOf(Uint8Array); - expect(hasOwn("requiredBytesField")).toBe(false); - expect(msg.requiredDefaultBytesField.length).toBe(17); - expect(hasOwn("requiredInt32Field")).toBe(false); - expect(msg.requiredDefaultInt32Field).toBe(128); - expect(hasOwn("requiredInt64Field")).toBe(false); - expect(msg.requiredDefaultInt64Field).toBe(protoInt64.parse(-256)); - expect(hasOwn("requiredInt64Field")).toBe(false); - expect(msg.requiredDefaultInt64JsNumberField).toBe( + assert.strictEqual(msg.requiredDefaultStringField, 'hello " */ '); + assert.strictEqual(hasOwn("requiredStringField"), false); + assert.ok(msg.requiredDefaultBytesField instanceof Uint8Array); + assert.strictEqual(hasOwn("requiredBytesField"), false); + assert.strictEqual(msg.requiredDefaultBytesField.length, 17); + assert.strictEqual(hasOwn("requiredInt32Field"), false); + assert.strictEqual(msg.requiredDefaultInt32Field, 128); + assert.strictEqual(hasOwn("requiredInt64Field"), false); + assert.strictEqual(msg.requiredDefaultInt64Field, protoInt64.parse(-256)); + assert.strictEqual(hasOwn("requiredInt64Field"), false); + assert.strictEqual(msg.requiredDefaultInt64JsNumberField, protoInt64.parse(-256), ); - expect(hasOwn("requiredDefaultInt64JsNumberField")).toBe(false); - expect(typeof msg.requiredDefaultInt64JsStringField).toBe("string"); - expect(msg.requiredDefaultInt64JsStringField).toBe("-256"); - expect(hasOwn("requiredDefaultInt64JsStringField")).toBe(false); - expect(msg.requiredDefaultFloatField).toBe(-512.13); - expect(hasOwn("requiredDefaultFloatField")).toBe(false); - expect(msg.requiredDefaultFloatField).toBe(-512.13); - expect(hasOwn("requiredDefaultFloatField")).toBe(false); - expect(msg.requiredDefaultBoolField).toBe(true); - expect(hasOwn("requiredDefaultBoolField")).toBe(false); - expect(msg.requiredDefaultEnumOpenField).toBe( + assert.strictEqual(hasOwn("requiredDefaultInt64JsNumberField"), false); + assert.strictEqual(typeof msg.requiredDefaultInt64JsStringField, "string"); + assert.strictEqual(msg.requiredDefaultInt64JsStringField, "-256"); + assert.strictEqual(hasOwn("requiredDefaultInt64JsStringField"), false); + assert.strictEqual(msg.requiredDefaultFloatField, -512.13); + assert.strictEqual(hasOwn("requiredDefaultFloatField"), false); + assert.strictEqual(msg.requiredDefaultFloatField, -512.13); + assert.strictEqual(hasOwn("requiredDefaultFloatField"), false); + assert.strictEqual(msg.requiredDefaultBoolField, true); + assert.strictEqual(hasOwn("requiredDefaultBoolField"), false); + assert.strictEqual(msg.requiredDefaultEnumOpenField, edition2023_ts.Edition2023EnumOpen.A, ); - expect(hasOwn("requiredDefaultEnumOpenField")).toBe(false); - expect(msg.requiredDefaultEnumClosedField).toBe( + assert.strictEqual(hasOwn("requiredDefaultEnumOpenField"), false); + assert.strictEqual(msg.requiredDefaultEnumClosedField, edition2023_ts.Edition2023EnumClosed.A, ); // repeated - expect(msg.repeatedStringField).toStrictEqual([]); - expect(hasOwn("repeatedStringField")).toBe(true); - expect(msg.repeatedBytesField).toStrictEqual([]); - expect(hasOwn("repeatedBytesField")).toBe(true); - expect(msg.repeatedInt32Field).toStrictEqual([]); - expect(hasOwn("repeatedInt32Field")).toBe(true); - expect(msg.repeatedInt64Field).toStrictEqual([]); - expect(hasOwn("repeatedInt64Field")).toBe(true); - expect(msg.repeatedInt64JsNumberField).toStrictEqual([]); - expect(hasOwn("repeatedInt64JsNumberField")).toBe(true); - expect(msg.repeatedInt64JsStringField).toStrictEqual([]); - expect(hasOwn("repeatedInt64JsStringField")).toBe(true); - expect(msg.repeatedFloatField).toStrictEqual([]); - expect(hasOwn("repeatedFloatField")).toBe(true); - expect(msg.repeatedBoolField).toStrictEqual([]); - expect(hasOwn("repeatedBoolField")).toBe(true); - expect(msg.repeatedEnumOpenField).toStrictEqual([]); - expect(hasOwn("repeatedEnumOpenField")).toBe(true); - expect(msg.repeatedEnumClosedField).toStrictEqual([]); - expect(hasOwn("repeatedEnumClosedField")).toBe(true); - expect(msg.repeatedMessageField).toStrictEqual([]); - expect(hasOwn("repeatedMessageField")).toBe(true); - expect(msg.repeatedWrappedUint32Field).toStrictEqual([]); - expect(hasOwn("repeatedWrappedUint32Field")).toBe(true); + assert.deepStrictEqual(msg.repeatedStringField, []); + assert.strictEqual(hasOwn("repeatedStringField"), true); + assert.deepStrictEqual(msg.repeatedBytesField, []); + assert.strictEqual(hasOwn("repeatedBytesField"), true); + assert.deepStrictEqual(msg.repeatedInt32Field, []); + assert.strictEqual(hasOwn("repeatedInt32Field"), true); + assert.deepStrictEqual(msg.repeatedInt64Field, []); + assert.strictEqual(hasOwn("repeatedInt64Field"), true); + assert.deepStrictEqual(msg.repeatedInt64JsNumberField, []); + assert.strictEqual(hasOwn("repeatedInt64JsNumberField"), true); + assert.deepStrictEqual(msg.repeatedInt64JsStringField, []); + assert.strictEqual(hasOwn("repeatedInt64JsStringField"), true); + assert.deepStrictEqual(msg.repeatedFloatField, []); + assert.strictEqual(hasOwn("repeatedFloatField"), true); + assert.deepStrictEqual(msg.repeatedBoolField, []); + assert.strictEqual(hasOwn("repeatedBoolField"), true); + assert.deepStrictEqual(msg.repeatedEnumOpenField, []); + assert.strictEqual(hasOwn("repeatedEnumOpenField"), true); + assert.deepStrictEqual(msg.repeatedEnumClosedField, []); + assert.strictEqual(hasOwn("repeatedEnumClosedField"), true); + assert.deepStrictEqual(msg.repeatedMessageField, []); + assert.strictEqual(hasOwn("repeatedMessageField"), true); + assert.deepStrictEqual(msg.repeatedWrappedUint32Field, []); + assert.strictEqual(hasOwn("repeatedWrappedUint32Field"), true); // oneof - expect(msg.either).toStrictEqual({ case: undefined }); - expect(hasOwn("either")).toBe(true); + assert.deepStrictEqual(msg.either, { case: undefined }); + assert.strictEqual(hasOwn("either"), true); // map - expect(msg.mapStringStringField).toStrictEqual({}); - expect(hasOwn("mapStringStringField")).toBe(true); - expect(msg.mapInt32Int32Field).toStrictEqual({}); - expect(hasOwn("mapInt32Int32Field")).toBe(true); - expect(msg.mapBoolBoolField).toStrictEqual({}); - expect(hasOwn("mapBoolBoolField")).toBe(true); - expect(msg.mapInt64Int64Field).toStrictEqual({}); - expect(hasOwn("mapInt64Int64Field")).toBe(true); - expect(msg.mapInt32EnumOpenField).toStrictEqual({}); - expect(hasOwn("mapInt32EnumOpenField")).toBe(true); - expect(msg.mapInt32MessageField).toStrictEqual({}); - expect(hasOwn("mapInt32MessageField")).toBe(true); - expect(msg.mapInt32WrappedUint32Field).toStrictEqual({}); - expect(hasOwn("mapInt32WrappedUint32Field")).toBe(true); + assert.deepStrictEqual(msg.mapStringStringField, {}); + assert.strictEqual(hasOwn("mapStringStringField"), true); + assert.deepStrictEqual(msg.mapInt32Int32Field, {}); + assert.strictEqual(hasOwn("mapInt32Int32Field"), true); + assert.deepStrictEqual(msg.mapBoolBoolField, {}); + assert.strictEqual(hasOwn("mapBoolBoolField"), true); + assert.deepStrictEqual(msg.mapInt64Int64Field, {}); + assert.strictEqual(hasOwn("mapInt64Int64Field"), true); + assert.deepStrictEqual(msg.mapInt32EnumOpenField, {}); + assert.strictEqual(hasOwn("mapInt32EnumOpenField"), true); + assert.deepStrictEqual(msg.mapInt32MessageField, {}); + assert.strictEqual(hasOwn("mapInt32MessageField"), true); + assert.deepStrictEqual(msg.mapInt32WrappedUint32Field, {}); + assert.strictEqual(hasOwn("mapInt32WrappedUint32Field"), true); }); - test("with custom prototype", () => { + void test("with custom prototype", () => { const msg = create(desc); const hasCustomPrototype = Object.getPrototypeOf(msg) !== Object.prototype; - expect(hasCustomPrototype).toBe(true); + assert.strictEqual(hasCustomPrototype, true); }); }); - describe("from edition2023 with proto3 features", () => { + void suite("from edition2023 with proto3 features", () => { const desc = test_messages_proto3_editions_ts.TestAllTypesProto3Schema; test("without custom prototype", () => { const msg = create(desc); const hasCustomPrototype = Object.getPrototypeOf(msg) !== Object.prototype; - expect(hasCustomPrototype).toBe(false); + assert.strictEqual(hasCustomPrototype, false); }); }); }); - describe("with init argument", () => { + void suite("with init argument", () => { test("typed message returns same instance of typed message", () => { const user1 = create(example_ts.UserSchema); const user2 = create(example_ts.UserSchema, user1); - expect(user2).toBe(user1); + assert.strictEqual(user2, user1); }); test("rejects foreign typed message as a type error", () => { const user = create(example_ts.UserSchema); // @ts-expect-error TS2345 const notAUser = create(proto3_ts.Proto3MessageSchema, user); - expect(notAUser).toBeDefined(); + assert.ok(notAUser !== undefined); }); test("rejects foreign typed message with assignable properties as a type error", () => { const a = create(ts_types.TsTypeASchema); // @ts-expect-error TS2345: Argument of type TsTypeA is not assignable to parameter of type MessageInit | undefined const b = create(ts_types.TsTypeBSchema, a); - expect(b).toBeDefined(); + assert.ok(b !== undefined); }); test("rejects extra properties in the object literal as a type error", () => { const msg = create(proto3_ts.Proto3MessageSchema, { // @ts-expect-error TS2353 extraProperty: true, }); - expect(msg).toBeDefined(); + assert.ok(msg !== undefined); }); - describe("inits proto2", () => { - test.each(fillProto2MessageNames())("field %s", (name) => { - const desc = proto2_ts.Proto2MessageSchema; - const filled = fillProto2Message(create(desc)); - const init: MessageInitShape = {}; - for (const k in filled) { - (init as Record)[k] = ( - filled as Record - )[k]; - } - const created = create(desc, init); - switch (name) { - case "oneofBoolField": - expect(created.either).toStrictEqual(filled.either); - break; - default: - expect(isFieldSet(created, desc.field[name])).toBe(true); - expect(created[name]).toStrictEqual(filled[name]); - } - }); + void suite("inits proto2", () => { + for (const name of fillProto2MessageNames()) { + void test(`field ${name}`, () => { + const desc = proto2_ts.Proto2MessageSchema; + const filled = fillProto2Message(create(desc)); + const init: MessageInitShape = {}; + for (const k in filled) { + (init as Record)[k] = ( + filled as Record + )[k]; + } + const created = create(desc, init); + switch (name) { + case "oneofBoolField": + assert.deepStrictEqual(created.either, filled.either); + break; + default: + assert.strictEqual(isFieldSet(created, desc.field[name]), true); + assert.deepStrictEqual(created[name], filled[name]); + } + }); + } }); - describe("inits proto3", () => { - test.each(fillProto3MessageNames())("field %s", (name) => { - const desc = proto3_ts.Proto3MessageSchema; - const filled = fillProto3Message(create(desc)); - const init: MessageInitShape = {}; - for (const k in filled) { - (init as Record)[k] = ( - filled as Record - )[k]; - } - const created = create(desc, init); - switch (name) { - case "oneofBoolField": - expect(created.either).toStrictEqual(filled.either); - break; - default: - expect(isFieldSet(created, desc.field[name])).toBe(true); - expect(created[name]).toStrictEqual(filled[name]); - } - }); + void suite("inits proto3", () => { + for (const name of fillProto3MessageNames()) { + void test(`field ${name}`, () => { + const desc = proto3_ts.Proto3MessageSchema; + const filled = fillProto3Message(create(desc)); + const init: MessageInitShape = {}; + for (const k in filled) { + (init as Record)[k] = ( + filled as Record + )[k]; + } + const created = create(desc, init); + switch (name) { + case "oneofBoolField": + assert.deepStrictEqual(created.either, filled.either); + break; + default: + assert.strictEqual(isFieldSet(created, desc.field[name]), true); + assert.deepStrictEqual(created[name], filled[name]); + } + }); + } }); - describe("inits edition2023", () => { - test.each(fillEdition2023MessageNames())("field %s", (name) => { - const desc = edition2023_ts.Edition2023MessageSchema; - const filled = fillEdition2023Message(create(desc)); - const init: MessageInitShape = {}; - for (const k in filled) { - (init as Record)[k] = ( - filled as Record - )[k]; - } - const created = create(desc, init); - switch (name) { - case "oneofBoolField": - expect(created.either).toStrictEqual(filled.either); - break; - default: - expect(isFieldSet(created, desc.field[name])).toBe(true); - expect(created[name]).toStrictEqual(filled[name]); - } - }); + void suite("inits edition2023", () => { + for (const name of fillEdition2023MessageNames()) { + void test(`field ${name}`, () => { + const desc = edition2023_ts.Edition2023MessageSchema; + const filled = fillEdition2023Message(create(desc)); + const init: MessageInitShape = {}; + for (const k in filled) { + (init as Record)[k] = ( + filled as Record + )[k]; + } + const created = create(desc, init); + switch (name) { + case "oneofBoolField": + assert.deepStrictEqual(created.either, filled.either); + break; + default: + assert.strictEqual(isFieldSet(created, desc.field[name]), true); + assert.deepStrictEqual(created[name], filled[name]); + } + }); + } }); - describe("skips null values", () => { - describe.each([ + void suite("skips null values", () => { + for (const desc of [ proto2_ts.Proto2MessageSchema, proto3_ts.Proto3MessageSchema, edition2023_ts.Edition2023MessageSchema, - ])("$typeName", (desc) => { - test.each(desc.fields)("$name", (f) => { - const init: Record = {}; - for (const f of desc.members) { - init[f.localName] = null; + ]) { + void suite(`${desc.typeName}`, () => { + for (const field of desc.fields) { + void test(`${field.name}`, () => { + const init: Record = {}; + for (const f of desc.members) { + init[f.localName] = null; + } + const msg = create(desc, init); + const r = reflect(desc, msg); + assert.strictEqual(r.isSet(field), false); + }) } - const msg = create(desc, init); - const r = reflect(desc, msg); - expect(r.isSet(f)).toBe(false); }); - }); + } }); - describe("skips undefined values", () => { - describe.each([ + void suite("skips undefined values", () => { + for (const desc of [ proto2_ts.Proto2MessageSchema, proto3_ts.Proto3MessageSchema, edition2023_ts.Edition2023MessageSchema, - ])("$typeName", (desc) => { - test.each(desc.fields)("$name", (f) => { - const init: Record = {}; - for (const f of desc.members) { - init[f.localName] = undefined; + ]) { + void suite(`${desc.typeName}`, () => { + for (const field of desc.fields) { + void test(`${field.name}`, () => { + const init: Record = {}; + for (const f of desc.members) { + init[f.localName] = undefined; + } + const msg = create(desc, init); + const r = reflect(desc, msg); + assert.strictEqual(r.isSet(field), false); + }) } - const msg = create(desc, init); - const r = reflect(desc, msg); - expect(r.isSet(f)).toBe(false); }); - }); + } }); - describe("64-bit integer field", () => { + void suite("64-bit integer field", () => { test("accepts generated types", () => { const msg = create(proto3_ts.Proto3MessageSchema, { singularInt64Field: protoInt64.parse(1), @@ -678,19 +693,19 @@ describe("create()", () => { "2": protoInt64.parse(9), }, }); - expect(msg.singularInt64Field).toBe(protoInt64.parse(1)); - expect(msg.singularInt64JsNumberField).toBe(protoInt64.parse(2)); - expect(msg.singularInt64JsStringField).toBe("3"); - expect(msg.repeatedInt64Field).toStrictEqual([protoInt64.parse(4)]); - expect(msg.repeatedInt64JsNumberField).toStrictEqual([ + assert.strictEqual(msg.singularInt64Field, protoInt64.parse(1)); + assert.strictEqual(msg.singularInt64JsNumberField, protoInt64.parse(2)); + assert.strictEqual(msg.singularInt64JsStringField, "3"); + assert.deepStrictEqual(msg.repeatedInt64Field, [protoInt64.parse(4)]); + assert.deepStrictEqual(msg.repeatedInt64JsNumberField, [ protoInt64.parse(5), ]); - expect(msg.repeatedInt64JsStringField).toStrictEqual(["6"]); - expect(msg.either).toStrictEqual({ + assert.deepStrictEqual(msg.repeatedInt64JsStringField, ["6"]); + assert.deepStrictEqual(msg.either, { case: "oneofInt64Field", value: protoInt64.parse(7), }); - expect(msg.mapInt64Int64Field).toStrictEqual({ + assert.deepStrictEqual(msg.mapInt64Int64Field, { "1": protoInt64.parse(8), "2": protoInt64.parse(9), }); @@ -721,26 +736,26 @@ describe("create()", () => { "2": 9, }, }); - expect(msg).toBeDefined(); - expect(msg.singularInt64Field).toBe("1"); - expect(msg.singularInt64JsNumberField).toBe("2"); - expect(msg.singularInt64JsStringField).toBe(protoInt64.parse(3)); - expect(msg.repeatedInt64Field).toStrictEqual([4]); - expect(msg.repeatedInt64JsNumberField).toStrictEqual([5]); - expect(msg.repeatedInt64JsStringField).toStrictEqual([ + assert.ok(msg !== undefined); + assert.strictEqual(msg.singularInt64Field, "1"); + assert.strictEqual(msg.singularInt64JsNumberField, "2"); + assert.strictEqual(msg.singularInt64JsStringField, protoInt64.parse(3)); + assert.deepStrictEqual(msg.repeatedInt64Field, [4]); + assert.deepStrictEqual(msg.repeatedInt64JsNumberField, [5]); + assert.deepStrictEqual(msg.repeatedInt64JsStringField, [ protoInt64.parse(6), ]); - expect(msg.either).toStrictEqual({ + assert.deepStrictEqual(msg.either, { case: "oneofInt64Field", value: 7, }); - expect(msg.mapInt64Int64Field).toStrictEqual({ + assert.deepStrictEqual(msg.mapInt64Int64Field, { "1": 8, "2": 9, }); }); }); - describe("bytes", () => { + void suite("bytes", () => { test("converts number array to Uint8Array", () => { const msg = create(proto3_ts.Proto3MessageSchema, { // @ts-expect-error number array is still a type error @@ -757,15 +772,15 @@ describe("create()", () => { value: [0xde, 0xad, 0xbe, 0xef], }, }); - expect(msg.singularBytesField instanceof Uint8Array).toBe(true); - expect(msg.repeatedBytesField.length).toBe(2); - expect(msg.repeatedBytesField[0] instanceof Uint8Array).toBe(true); - expect(msg.repeatedBytesField[1] instanceof Uint8Array).toBe(true); - expect(msg.either.case).toBe("oneofBytesField"); - expect(msg.either.value instanceof Uint8Array).toBe(true); + assert.strictEqual(msg.singularBytesField instanceof Uint8Array, true); + assert.strictEqual(msg.repeatedBytesField.length, 2); + assert.strictEqual(msg.repeatedBytesField[0] instanceof Uint8Array, true); + assert.strictEqual(msg.repeatedBytesField[1] instanceof Uint8Array, true); + assert.strictEqual(msg.either.case, "oneofBytesField"); + assert.strictEqual(msg.either.value instanceof Uint8Array, true); }); }); - describe("message field", () => { + void suite("message field", () => { test("accepts partial message", () => { const msg = create(proto3_ts.Proto3MessageSchema, { singularMessageField: { @@ -786,32 +801,29 @@ describe("create()", () => { 123: { singularStringField: "str" }, }, }); - expect(msg.singularMessageField).toBeDefined(); - expect(msg.singularMessageField?.singularStringField).toBe("str"); - expect( + assert.ok(msg.singularMessageField !== undefined); + assert.strictEqual(msg.singularMessageField?.singularStringField, "str"); + assert.ok( isMessage(msg.singularMessageField, proto3_ts.Proto3MessageSchema), - ).toBe(true); + ); - expect(msg.repeatedMessageField.length).toBe(1); - expect(msg.repeatedMessageField[0].singularStringField).toBe("str"); - expect( + assert.strictEqual(msg.repeatedMessageField.length, 1); + assert.strictEqual(msg.repeatedMessageField[0].singularStringField, "str"); + assert.ok( isMessage(msg.repeatedMessageField[0], proto3_ts.Proto3MessageSchema), - ).toBe(true); - - expect(msg.either.case).toBe("oneofMessageField"); - expect(msg.either.value).toBeDefined(); - expect(isMessage(msg.either.value, proto3_ts.Proto3MessageSchema)).toBe( - true, ); - expect(Object.keys(msg.mapInt32MessageField)).toStrictEqual(["123"]); - expect(msg.mapInt32MessageField[123]).toBeDefined(); - expect( + assert.strictEqual(msg.either.case, "oneofMessageField"); + assert.ok(msg.either.value !== undefined); + assert.ok(isMessage(msg.either.value, proto3_ts.Proto3MessageSchema)); + + assert.deepStrictEqual(Object.keys(msg.mapInt32MessageField), ["123"]); + assert.ok(msg.mapInt32MessageField[123] !== undefined); + assert.ok( isMessage( msg.mapInt32MessageField[123], proto3_ts.Proto3MessageSchema, - ), - ).toBe(true); + )); }); test("accepts full message", () => { const testMessageSingular = create(proto3_ts.Proto3MessageSchema); @@ -829,31 +841,31 @@ describe("create()", () => { 123: testMessageMap, }, }); - expect(msg.singularMessageField === testMessageSingular).toBe(true); - expect(msg.repeatedMessageField[0] === testMessageList).toBe(true); - expect(msg.either.value === testMessageOneof).toBe(true); - expect(msg.mapInt32MessageField[123] === testMessageMap).toBe(true); + assert.strictEqual(msg.singularMessageField === testMessageSingular, true); + assert.strictEqual(msg.repeatedMessageField[0] === testMessageList, true); + assert.strictEqual(msg.either.value === testMessageOneof, true); + assert.strictEqual(msg.mapInt32MessageField[123] === testMessageMap, true); }); }); - describe("enum field", () => { + void suite("enum field", () => { test("accepts proto3 enum value out of range", () => { const msg = create(proto3_ts.Proto3MessageSchema, { // @ts-ignore -- required for older TS singularEnumField: 99, }); - expect(msg.singularEnumField).toBe(99); + assert.strictEqual(msg.singularEnumField, 99); }); }); - describe("list field", () => { + void suite("list field", () => { test("accepts array", () => { const arr = ["a", "b", "c"]; const msg = create(proto3_ts.Proto3MessageSchema, { repeatedStringField: arr, }); - expect(msg.repeatedStringField).toBe(arr); + assert.strictEqual(msg.repeatedStringField, arr); }); }); - describe("map field", () => { + void suite("map field", () => { test("accepts record object", () => { const recordObj = { a: "A", @@ -863,10 +875,10 @@ describe("create()", () => { const msg = create(proto3_ts.Proto3MessageSchema, { mapStringStringField: recordObj, }); - expect(msg.mapStringStringField).toBe(recordObj); + assert.strictEqual(msg.mapStringStringField, recordObj); }); }); - describe("oneof field", () => { + void suite("oneof field", () => { test("accepts selected field", () => { const msg = create(proto3_ts.Proto3MessageSchema, { either: { @@ -874,11 +886,11 @@ describe("create()", () => { value: false, }, }); - expect(msg.either.case).toBe("oneofBoolField"); - expect(msg.either.value).toBe(false); + assert.strictEqual(msg.either.case, "oneofBoolField"); + assert.strictEqual(msg.either.value, false); }); }); - describe("wkt wrapper field", () => { + void suite("wkt wrapper field", () => { test("accepts unwrapped value only for singular field", () => { const msg = create(proto3_ts.Proto3MessageSchema, { singularWrappedUint32Field: 123, @@ -895,26 +907,26 @@ describe("create()", () => { }, }, }); - expect(msg.singularWrappedUint32Field).toBe(123); - expect(msg.either.case).toBe("oneofWrappedUint32Field"); + assert.strictEqual(msg.singularWrappedUint32Field, 123); + assert.strictEqual(msg.either.case, "oneofWrappedUint32Field"); if (msg.either.case == "oneofWrappedUint32Field") { - expect(msg.either.value.$typeName).toBe( + assert.strictEqual(msg.either.value.$typeName, "google.protobuf.UInt32Value", ); - expect(msg.either.value.value).toBe(123); + assert.strictEqual(msg.either.value.value, 123); } - expect(msg.repeatedWrappedUint32Field.length).toBe(1); - expect(msg.repeatedWrappedUint32Field[0].$typeName).toBe( + assert.strictEqual(msg.repeatedWrappedUint32Field.length, 1); + assert.strictEqual(msg.repeatedWrappedUint32Field[0].$typeName, "google.protobuf.UInt32Value", ); - expect(msg.repeatedWrappedUint32Field[0].value).toBe(123); - expect(msg.mapInt32WrappedUint32Field[123].$typeName).toBe( + assert.strictEqual(msg.repeatedWrappedUint32Field[0].value, 123); + assert.strictEqual(msg.mapInt32WrappedUint32Field[123].$typeName, "google.protobuf.UInt32Value", ); - expect(msg.mapInt32WrappedUint32Field[123].value).toBe(123); + assert.strictEqual(msg.mapInt32WrappedUint32Field[123].value, 123); }); }); - describe("wkt struct field", () => { + void suite("wkt struct field", () => { test("accepts JsonObject", () => { const msg = create(proto3_ts.Proto3MessageSchema, { singularStructField: { @@ -941,8 +953,8 @@ describe("create()", () => { }, }); - expect(msg.singularStructField).toStrictEqual({ shouldBeJson: true }); - expect(msg.repeatedStructField).toStrictEqual([ + assert.deepStrictEqual(msg.singularStructField, { shouldBeJson: true }); + assert.deepStrictEqual(msg.repeatedStructField, [ { shouldBeJson: 1, }, @@ -950,13 +962,13 @@ describe("create()", () => { shouldBeJson: 2, }, ]); - expect(msg.either.case).toBe("oneofStructField"); + assert.strictEqual(msg.either.case, "oneofStructField"); if (msg.either.case == "oneofStructField") { - expect(msg.either.value).toStrictEqual({ + assert.deepStrictEqual(msg.either.value, { shouldBeJson: true, }); } - expect(msg.mapInt32StructField[123]).toStrictEqual({ + assert.deepStrictEqual(msg.mapInt32StructField[123], { shouldBeJson: true, }); }); diff --git a/packages/protobuf-test/src/edition2023-serialize.test.ts b/packages/protobuf-test/src/edition2023-serialize.test.ts index 66d81a2a2..dc0a58a0d 100644 --- a/packages/protobuf-test/src/edition2023-serialize.test.ts +++ b/packages/protobuf-test/src/edition2023-serialize.test.ts @@ -12,8 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { fillEdition2023Message } from "./helpers-edition2023.js"; -import { describe, expect, test } from "@jest/globals"; import { create, fromBinary, @@ -30,29 +31,29 @@ import { } from "./gen/ts/extra/edition2023-map-encoding_pb.js"; import { BinaryReader, BinaryWriter, WireType } from "@bufbuild/protobuf/wire"; -describe("edition2023 serialization", () => { +void suite("edition2023 serialization", () => { test("should round-trip for binary", () => { const desc = edition2023_ts.Edition2023MessageSchema; const a = fillEdition2023Message(create(desc)); const bytes = toBinary(desc, a); const b = fromBinary(desc, bytes); - expect(a).toStrictEqual(b); + assert.deepStrictEqual(a, b); }); test("should round-trip for json", () => { const desc = edition2023_ts.Edition2023MessageSchema; const a = fillEdition2023Message(create(desc)); const json = toJson(desc, a); const b = fromJson(desc, json); - expect(a).toStrictEqual(b); + assert.deepStrictEqual(a, b); }); - describe("proto2 / edition2023 interop", () => { + void suite("proto2 / edition2023 interop", () => { test("to binary", () => { const descProto2 = edition2023_proto2_ts.Proto2MessageForEdition2023Schema; const msgProto2 = fillProto2Message(create(descProto2)); const descEdition = edition2023_ts.Edition2023FromProto2MessageSchema; const msgEdition = fillEditionMessage(create(descEdition)); - expect(toBinary(descEdition, msgEdition)).toStrictEqual( + assert.deepStrictEqual(toBinary(descEdition, msgEdition), toBinary(descProto2, msgProto2), ); }); @@ -62,11 +63,10 @@ describe("edition2023 serialization", () => { const msgProto2 = fillProto2Message(create(descProto2)); const descEdition = edition2023_ts.Edition2023FromProto2MessageSchema; const msgEdition = fillEditionMessage(create(descEdition)); - expect( + assert.deepStrictEqual( toJson(descEdition, msgEdition, { enumAsInteger: true, }), - ).toStrictEqual( toJson(descProto2, msgProto2, { enumAsInteger: true, }), @@ -79,7 +79,7 @@ describe("edition2023 serialization", () => { const bytesProto2 = toBinary(descProto2, msgProto2); const descEdition = edition2023_ts.Edition2023FromProto2MessageSchema; const msgEdition = fillEditionMessage(create(descEdition)); - expect(fromBinary(descEdition, bytesProto2)).toStrictEqual(msgEdition); + assert.deepStrictEqual(fromBinary(descEdition, bytesProto2), msgEdition); }); test("from json", () => { const descProto2 = @@ -90,7 +90,7 @@ describe("edition2023 serialization", () => { }); const descEdition = edition2023_ts.Edition2023FromProto2MessageSchema; const msgEdition = fillEditionMessage(create(descEdition)); - expect(fromJson(descEdition, jsonProto2)).toStrictEqual(msgEdition); + assert.deepStrictEqual(fromJson(descEdition, jsonProto2), msgEdition); }); function fillEditionMessage( @@ -147,14 +147,14 @@ describe("edition2023 serialization", () => { return msg; } }); - describe("proto3 / edition2023 interop", () => { + void suite("proto3 / edition2023 interop", () => { test("to binary", () => { const descProto3 = edition2023_proto3_ts.Proto3MessageForEdition2023Schema; const msgProto3 = fillProto3Message(create(descProto3)); const descEdition = edition2023_ts.Edition2023FromProto3MessageSchema; const msgEdition = fillEditionMessage(create(descEdition)); - expect(toBinary(descEdition, msgEdition)).toStrictEqual( + assert.deepStrictEqual(toBinary(descEdition, msgEdition), toBinary(descProto3, msgProto3), ); }); @@ -164,11 +164,10 @@ describe("edition2023 serialization", () => { const msgProto3 = fillProto3Message(create(descProto3)); const descEdition = edition2023_ts.Edition2023FromProto3MessageSchema; const msgEdition = fillEditionMessage(create(descEdition)); - expect( + assert.deepStrictEqual( toJson(descEdition, msgEdition, { enumAsInteger: true, }), - ).toStrictEqual( toJson(descProto3, msgProto3, { enumAsInteger: true, }), @@ -181,7 +180,7 @@ describe("edition2023 serialization", () => { const bytesProto3 = toBinary(descProto3, msgProto3); const descEdition = edition2023_ts.Edition2023FromProto3MessageSchema; const msgEdition = fillEditionMessage(create(descEdition)); - expect(fromBinary(descEdition, bytesProto3)).toStrictEqual(msgEdition); + assert.deepStrictEqual(fromBinary(descEdition, bytesProto3), msgEdition); }); test("from json", () => { const descProto3 = @@ -192,7 +191,7 @@ describe("edition2023 serialization", () => { }); const descEdition = edition2023_ts.Edition2023FromProto3MessageSchema; const msgEdition = fillEditionMessage(create(descEdition)); - expect(fromJson(descEdition, jsonProto3)).toStrictEqual(msgEdition); + assert.deepStrictEqual(fromJson(descEdition, jsonProto3), msgEdition); }); function fillEditionMessage( @@ -221,13 +220,13 @@ describe("edition2023 serialization", () => { return msg; } }); - describe("message_encoding DELIMITED with maps", () => { + void suite("message_encoding DELIMITED with maps", () => { test("should round-trip", () => { const a = create(Edition2023MapEncodingMessageSchema); a.stringMap[123] = "abc"; const bytes = toBinary(Edition2023MapEncodingMessageSchema, a); const b = fromBinary(Edition2023MapEncodingMessageSchema, bytes); - expect(b).toStrictEqual(a); + assert.deepStrictEqual(b, a); }); test("should expect LENGTH_PREFIXED map entry", () => { const w = new BinaryWriter(); @@ -238,7 +237,7 @@ describe("edition2023 serialization", () => { w.join(); const bytes = w.finish(); const msg = fromBinary(Edition2023MapEncodingMessageSchema, bytes); - expect(msg.stringMap).toStrictEqual({ + assert.deepStrictEqual(msg.stringMap, { 123: "abc", }); }); @@ -251,7 +250,7 @@ describe("edition2023 serialization", () => { w.join(); const bytes = w.finish(); const msg = fromBinary(Edition2023MapEncodingMessageSchema, bytes); - expect(msg.messageMap).toStrictEqual({ + assert.deepStrictEqual(msg.messageMap, { 123: create(Edition2023MapEncodingMessage_ChildSchema), }); }); @@ -262,22 +261,22 @@ describe("edition2023 serialization", () => { const r = new BinaryReader(bytes); { const [number, wireType] = r.tag(); - expect(number).toBe(77); - expect(wireType).toBe(WireType.LengthDelimited); + assert.strictEqual(number, 77); + assert.strictEqual(wireType, WireType.LengthDelimited); const length = r.uint32(); - expect(length).toBe(r.len - r.pos); + assert.strictEqual(length, r.len - r.pos); } { const [number] = r.tag(); - expect(number).toBe(1); - expect(r.int32()).toBe(123); + assert.strictEqual(number, 1); + assert.strictEqual(r.int32(), 123); } { const [number] = r.tag(); - expect(number).toBe(2); - expect(r.string()).toBe("abc"); + assert.strictEqual(number, 2); + assert.strictEqual(r.string(), "abc"); } - expect(r.pos).toBe(r.len); + assert.strictEqual(r.pos, r.len); }); test("should serialize map value message LENGTH_PREFIXED", () => { const msg = create(Edition2023MapEncodingMessageSchema); @@ -286,24 +285,24 @@ describe("edition2023 serialization", () => { const r = new BinaryReader(bytes); { const [number, wireType] = r.tag(); - expect(number).toBe(88); - expect(wireType).toBe(WireType.LengthDelimited); + assert.strictEqual(number, 88); + assert.strictEqual(wireType, WireType.LengthDelimited); const length = r.uint32(); - expect(length).toBe(r.len - r.pos); + assert.strictEqual(length, r.len - r.pos); } { const [number] = r.tag(); - expect(number).toBe(1); - expect(r.int32()).toBe(123); + assert.strictEqual(number, 1); + assert.strictEqual(r.int32(), 123); } { const [number, wireType] = r.tag(); - expect(number).toBe(2); - expect(wireType).toBe(WireType.LengthDelimited); + assert.strictEqual(number, 2); + assert.strictEqual(wireType, WireType.LengthDelimited); const length = r.uint32(); - expect(length).toBe(0); + assert.strictEqual(length, 0); } - expect(r.pos).toBe(r.len); + assert.strictEqual(r.pos, r.len); }); }); }); diff --git a/packages/protobuf-test/src/enum-open-closed.test.ts b/packages/protobuf-test/src/enum-open-closed.test.ts index 08a5f1e34..f3fd05cdd 100644 --- a/packages/protobuf-test/src/enum-open-closed.test.ts +++ b/packages/protobuf-test/src/enum-open-closed.test.ts @@ -12,17 +12,18 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { BinaryWriter, WireType } from "@bufbuild/protobuf/wire"; import { fromBinary, isFieldSet } from "@bufbuild/protobuf"; import * as proto3_ts from "./gen/ts/extra/proto3_pb.js"; import * as proto2_ts from "./gen/ts/extra/proto2_pb.js"; -describe("open enum", () => { +void suite("open enum", () => { test("from binary sets foreign value", () => { - expect(proto3_ts.Proto3EnumSchema.open).toBe(true); + assert.strictEqual(proto3_ts.Proto3EnumSchema.open, true); const foreignValue = 4; - expect(proto3_ts.Proto3Enum[foreignValue]).toBeUndefined(); + assert.strictEqual(proto3_ts.Proto3Enum[foreignValue], undefined); const bytes = new BinaryWriter() .tag( proto3_ts.Proto3MessageSchema.field.singularEnumField.number, @@ -35,17 +36,17 @@ describe("open enum", () => { msg, proto3_ts.Proto3MessageSchema.field.singularEnumField, ); - expect(set).toBe(true); - expect(msg.singularEnumField).toBe(foreignValue); - expect(msg.$unknown).toBeUndefined(); + assert.strictEqual(set, true); + assert.strictEqual(msg.singularEnumField, foreignValue); + assert.strictEqual(msg.$unknown, undefined); }); }); -describe("closed enum", () => { +void suite("closed enum", () => { test("from binary sets foreign value as unknown field", () => { - expect(proto2_ts.Proto2EnumSchema.open).toBe(false); + assert.strictEqual(proto2_ts.Proto2EnumSchema.open, false); const foreignValue = 4; - expect(proto2_ts.Proto2Enum[foreignValue]).toBeUndefined(); + assert.strictEqual(proto2_ts.Proto2Enum[foreignValue], undefined); const bytes = new BinaryWriter() .tag( proto2_ts.Proto2MessageSchema.field.optionalEnumField.number, @@ -58,15 +59,15 @@ describe("closed enum", () => { msg, proto2_ts.Proto2MessageSchema.field.optionalEnumField, ); - expect(set).toBe(false); - expect(msg.optionalEnumField).toBe(proto2_ts.Proto2Enum.YES); - expect(msg.$unknown).toBeDefined(); - expect(msg.$unknown?.length).toBe(1); - expect(msg.$unknown?.[0].no).toBe( + assert.strictEqual(set, false); + assert.strictEqual(msg.optionalEnumField, proto2_ts.Proto2Enum.YES); + assert.ok(msg.$unknown !== undefined); + assert.strictEqual(msg.$unknown?.length, 1); + assert.strictEqual(msg.$unknown?.[0].no, proto2_ts.Proto2MessageSchema.field.optionalEnumField.number, ); - expect(msg.$unknown?.[0].wireType).toBe(WireType.Varint); - expect(msg.$unknown?.[0].data).toStrictEqual( + assert.strictEqual(msg.$unknown?.[0].wireType, WireType.Varint); + assert.deepStrictEqual(msg.$unknown?.[0].data, new BinaryWriter().int32(foreignValue).finish(), ); }); diff --git a/packages/protobuf-test/src/equals.test.ts b/packages/protobuf-test/src/equals.test.ts index 8874cb55b..2c7d5fda3 100644 --- a/packages/protobuf-test/src/equals.test.ts +++ b/packages/protobuf-test/src/equals.test.ts @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { beforeEach, describe, expect, test } from "@jest/globals"; -import assert from "node:assert"; +import { suite, test, beforeEach } from "node:test"; +import * as assert from "node:assert"; import { create, equals, @@ -37,47 +37,47 @@ import { fillProto3Message } from "./helpers-proto3.js"; import { fillProto2Message } from "./helpers-proto2.js"; import { fillEdition2023Message } from "./helpers-edition2023.js"; -describe("equals()", () => { - test("same messages are equal", () => { +void suite("equals()", () => { + void test("same messages are equal", () => { const a = create(proto3_ts.Proto3MessageSchema); const b = a; - expect(equals(proto3_ts.Proto3MessageSchema, a, b)).toBe(true); + assert.strictEqual(equals(proto3_ts.Proto3MessageSchema, a, b), true); }); - test.each([ - proto3_ts.Proto3MessageSchema, + for (const desc of [proto3_ts.Proto3MessageSchema, proto2_ts.Proto2MessageSchema, - edition2023_ts.Edition2023MessageSchema, - ])("equal zero messages are equal $typeName", (desc) => { - const a = create(desc); - const b = create(desc); - expect(equals(desc, a, b)).toBe(true); - }); - test("equal proto3 messages are equal", () => { + edition2023_ts.Edition2023MessageSchema,]) { + void test(`equal zero messages are equal ${desc.typeName}`, () => { + const a = create(desc); + const b = create(desc); + assert.ok(equals(desc, a, b)); + }); + } + void test("equal proto3 messages are equal", () => { const a = fillProto3Message(create(proto3_ts.Proto3MessageSchema)); const b = fillProto3Message(create(proto3_ts.Proto3MessageSchema)); - expect(equals(proto3_ts.Proto3MessageSchema, a, b)).toBe(true); + assert.ok(equals(proto3_ts.Proto3MessageSchema, a, b)); }); - test("equal proto2 messages are equal", () => { + void test("equal proto2 messages are equal", () => { const a = fillProto2Message(create(proto2_ts.Proto2MessageSchema)); const b = fillProto2Message(create(proto2_ts.Proto2MessageSchema)); - expect(equals(proto2_ts.Proto2MessageSchema, a, b)).toBe(true); + assert.ok(equals(proto2_ts.Proto2MessageSchema, a, b)); }); - test("equal edition2023 messages are equal", () => { + void test("equal edition2023 messages are equal", () => { const a = fillEdition2023Message( create(edition2023_ts.Edition2023MessageSchema), ); const b = fillEdition2023Message( create(edition2023_ts.Edition2023MessageSchema), ); - expect(equals(edition2023_ts.Edition2023MessageSchema, a, b)).toBe(true); + assert.ok(equals(edition2023_ts.Edition2023MessageSchema, a, b)); }); test("different message types are not equal", () => { const a = create(proto3_ts.Proto3MessageSchema); const b = create(UserSchema); - expect(equals(proto3_ts.Proto3MessageSchema as DescMessage, a, b)).toBe( + assert.strictEqual(equals(proto3_ts.Proto3MessageSchema as DescMessage, a, b), false, ); - expect(equals(proto3_ts.Proto3MessageSchema as DescMessage, b, b)).toBe( + assert.strictEqual(equals(proto3_ts.Proto3MessageSchema as DescMessage, b, b), false, ); }); @@ -85,14 +85,14 @@ describe("equals()", () => { const desc: DescMessage = proto3_ts.Proto3MessageSchema; const a: Message = create(proto3_ts.Proto3MessageSchema); const b: Message = create(proto3_ts.Proto3MessageSchema); - expect(equals(desc, a, b)).toBe(true); + assert.ok(equals(desc, a, b)); }); test("NaN does not equal NaN", () => { const a = create(proto3_ts.Proto3MessageSchema); a.singularFloatField = Number.NaN; const b = create(proto3_ts.Proto3MessageSchema); b.singularFloatField = Number.NaN; - expect(equals(proto3_ts.Proto3MessageSchema, a, b)).toBe(false); + assert.strictEqual(equals(proto3_ts.Proto3MessageSchema, a, b), false); }); test("extensions and unknown fields are disregarded", () => { const a = create(proto3_ts.Proto3MessageSchema); @@ -100,49 +100,47 @@ describe("equals()", () => { { no: 10100, wireType: WireType.Varint, data: new Uint8Array([0]) }, ]; const b = create(proto3_ts.Proto3MessageSchema); - expect(equals(proto3_ts.Proto3MessageSchema, a, b)).toBe(true); + assert.ok(equals(proto3_ts.Proto3MessageSchema, a, b)); }); test("set proto2 field is not equal unset field", () => { const a = create(proto2_ts.Proto2MessageSchema); const b = create(proto2_ts.Proto2MessageSchema); b.optionalStringField = ""; - expect(equals(proto2_ts.Proto2MessageSchema, a, b)).toBe(false); + assert.strictEqual(equals(proto2_ts.Proto2MessageSchema, a, b), false); }); - describe("set proto3 field is not equal unset field", () => { + void suite("set proto3 field is not equal unset field", () => { const desc = proto3_ts.Proto3MessageSchema; const a = fillProto3Message(create(desc)); let b: proto3_ts.Proto3Message; beforeEach(() => { b = fillProto3Message(create(desc)); }); - test.each(desc.fields.filter((f) => reflect(desc, a).isSet(f)))( - "$name", - (f) => { + for (const f of desc.fields.filter(f => reflect(desc, a).isSet(f))) { + void test(`${f.name}`, () => { reflect(desc, b).clear(f); - expect(reflect(desc, b).isSet(f)).toBe(false); - expect(reflect(desc, a).isSet(f)).toBe(true); - expect(equals(desc, a, b)).toBe(false); - }, - ); + assert.strictEqual(reflect(desc, b).isSet(f), false); + assert.strictEqual(reflect(desc, a).isSet(f), true); + assert.strictEqual(equals(desc, a, b), false); + }); + } }); - describe("set edition2023 field is not equal unset field", () => { + void suite("set edition2023 field is not equal unset field", () => { const desc = edition2023_ts.Edition2023MessageSchema; const a = fillEdition2023Message(create(desc)); let b: edition2023_ts.Edition2023Message; beforeEach(() => { b = fillEdition2023Message(create(desc)); }); - test.each(desc.fields.filter((f) => reflect(desc, a).isSet(f)))( - "$name", - (f) => { + for (const f of desc.fields.filter(f => reflect(desc, a).isSet(f))) { + void test(`${f.name}`, () => { reflect(desc, b).clear(f); - expect(reflect(desc, b).isSet(f)).toBe(false); - expect(reflect(desc, a).isSet(f)).toBe(true); - expect(equals(desc, a, b)).toBe(false); - }, - ); + assert.strictEqual(reflect(desc, b).isSet(f), false); + assert.strictEqual(reflect(desc, a).isSet(f), true); + assert.strictEqual(equals(desc, a, b), false); + }); + } }); - describe("modified", () => { + void suite("modified", () => { let a: proto3_ts.Proto3Message; let b: proto3_ts.Proto3Message; beforeEach(() => { @@ -151,40 +149,40 @@ describe("equals()", () => { }); test("singularStringField is not equal", () => { b.singularStringField = "modified"; - expect(equals(proto3_ts.Proto3MessageSchema, a, b)).toBe(false); + assert.strictEqual(equals(proto3_ts.Proto3MessageSchema, a, b), false); }); test("singularBytesField is not equal", () => { b.singularBytesField[0] = 0x01; - expect(equals(proto3_ts.Proto3MessageSchema, a, b)).toBe(false); + assert.strictEqual(equals(proto3_ts.Proto3MessageSchema, a, b), false); }); test("optionalStringField is not equal", () => { b.optionalStringField = "modified"; - expect(equals(proto3_ts.Proto3MessageSchema, a, b)).toBe(false); + assert.strictEqual(equals(proto3_ts.Proto3MessageSchema, a, b), false); }); test("repeatedStringField is not equal", () => { b.repeatedStringField.push("modified"); - expect(equals(proto3_ts.Proto3MessageSchema, a, b)).toBe(false); + assert.strictEqual(equals(proto3_ts.Proto3MessageSchema, a, b), false); }); test("oneof is not equal", () => { b.either = { case: "oneofInt32Field", value: 123 }; - expect(equals(proto3_ts.Proto3MessageSchema, a, b)).toBe(false); + assert.strictEqual(equals(proto3_ts.Proto3MessageSchema, a, b), false); }); test("singularMessageField is not equal", () => { - assert(b.singularMessageField); + assert.ok(b.singularMessageField); b.singularMessageField.singularStringField = "modified"; - expect(equals(proto3_ts.Proto3MessageSchema, a, b)).toBe(false); + assert.strictEqual(equals(proto3_ts.Proto3MessageSchema, a, b), false); }); test("mapStringStringField is not equal", () => { b.mapStringStringField.modified = "modified"; - expect(equals(proto3_ts.Proto3MessageSchema, a, b)).toBe(false); + assert.strictEqual(equals(proto3_ts.Proto3MessageSchema, a, b), false); }); test("mapInt32MessageField is not equal", () => { b.mapInt32MessageField[123].singularStringField = "modified"; - expect(equals(proto3_ts.Proto3MessageSchema, a, b)).toBe(false); + assert.strictEqual(equals(proto3_ts.Proto3MessageSchema, a, b), false); }); }); - describe("with extensions enabled", () => { + void suite("with extensions enabled", () => { const schema = extensions_proto2.Proto2ExtendeeSchema; const ext = extensions_proto2.uint32_ext; function unknownEq( @@ -203,7 +201,7 @@ describe("equals()", () => { const b = create(schema, {}); setExtension(b, ext, 123); const reg = createRegistry(ext); - expect(unknownEq(a, b, reg)).toBe(true); + assert.strictEqual(unknownEq(a, b, reg), true); }); test("different extension values are equal", () => { const a = create(schema, {}); @@ -211,14 +209,14 @@ describe("equals()", () => { const b = create(schema, {}); setExtension(b, ext, 456); const reg = createRegistry(ext); - expect(unknownEq(a, b, reg)).toBe(false); + assert.strictEqual(unknownEq(a, b, reg), false); }); test("unset extension value is not equal set extension value", () => { const a = create(schema, {}); setExtension(a, ext, 123); const b = create(schema, {}); const reg = createRegistry(ext); - expect(unknownEq(a, b, reg)).toBe(false); + assert.strictEqual(unknownEq(a, b, reg), false); }); test("compares extension value instead of unknown field", () => { const a = create(schema, {}); @@ -226,11 +224,11 @@ describe("equals()", () => { const b = create(schema, {}); b.$unknown = [...(a.$unknown ?? []), ...(a.$unknown ?? [])]; const reg = createRegistry(ext); - expect(unknownEq(a, b, reg)).toBe(true); + assert.strictEqual(unknownEq(a, b, reg), true); }); }); - describe("with unknown enabled", () => { + void suite("with unknown enabled", () => { function unknownEq( unknownA: UnknownField[] | undefined, unknownB: UnknownField[] | undefined, @@ -252,7 +250,7 @@ describe("equals()", () => { const b = [ { no: 10100, wireType: WireType.Varint, data: new Uint8Array([0]) }, ]; - expect(unknownEq(a, b)).toBe(true); + assert.strictEqual(unknownEq(a, b), true); }); test("different unknown fields are not equal", () => { const a = [ @@ -265,11 +263,11 @@ describe("equals()", () => { data: new Uint8Array([0]), }, ]; - expect(unknownEq(a, b)).toBe(false); + assert.strictEqual(unknownEq(a, b), false); }); }); - describe("with unpackAny enabled", () => { + void suite("with unpackAny enabled", () => { function anyEq(anyA: Any, anyB: Any, registry: Registry) { const hostSchema = test_messages_proto3.TestAllTypesProto3Schema; const hostA = create(hostSchema, { @@ -287,13 +285,13 @@ describe("equals()", () => { const reg = createRegistry(UserSchema); const a = anyPack(UserSchema, create(UserSchema, { active: true })); const b = anyPack(UserSchema, create(UserSchema, { active: true })); - expect(anyEq(a, b, reg)).toBe(true); + assert.strictEqual(anyEq(a, b, reg), true); }); test("different packed Any are not equal", () => { const reg = createRegistry(UserSchema); const a = anyPack(UserSchema, create(UserSchema, { active: true })); const b = anyPack(UserSchema, create(UserSchema, { active: false })); - expect(anyEq(a, b, reg)).toBe(false); + assert.strictEqual(anyEq(a, b, reg), false); }); test("requires Any.typeUrl to be exactly the same", () => { const reg = createRegistry(UserSchema); @@ -301,7 +299,7 @@ describe("equals()", () => { a.typeUrl = `type.googleapis.com/${UserSchema.typeName}`; const b = anyPack(UserSchema, create(UserSchema, { active: true })); b.typeUrl = `example.com/${UserSchema.typeName}`; - expect(anyEq(a, b, reg)).toBe(false); + assert.strictEqual(anyEq(a, b, reg), false); }); test("compares unpacked instead of Any.value bytes", () => { const reg = createRegistry(UserSchema); @@ -320,8 +318,8 @@ describe("equals()", () => { b.value = new Uint8Array(a.value.byteLength * 2); b.value.set(a.value, 0); b.value.set(a.value, a.value.byteLength); - expect(a.value).not.toStrictEqual(b.value); - expect(anyEq(a, b, reg)).toBe(true); + assert.notDeepStrictEqual(a.value, b.value); + assert.strictEqual(anyEq(a, b, reg), true); }); test("compares Any.value bytes if message not in registry", () => { const reg = createRegistry(); @@ -340,8 +338,8 @@ describe("equals()", () => { b.value = new Uint8Array(a.value.byteLength * 2); b.value.set(a.value, 0); b.value.set(a.value, a.value.byteLength); - expect(a.value).not.toStrictEqual(b.value); - expect(anyEq(a, b, reg)).toBe(false); + assert.notDeepStrictEqual(a.value, b.value); + assert.strictEqual(anyEq(a, b, reg), false); }); test("Any in Any", () => { const reg = createRegistry(UserSchema, AnySchema); @@ -356,7 +354,7 @@ describe("equals()", () => { b.value = new Uint8Array(a.value.byteLength * 2); b.value.set(a.value, 0); b.value.set(a.value, a.value.byteLength); - expect(anyEq(a, b, reg)).toBe(true); + assert.strictEqual(anyEq(a, b, reg), true); }); }); }); diff --git a/packages/protobuf-test/src/extensions.test.ts b/packages/protobuf-test/src/extensions.test.ts index 2324eed76..3aa02ab2a 100644 --- a/packages/protobuf-test/src/extensions.test.ts +++ b/packages/protobuf-test/src/extensions.test.ts @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +import { suite, test, beforeEach } from "node:test"; +import * as assert from "node:assert"; import { create, getExtension, @@ -26,7 +28,6 @@ import { type DescExtension, type DescMessage, } from "@bufbuild/protobuf"; -import { describe, expect, it, beforeEach } from "@jest/globals"; import { UserSchema } from "./gen/ts/extra/example_pb.js"; import type { Proto2Extendee } from "./gen/ts/extra/extensions-proto2_pb.js"; import { @@ -147,17 +148,18 @@ const goldenValuesZero: extensionWithValueCollection = [ { ext: Proto2ExtContainer_Child_uint32_ext, val: 0 }, ]; -describe("getExtension()", () => { - it("should throw error if extendee does not match", () => { +void suite("getExtension()", () => { + void test("should throw error if extendee does not match", () => { const msg = create(UserSchema); - expect(() => + assert.throws(() => getExtension(msg as unknown as Proto2Extendee, uint32_ext), - ).toThrow( - /^extension proto2ext.uint32_ext can only be applied to message proto2ext.Proto2Extendee$/, + { + message: /^extension proto2ext.uint32_ext can only be applied to message proto2ext.Proto2Extendee$/, + } ); }); - describe("for scalar", () => { - it("should parse from unknown fields", () => { + void suite("for scalar", () => { + void test("should parse from unknown fields", () => { const msg = create(Proto2ExtendeeSchema); msg.$unknown = [ { @@ -166,9 +168,9 @@ describe("getExtension()", () => { data: new BinaryWriter().uint32(123).finish(), }, ]; - expect(getExtension(msg, uint32_ext)).toBe(123); + assert.strictEqual(getExtension(msg, uint32_ext), 123); }); - it("should parse last value from unknown fields", () => { + void test("should parse last value from unknown fields", () => { const msg = create(Proto2ExtendeeSchema); msg.$unknown = [ { @@ -182,23 +184,23 @@ describe("getExtension()", () => { data: new BinaryWriter().uint32(456).finish(), }, ]; - expect(getExtension(msg, uint32_ext)).toBe(456); + assert.strictEqual(getExtension(msg, uint32_ext), 456); }); - it("should return zero value if unset", () => { - expect(getExtension(create(Proto2ExtendeeSchema), string_ext)).toBe(""); - expect(getExtension(create(Proto2ExtendeeSchema), uint32_ext)).toBe(0); + void test("should return zero value if unset", () => { + assert.strictEqual(getExtension(create(Proto2ExtendeeSchema), string_ext), ""); + assert.strictEqual(getExtension(create(Proto2ExtendeeSchema), uint32_ext), 0); }); - it("should return default value if unset", () => { - expect( + void test("should return default value if unset", () => { + assert.strictEqual( getExtension(create(Proto2ExtendeeSchema), string_ext_with_default), - ).toBe(`hello " */ `); - expect( + `hello " */ `); + assert.strictEqual( getExtension(create(Proto2ExtendeeSchema), uint32_ext_with_default), - ).toBe(999); + 999); }); }); - describe("for repeated scalar", () => { - it("should parse from unpacked unknown fields", () => { + void suite("for repeated scalar", () => { + void test("should parse from unpacked unknown fields", () => { const msg = create(Proto2ExtendeeSchema); msg.$unknown = [ { @@ -212,9 +214,9 @@ describe("getExtension()", () => { data: new BinaryWriter().uint32(456).finish(), }, ]; - expect(getExtension(msg, unpacked_uint32_ext)).toStrictEqual([123, 456]); + assert.deepStrictEqual(getExtension(msg, unpacked_uint32_ext), [123, 456]); }); - it("should parse from packed unknown field", () => { + void test("should parse from packed unknown field", () => { const msg = create(Proto2ExtendeeSchema); msg.$unknown = [ { @@ -228,9 +230,9 @@ describe("getExtension()", () => { .finish(), }, ]; - expect(getExtension(msg, packed_uint32_ext)).toStrictEqual([123, 456]); + assert.deepStrictEqual(getExtension(msg, packed_uint32_ext), [123, 456]); }); - it("should parse from string unknown fields", () => { + void test("should parse from string unknown fields", () => { const msg = create(Proto2ExtendeeSchema); msg.$unknown = [ { @@ -244,16 +246,16 @@ describe("getExtension()", () => { data: new BinaryWriter().string("b").finish(), }, ]; - expect(getExtension(msg, repeated_string_ext)).toStrictEqual(["a", "b"]); + assert.deepStrictEqual(getExtension(msg, repeated_string_ext), ["a", "b"]); }); - it("should return zero value if unset", () => { - expect( - getExtension(create(Proto2ExtendeeSchema), unpacked_uint32_ext), - ).toStrictEqual([]); + void test("should return zero value if unset", () => { + assert.deepStrictEqual( + getExtension(create(Proto2ExtendeeSchema), unpacked_uint32_ext) + , []); }); }); - describe("for enum", () => { - it("should parse from unknown fields", () => { + void suite("for enum", () => { + void test("should parse from unknown fields", () => { const message = create(Proto2ExtendeeSchema); message.$unknown = [ { @@ -262,9 +264,9 @@ describe("getExtension()", () => { data: new BinaryWriter().uint32(Proto2ExtEnum.NO).finish(), }, ]; - expect(getExtension(message, enum_ext)).toBe(Proto2ExtEnum.NO); + assert.strictEqual(getExtension(message, enum_ext), Proto2ExtEnum.NO); }); - it("should parse last value from unknown fields", () => { + void test("should parse last value from unknown fields", () => { const message = create(Proto2ExtendeeSchema); message.$unknown = [ { @@ -278,21 +280,21 @@ describe("getExtension()", () => { data: new BinaryWriter().uint32(Proto2ExtEnum.NO).finish(), }, ]; - expect(getExtension(message, enum_ext)).toBe(Proto2ExtEnum.NO); + assert.strictEqual(getExtension(message, enum_ext), Proto2ExtEnum.NO); }); - it("should return zero value if unset", () => { - expect(getExtension(create(Proto2ExtendeeSchema), enum_ext)).toBe( + void test("should return zero value if unset", () => { + assert.strictEqual(getExtension(create(Proto2ExtendeeSchema), enum_ext), Proto2ExtEnum.YES, ); }); - it("should return default value if unset", () => { - expect( - getExtension(create(Proto2ExtendeeSchema), enum_ext_with_default), - ).toBe(Proto2ExtEnum.NO); + void test("should return default value if unset", () => { + assert.strictEqual( + getExtension(create(Proto2ExtendeeSchema), enum_ext_with_default) + , Proto2ExtEnum.NO); }); }); - describe("for repeated enum", () => { - it("should parse from unknown fields", () => { + void suite("for repeated enum", () => { + void test("should parse from unknown fields", () => { const message = create(Proto2ExtendeeSchema); message.$unknown = [ { @@ -306,9 +308,9 @@ describe("getExtension()", () => { data: new BinaryWriter().uint32(2).finish(), }, ]; - expect(getExtension(message, repeated_enum_ext)).toStrictEqual([1, 2]); + assert.deepStrictEqual(getExtension(message, repeated_enum_ext), [1, 2]); }); - it("should parse from packed unknown field", () => { + void test("should parse from packed unknown field", () => { const message = create(Proto2ExtendeeSchema); message.$unknown = [ { @@ -317,15 +319,15 @@ describe("getExtension()", () => { data: new BinaryWriter().fork().uint32(1).uint32(2).join().finish(), }, ]; - expect(getExtension(message, repeated_enum_ext)).toStrictEqual([1, 2]); + assert.deepStrictEqual(getExtension(message, repeated_enum_ext), [1, 2]); }); - it("should return zero value if unset", () => { - expect( - getExtension(create(Proto2ExtendeeSchema), repeated_enum_ext), - ).toStrictEqual([]); + void test("should return zero value if unset", () => { + assert.deepStrictEqual( + getExtension(create(Proto2ExtendeeSchema), repeated_enum_ext) + , []); }); }); - describe("for message", () => { + void suite("for message", () => { function addUnknownMessageField( message: Proto2Extendee, fieldNo: number, @@ -341,7 +343,7 @@ describe("getExtension()", () => { }, ]; } - it("should read unknown fields", () => { + void test("should read unknown fields", () => { const msg = create(Proto2ExtendeeSchema); const wantValue = create(Proto2ExtMessageSchema, { stringField: "John", @@ -360,10 +362,10 @@ describe("getExtension()", () => { wantValue, ); const gotValue = getExtension(msg, message_ext); - expect(gotValue.stringField).toBe("John"); - expect(gotValue.$unknown).toStrictEqual(wantValue.$unknown); + assert.strictEqual(gotValue.stringField, "John"); + assert.deepStrictEqual(gotValue.$unknown, wantValue.$unknown); }); - it("should return value parsed from unknown fields", () => { + void test("should return value parsed from unknown fields", () => { const msg = create(Proto2ExtendeeSchema); addUnknownMessageField( msg, @@ -374,10 +376,10 @@ describe("getExtension()", () => { }), ); const value = getExtension(msg, message_ext_proto3); - expect(isMessage(value, UserSchema)).toBeTruthy(); - expect(value.firstName).toBe("John"); + assert.ok(isMessage(value, UserSchema)); + assert.strictEqual(value.firstName, "John"); }); - it("should return merged value parsed from multiple unknown fields", () => { + void test("should return merged value parsed from multiple unknown fields", () => { const msg = create(Proto2ExtendeeSchema); addUnknownMessageField( msg, @@ -396,31 +398,31 @@ describe("getExtension()", () => { }), ); const value = getExtension(msg, message_ext_proto3); - expect(isMessage(value, UserSchema)).toBeTruthy(); - expect(value.firstName).toBe("John"); - expect(value.lastName).toBe("Doe"); + assert.ok(isMessage(value, UserSchema)); + assert.strictEqual(value.firstName, "John"); + assert.strictEqual(value.lastName, "Doe"); }); - it("should return empty proto3 message if unset", () => { + void test("should return empty proto3 message if unset", () => { const msg = create(Proto2ExtendeeSchema); const value = getExtension(msg, message_ext_proto3); - expect(isMessage(value, UserSchema)).toBeTruthy(); - expect(equals(UserSchema, value, create(UserSchema))).toBeTruthy(); + assert.ok(isMessage(value, UserSchema)); + assert.ok(equals(UserSchema, value, create(UserSchema))); }); - it("should return empty proto2 message if unset", () => { + void test("should return empty proto2 message if unset", () => { const msg = create(Proto2ExtendeeSchema); const value = getExtension(msg, message_ext); - expect(isMessage(value, Proto2ExtMessageSchema)).toBeTruthy(); - expect( + assert.ok(isMessage(value, Proto2ExtMessageSchema)); + assert.ok( equals(Proto2ExtMessageSchema, value, create(Proto2ExtMessageSchema)), - ).toBeTruthy(); + ); }); - describe("with WKT wrapper", () => { - it("should return unwrapped default value if unset", () => { + void suite("with WKT wrapper", () => { + void test("should return unwrapped default value if unset", () => { const msg = create(Proto2ExtendeeSchema); const value = getExtension(msg, wrapper_ext); - expect(value).toBe(0); + assert.strictEqual(value, 0); }); - it("should return unwrapped value if set", () => { + void test("should return unwrapped value if set", () => { const msg = create(Proto2ExtendeeSchema); addUnknownMessageField( msg, @@ -431,12 +433,12 @@ describe("getExtension()", () => { }), ); const value = getExtension(msg, wrapper_ext); - expect(typeof value).toBe("number"); - expect(value).toBe(123); + assert.strictEqual(typeof value, "number"); + assert.strictEqual(value, 123); }); }); }); - describe("for repeated message", () => { + void suite("for repeated message", () => { function addUnknownMessageField( message: Proto2Extendee, fieldNo: number, @@ -453,7 +455,7 @@ describe("getExtension()", () => { ]; } - it("should parse from unknown fields", () => { + void test("should parse from unknown fields", () => { const msg = create(Proto2ExtendeeSchema); addUnknownMessageField( msg, @@ -472,16 +474,16 @@ describe("getExtension()", () => { }), ); const arr = getExtension(msg, repeated_message_ext); - expect(arr.length).toBe(2); - expect(arr[0].stringField).toBe("a"); - expect(arr[1].stringField).toBe("b"); + assert.strictEqual(arr.length, 2); + assert.strictEqual(arr[0].stringField, "a"); + assert.strictEqual(arr[1].stringField, "b"); }); - it("should return zero value if unset", () => { + void test("should return zero value if unset", () => { const msg = create(Proto2ExtendeeSchema); - expect(getExtension(msg, repeated_message_ext)).toStrictEqual([]); + assert.deepStrictEqual(getExtension(msg, repeated_message_ext), []); }); }); - describe("for group", () => { + void suite("for group", () => { function addUnknownGroupField( message: Proto2Extendee, fieldNo: number, @@ -501,7 +503,7 @@ describe("getExtension()", () => { ]; } - it("should return value parsed from unknown fields", () => { + void test("should return value parsed from unknown fields", () => { const msg = create(Proto2ExtendeeSchema); addUnknownGroupField( msg, @@ -512,10 +514,10 @@ describe("getExtension()", () => { }), ); const value = getExtension(msg, groupext); - expect(isMessage(value, GroupExtSchema)).toBeTruthy(); - expect(value.a).toBe(123); + assert.ok(isMessage(value, GroupExtSchema)); + assert.strictEqual(value.a, 123); }); - it("should return merged value parsed from multiple unknown fields", () => { + void test("should return merged value parsed from multiple unknown fields", () => { const msg = create(Proto2ExtendeeSchema); addUnknownGroupField( msg, @@ -534,20 +536,20 @@ describe("getExtension()", () => { }), ); const value = getExtension(msg, groupext); - expect(isMessage(value, GroupExtSchema)).toBeTruthy(); - expect(value.a).toBe(123); - expect(value.b).toBe(456); + assert.ok(isMessage(value, GroupExtSchema)); + assert.strictEqual(value.a, 123); + assert.strictEqual(value.b, 456); }); - it("should return empty group if unset", () => { + void test("should return empty group if unset", () => { const msg = create(Proto2ExtendeeSchema); const value = getExtension(msg, groupext); - expect(isMessage(value, GroupExtSchema)).toBeTruthy(); - expect( + assert.ok(isMessage(value, GroupExtSchema)); + assert.ok( equals(GroupExtSchema, value, create(GroupExtSchema)), - ).toBeTruthy(); + ); }); }); - describe("for repeated group", () => { + void suite("for repeated group", () => { function addUnknownGroupField( message: Proto2Extendee, fieldNo: number, @@ -567,7 +569,7 @@ describe("getExtension()", () => { ]; } - it("should parse from unknown fields", () => { + void test("should parse from unknown fields", () => { const msg = create(Proto2ExtendeeSchema); addUnknownGroupField( msg, @@ -586,18 +588,18 @@ describe("getExtension()", () => { }), ); const arr = getExtension(msg, repeatedgroupext); - expect(arr.length).toBe(2); - expect(arr[0].a).toBe(123); - expect(arr[1].a).toBe(456); + assert.strictEqual(arr.length, 2); + assert.strictEqual(arr[0].a, 123); + assert.strictEqual(arr[1].a, 456); }); - it("should return zero value if unset", () => { + void test("should return zero value if unset", () => { const msg = create(Proto2ExtendeeSchema); - expect(getExtension(msg, repeatedgroupext)).toStrictEqual([]); + assert.deepStrictEqual(getExtension(msg, repeatedgroupext), []); }); }); }); -describe("hasExtension()", () => { +void suite("hasExtension()", () => { let msg: Proto2Extendee; let ext: DescExtension; beforeEach(() => { @@ -611,18 +613,18 @@ describe("hasExtension()", () => { ]; ext = { ...uint32_ext, number: 1001 }; }); - it("should return true if extendee and field number match", () => { - expect(hasExtension(msg, ext)).toBeTruthy(); + void test("should return true if extendee and field number match", () => { + assert.ok(hasExtension(msg, ext)); }); - it("should return false if field number does not match", () => { + void test("should return false if field number does not match", () => { ext = { ...ext, number: ext.number + 1 }; - expect(hasExtension(msg, ext)).toBeFalsy(); + assert.strictEqual(hasExtension(msg, ext), false); }); - it("should return false if extendee does not match", () => { + void test("should return false if extendee does not match", () => { ext = { ...ext, extendee: UserSchema }; - expect(hasExtension(msg, ext)).toBeFalsy(); + assert.strictEqual(hasExtension(msg, ext), false); }); - it("does not honor extension range", () => { + void test("does not honor extension range", () => { const extensionNumberOutOfRange = 77; // extensions-proto2.proto: 1000 to 9999 ext = { ...ext, number: extensionNumberOutOfRange }; msg.$unknown = [ @@ -632,11 +634,11 @@ describe("hasExtension()", () => { data: new Uint8Array(), }, ]; - expect(hasExtension(msg, ext)).toBeTruthy(); + assert.ok(hasExtension(msg, ext)); }); }); -describe("clearExtension()", () => { +void suite("clearExtension()", () => { const listUnknownFieldNumbers = (message: Message) => (message.$unknown ?? []).map((uf) => uf.no); let msg: Proto2Extendee; @@ -651,57 +653,53 @@ describe("clearExtension()", () => { }); } }); - it("should clear unknown fields with extension number and leave others untouched", () => { - expect(listUnknownFieldNumbers(msg)).toStrictEqual([500, 1001, 1001, 1500]); + void test("should clear unknown fields with extension number and leave others untouched", () => { + assert.deepStrictEqual(listUnknownFieldNumbers(msg), [500, 1001, 1001, 1500]); clearExtension(msg, uint32_ext); - expect(listUnknownFieldNumbers(msg)).toStrictEqual([500, 1500]); + assert.deepStrictEqual(listUnknownFieldNumbers(msg), [500, 1500]); clearExtension(msg, uint32_ext); - expect(listUnknownFieldNumbers(msg)).toStrictEqual([500, 1500]); + assert.deepStrictEqual(listUnknownFieldNumbers(msg), [500, 1500]); }); - it("should throw error if extendee does not match", () => { + void test("should throw error if extendee does not match", () => { const msg = create(UserSchema); - expect(() => - clearExtension(msg as unknown as Proto2Extendee, uint32_ext), - ).toThrow( - /^extension proto2ext.uint32_ext can only be applied to message proto2ext.Proto2Extendee$/, - ); + assert.throws(() => + clearExtension(msg as unknown as Proto2Extendee, uint32_ext), { + message: /^extension proto2ext.uint32_ext can only be applied to message proto2ext.Proto2Extendee$/, + }); }); }); -describe("setExtension()", () => { - it("should throw error if extendee does not match", () => { +void suite("setExtension()", () => { + void test("should throw error if extendee does not match", () => { const msg = create(UserSchema); - expect(() => - setExtension(msg as unknown as Proto2Extendee, uint32_ext, 123), - ).toThrow( - /^extension proto2ext.uint32_ext can only be applied to message proto2ext.Proto2Extendee$/, - ); + assert.throws(() => + setExtension(msg as unknown as Proto2Extendee, uint32_ext, 123), { + message: /^extension proto2ext.uint32_ext can only be applied to message proto2ext.Proto2Extendee$/, + }); }); - it.each(goldenValues)( - "should set $ext.typeName as expected", - ({ ext, val }) => { + for (const {ext, val} of goldenValues) { + void test(`should set ${ext.typeName} as expected`, () => { const msg = create(Proto2ExtendeeSchema); - expect(hasExtension(msg, ext)).toBeFalsy(); + assert.strictEqual(hasExtension(msg, ext), false); setExtension(msg, ext, val); - expect(hasExtension(msg, ext)).toBeTruthy(); - expect(getExtension(msg, ext)).toStrictEqual(val); - }, - ); - it.each(goldenValuesZero)( - "should set zero $ext.typeName as expected", - ({ ext, val }) => { + assert.ok(hasExtension(msg, ext)); + assert.deepStrictEqual(getExtension(msg, ext), val); + }); + } + for (const {ext, val} of goldenValuesZero) { + void test(`should set zero ${ext.typeName} as expected`, () => { const msg = create(Proto2ExtendeeSchema); - expect(hasExtension(msg, ext)).toBeFalsy(); + assert.strictEqual(hasExtension(msg, ext), false); setExtension(msg, ext, val); if (ext.fieldKind === "list") { - expect(hasExtension(msg, ext)).toBeFalsy(); + assert.strictEqual(hasExtension(msg, ext), false); } else { - expect(hasExtension(msg, ext)).toBeTruthy(); + assert.ok(hasExtension(msg, ext)); } - expect(getExtension(msg, ext)).toStrictEqual(val); - }, - ); - it("should write unknown fields", () => { + assert.deepStrictEqual(getExtension(msg, ext), val); + }); + } + void test("should write unknown fields", () => { const msg = create(Proto2ExtendeeSchema); const wantValue = create(Proto2ExtMessageSchema, { stringField: "John", @@ -715,75 +713,75 @@ describe("setExtension()", () => { ]; setExtension(msg, message_ext, wantValue); const gotValue = getExtension(msg, message_ext); - expect(gotValue.stringField).toBe("John"); - expect(gotValue.$unknown).toStrictEqual(wantValue.$unknown); + assert.strictEqual(gotValue.stringField, "John"); + assert.deepStrictEqual(gotValue.$unknown, wantValue.$unknown); }); - describe("setting repeated extension twice", () => { - it("should not merge", () => { + void suite("setting repeated extension twice", () => { + void test("should not merge", () => { const msg = create(Proto2ExtendeeSchema); setExtension(msg, repeated_string_ext, ["a"]); setExtension(msg, repeated_string_ext, ["b"]); - expect(getExtension(msg, repeated_string_ext)).toStrictEqual(["b"]); + assert.deepStrictEqual(getExtension(msg, repeated_string_ext), ["b"]); }); }); - describe("proto3", () => { - describe("singular scalar", () => { + void suite("proto3", () => { + void suite("singular scalar", () => { const ext = proto3_uint32_ext; - it("should set non-zero value as expected", () => { + void test("should set non-zero value as expected", () => { const msg = create(FileOptionsSchema); setExtension(msg, ext, 123); - expect(hasExtension(msg, ext)).toBeTruthy(); - expect(getExtension(msg, ext)).toStrictEqual(123); + assert.ok(hasExtension(msg, ext)); + assert.deepStrictEqual(getExtension(msg, ext), 123); }); - it("should set zero value, even without optional keyword", () => { + void test("should set zero value, even without optional keyword", () => { // Implicit presence does not apply to extensions, see https://github.com/protocolbuffers/protobuf/issues/8234 const msg = create(FileOptionsSchema); setExtension(msg, ext, 0); - expect(hasExtension(msg, ext)).toBeTruthy(); - expect(getExtension(msg, ext)).toStrictEqual(0); + assert.ok(hasExtension(msg, ext)); + assert.deepStrictEqual(getExtension(msg, ext), 0); }); }); - describe("optional scalar", () => { + void suite("optional scalar", () => { const ext = proto3_optional_uint32_ext; - it("should set non-zero value as expected", () => { + void test("should set non-zero value as expected", () => { const msg = create(FileOptionsSchema); setExtension(msg, ext, 123); - expect(hasExtension(msg, ext)).toBeTruthy(); - expect(getExtension(msg, ext)).toStrictEqual(123); + assert.ok(hasExtension(msg, ext)); + assert.deepStrictEqual(getExtension(msg, ext), 123); }); - it("should set zero value", () => { + void test("should set zero value", () => { const msg = create(FileOptionsSchema); setExtension(msg, ext, 0); - expect(hasExtension(msg, ext)).toBeTruthy(); - expect(getExtension(msg, ext)).toStrictEqual(0); + assert.ok(hasExtension(msg, ext)); + assert.deepStrictEqual(getExtension(msg, ext), 0); }); }); - describe("packed repeated extension", () => { - it("should set expected unknown fields", () => { + void suite("packed repeated extension", () => { + void test("should set expected unknown fields", () => { const msg = create(FileOptionsSchema); setExtension(msg, proto3_packed_uint32_ext, [1, 2, 3]); const unknownFields = (msg.$unknown ?? []).filter( (uf) => uf.no === packed_uint32_ext.number, ); - expect(unknownFields.length).toBe(1); + assert.strictEqual(unknownFields.length, 1); const allLengthDelimited = unknownFields.every( (uf) => uf.wireType === WireType.LengthDelimited, ); - expect(allLengthDelimited).toBeTruthy(); + assert.ok(allLengthDelimited); }); }); - describe("unpacked repeated extension", () => { - it("should set expected unknown fields", () => { + void suite("unpacked repeated extension", () => { + void test("should set expected unknown fields", () => { const msg = create(FileOptionsSchema); setExtension(msg, proto3_unpacked_uint32_ext, [1, 2, 3]); const unknownFields = (msg.$unknown ?? []).filter( (uf) => uf.no === unpacked_uint32_ext.number, ); - expect(unknownFields.length).toBe(3); + assert.strictEqual(unknownFields.length, 3); const noneLengthDelimited = unknownFields.every( (uf) => uf.wireType !== WireType.LengthDelimited, ); - expect(noneLengthDelimited).toBeTruthy(); + assert.ok(noneLengthDelimited); }); }); }); From 08cae0c9b756f039388f51a2c944156b57866d70 Mon Sep 17 00:00:00 2001 From: Timo Stamm Date: Mon, 18 Aug 2025 18:51:20 +0200 Subject: [PATCH 07/16] Migrate protobuf-test --- packages/protobuf-test/src/fields.test.ts | 224 +++++++++-------- .../protobuf-test/src/generate-code.test.ts | 73 +++--- packages/protobuf-test/src/is-message.test.ts | 41 ++-- packages/protobuf-test/src/json.test.ts | 227 +++++++++--------- packages/protobuf-test/src/json_types.test.ts | 115 ++++----- packages/protobuf-test/src/merge.test.ts | 43 ++-- packages/protobuf-test/src/name-clash.test.ts | 59 ++--- packages/protobuf-test/src/options.test.ts | 65 ++--- .../protobuf-test/src/proto-int64.test.ts | 141 +++++------ 9 files changed, 508 insertions(+), 480 deletions(-) diff --git a/packages/protobuf-test/src/fields.test.ts b/packages/protobuf-test/src/fields.test.ts index eafef68eb..45519dd42 100644 --- a/packages/protobuf-test/src/fields.test.ts +++ b/packages/protobuf-test/src/fields.test.ts @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { beforeEach, describe, expect, test } from "@jest/globals"; +import {beforeEach, suite, test } from "node:test"; +import * as assert from "node:assert"; import { clearField, create, isFieldSet } from "@bufbuild/protobuf"; import * as proto3_ts from "./gen/ts/extra/proto3_pb.js"; import * as proto2_ts from "./gen/ts/extra/proto2_pb.js"; @@ -24,79 +25,92 @@ import { fillEdition2023MessageNames, } from "./helpers-edition2023.js"; -describe("isFieldSet()", () => { - test("returns true for set field", () => { +void suite("isFieldSet()", () => { + void test("returns true for set field", () => { const msg = create(proto3_ts.Proto3MessageSchema); msg.optionalStringField = "abc"; const set = isFieldSet( msg, proto3_ts.Proto3MessageSchema.field.optionalStringField, ); - expect(set).toBe(true); + assert.strictEqual(set, true); }); - test("returns true for unset field", () => { + void test("returns true for unset field", () => { const msg = create(proto3_ts.Proto3MessageSchema); const set = isFieldSet( msg, proto3_ts.Proto3MessageSchema.field.optionalStringField, ); - expect(set).toBe(false); + assert.strictEqual(set, false); }); - test("returns false for foreign field", () => { + void test("returns false for foreign field", () => { const msg = create(proto3_ts.Proto3MessageSchema); msg.optionalStringField = "abc"; const set = isFieldSet( msg, proto2_ts.Proto2MessageSchema.field.optionalStringField, ); - expect(set).toBe(false); + assert.strictEqual(set, false); }); - describe("with proto3", () => { + void suite("with proto3", () => { const desc = proto3_ts.Proto3MessageSchema; - test.each(desc.fields)("%s is initially unset", (field) => { - const msg = create(desc); - const set = isFieldSet(msg, field); - expect(set).toBe(false); - }); - test.each(fillProto3MessageNames())("%s is set", (name) => { - const msg = create(desc); - fillProto3Message(msg); - const set = isFieldSet(msg, desc.field[name]); - expect(set).toBe(true); - }); + for (const field of desc.fields) { + void test(`${field.toString()} is initially unset`, () => { + const msg = create(desc); + const set = isFieldSet(msg, field); + assert.strictEqual(set, false); + }); + } + for (const name of fillProto3MessageNames()) { + void test(`${name} is set`, () => { + const msg = create(desc); + fillProto3Message(msg); + const set = isFieldSet(msg, desc.field[name]); + assert.strictEqual(set, true); + }); + } }); - describe("with proto2", () => { + void suite("with proto2", () => { const desc = proto2_ts.Proto2MessageSchema; - test.each(desc.fields)("%s is initially unset", (field) => { - const msg = create(desc); - const set = isFieldSet(msg, field); - expect(set).toBe(false); - }); - test.each(fillProto2MessageNames())("%s is set", (name) => { - const msg = create(desc); - fillProto2Message(msg); - const set = isFieldSet(msg, desc.field[name]); - expect(set).toBe(true); - }); + for (const field of desc.fields) { + void test(`${field.toString()} is initially unset`, () => { + const msg = create(desc); + const set = isFieldSet(msg, field); + assert.strictEqual(set, false); + }); + } + for (const name of fillProto2MessageNames()) { + void test(`${name} is set`, () => { + const msg = create(desc); + fillProto2Message(msg); + const set = isFieldSet(msg, desc.field[name]); + assert.strictEqual(set, true); + + }); + } }); - describe("with edition2023", () => { + void suite("with edition2023", () => { const desc = edition2023_ts.Edition2023MessageSchema; - test.each(desc.fields)("%s is initially unset", (field) => { - const msg = create(desc); - const set = isFieldSet(msg, field); - expect(set).toBe(false); - }); - test.each(fillEdition2023MessageNames())("%s is set", (name) => { - const msg = create(desc); - fillEdition2023Message(msg); - const set = isFieldSet(msg, desc.field[name]); - expect(set).toBe(true); - }); + for (const field of desc.fields) { + void test(`${field.toString()} is initially unset`, () => { + const msg = create(desc); + const set = isFieldSet(msg, field); + assert.strictEqual(set, false); + }); + } + for (const name of fillEdition2023MessageNames()) { + void test(`${name} is set`, () => { + const msg = create(desc); + fillEdition2023Message(msg); + const set = isFieldSet(msg, desc.field[name]); + assert.strictEqual(set, true); + }); + } }); }); -describe("clearField()", () => { - describe("with proto3", () => { +void suite("clearField()", () => { + void suite("with proto3", () => { const desc = proto3_ts.Proto3MessageSchema; let msg: proto3_ts.Proto3Message; let zero: proto3_ts.Proto3Message; @@ -105,28 +119,30 @@ describe("clearField()", () => { msg = create(desc); fillProto3Message(msg); }); - test.each(fillProto3MessageNames())("%s", (name) => { - expect(isFieldSet(msg, desc.field[name])).toBe(true); - clearField(msg, desc.field[name]); - expect(isFieldSet(msg, desc.field[name])).toBe(false); - switch (name) { - case "oneofBoolField": - expect(msg.either).toStrictEqual(zero.either); - break; - case "singularBytesField": - case "repeatedMessageField": - case "repeatedStringField": - case "mapStringStringField": - case "mapInt32MessageField": - expect(msg[name]).toStrictEqual(zero[name]); - break; - default: - expect(msg[name]).toBe(zero[name]); - break; - } - }); + for (const name of fillProto3MessageNames()) { + void test(`${name}`, () => { + assert.strictEqual(isFieldSet(msg, desc.field[name]), true); + clearField(msg, desc.field[name]); + assert.strictEqual(isFieldSet(msg, desc.field[name]), false); + switch (name) { + case "oneofBoolField": + assert.deepStrictEqual(msg.either, zero.either); + break; + case "singularBytesField": + case "repeatedMessageField": + case "repeatedStringField": + case "mapStringStringField": + case "mapInt32MessageField": + assert.deepStrictEqual(msg[name], zero[name]); + break; + default: + assert.strictEqual(msg[name], zero[name]); + break; + } + }); + } }); - describe("with proto2", () => { + void suite("with proto2", () => { const desc = proto2_ts.Proto2MessageSchema; let msg: proto2_ts.Proto2Message; let zero: proto2_ts.Proto2Message; @@ -135,25 +151,27 @@ describe("clearField()", () => { msg = create(desc); fillProto2Message(msg); }); - test.each(fillProto2MessageNames())("%s", (name) => { - expect(isFieldSet(msg, desc.field[name])).toBe(true); - clearField(msg, desc.field[name]); - expect(isFieldSet(msg, desc.field[name])).toBe(false); - switch (name) { - case "oneofBoolField": - expect(msg.either).toStrictEqual(zero.either); - break; - case "repeatedStringField": - case "mapStringStringField": - expect(msg[name]).toStrictEqual(zero[name]); - break; - default: - expect(msg[name]).toBe(zero[name]); - break; - } - }); + for (const name of fillProto2MessageNames()) { + void test(`${name}`, () => { + assert.strictEqual(isFieldSet(msg, desc.field[name]), true); + clearField(msg, desc.field[name]); + assert.strictEqual(isFieldSet(msg, desc.field[name]), false); + switch (name) { + case "oneofBoolField": + assert.deepStrictEqual(msg.either, zero.either); + break; + case "repeatedStringField": + case "mapStringStringField": + assert.deepStrictEqual(msg[name], zero[name]); + break; + default: + assert.strictEqual(msg[name], zero[name]); + break; + } + }); + } }); - describe("with edition2023", () => { + void suite("with edition2023", () => { const desc = edition2023_ts.Edition2023MessageSchema; let msg: edition2023_ts.Edition2023Message; let zero: edition2023_ts.Edition2023Message; @@ -162,22 +180,24 @@ describe("clearField()", () => { msg = create(desc); fillEdition2023Message(msg); }); - test.each(fillEdition2023MessageNames())("%s", (name) => { - expect(isFieldSet(msg, desc.field[name])).toBe(true); - clearField(msg, desc.field[name]); - expect(isFieldSet(msg, desc.field[name])).toBe(false); - switch (name) { - case "oneofBoolField": - expect(msg.either).toStrictEqual(zero.either); - break; - case "repeatedStringField": - case "mapStringStringField": - expect(msg[name]).toStrictEqual(zero[name]); - break; - default: - expect(msg[name]).toBe(zero[name]); - break; - } - }); + for (const name of fillEdition2023MessageNames()) { + void test(`${name}`, () => { + assert.strictEqual(isFieldSet(msg, desc.field[name]), true); + clearField(msg, desc.field[name]); + assert.strictEqual(isFieldSet(msg, desc.field[name]), false); + switch (name) { + case "oneofBoolField": + assert.deepStrictEqual(msg.either, zero.either); + break; + case "repeatedStringField": + case "mapStringStringField": + assert.deepStrictEqual(msg[name], zero[name]); + break; + default: + assert.strictEqual(msg[name], zero[name]); + break; + } + }); + } }); }); diff --git a/packages/protobuf-test/src/generate-code.test.ts b/packages/protobuf-test/src/generate-code.test.ts index 230e8c388..a4404f8c9 100644 --- a/packages/protobuf-test/src/generate-code.test.ts +++ b/packages/protobuf-test/src/generate-code.test.ts @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, test, expect } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import type { Int32ValueSchema, StringValueSchema, @@ -42,62 +43,62 @@ import type * as valid_types_js from "./gen/js,valid_types/extra/valid_types_pb. test("source retention options are unavailable in generated code", () => { const fileOptions = option_usage_ts.file_extra_option_usage.proto.options; - expect( + assert.strictEqual( !!fileOptions && hasExtension(fileOptions, options_ts.file_option_retention_source), - ).toBe(false); + false); const messageOptions = option_usage_ts.MessageWithOptionsSchema.proto.options; - expect( + assert.strictEqual( !!messageOptions && hasExtension(messageOptions, options_ts.message_option_retention_source), - ).toBe(false); + false); const fieldOptions = option_usage_ts.MessageWithOptionsSchema.fields[0].proto.options; - expect( + assert.strictEqual( !!fieldOptions && hasExtension(fieldOptions, options_ts.field_option_retention_source), - ).toBe(false); + false); const oneofOptions = option_usage_ts.MessageWithOptionsSchema.oneofs[0].proto.options; - expect( + assert.strictEqual( !!oneofOptions && hasExtension(oneofOptions, options_ts.oneof_option_retention_source), - ).toBe(false); + false); const enumOptions = option_usage_ts.EnumWithOptionsSchema.proto.options; - expect( + assert.strictEqual( !!enumOptions && hasExtension(enumOptions, options_ts.enum_option_retention_source), - ).toBe(false); + false); const enumValueOptions = option_usage_ts.EnumWithOptionsSchema.values[0].proto.options; - expect( + assert.strictEqual( !!enumValueOptions && hasExtension( enumValueOptions, options_ts.enum_value_option_retention_source, ), - ).toBe(false); + false); const serviceOptions = option_usage_ts.ServiceWithOptions.proto.options; - expect( + assert.strictEqual( !!serviceOptions && hasExtension(serviceOptions, options_ts.service_option_retention_source), - ).toBe(false); + false); const methodOptions = option_usage_ts.ServiceWithOptions.methods[0].proto.options; - expect( + assert.strictEqual( !!methodOptions && hasExtension(methodOptions, options_ts.method_option_retention_source), - ).toBe(false); + false); }); -describe("JSON types", () => { +void suite("JSON types", () => { const ok_ts: json_types_ts_json.JsonTypesMessageJson = { booleanFieldWithCustomName: true, Foo123_bar$: true, @@ -117,7 +118,7 @@ describe("JSON types", () => { true: "JSON_TYPE_ENUM_YES", }, }; - expect(ok_ts).toBeDefined(); + assert.ok(ok_ts !== undefined); const ok_js: json_types_js_json.JsonTypesMessageJson = { booleanFieldWithCustomName: true, Foo123_bar$: true, @@ -137,11 +138,11 @@ describe("JSON types", () => { true: "JSON_TYPE_ENUM_YES", }, }; - expect(ok_js).toBeDefined(); + assert.ok(ok_js !== undefined); }); test("ts generated code is assignable to js", () => { - expect([ + assert.ok([ function f(ts: valid_types_ts.VTypes, js: valid_types_js.VTypes) { ts = js; js = ts; @@ -220,7 +221,7 @@ test("ts generated code is assignable to js", () => { js = ts; return [ts, js]; }, - ]).toBeDefined(); + ]); }); test("service generates as expected", () => { @@ -252,29 +253,29 @@ test("service generates as expected", () => { actual = expected; return [expected, actual]; } - expect(f).toBeDefined(); + assert.ok(f !== undefined); }); -describe("ts generated code is equal to js generated code", () => { - test("proto2", () => { - expect(toPlain(proto2_ts)).toStrictEqual(toPlain(proto2_js)); +void suite("ts generated code is equal to js generated code", () => { + void test("proto2", () => { + assert.deepStrictEqual(toPlain(proto2_ts),toPlain(proto2_js)); }); test("proto3", () => { - expect(toPlain(proto3_ts)).toStrictEqual(toPlain(proto3_js)); + assert.deepStrictEqual(toPlain(proto3_ts),toPlain(proto3_js)); }); test("edition2023", () => { - expect(toPlain(edition2023_ts)).toStrictEqual(toPlain(edition2023_js)); + assert.deepStrictEqual(toPlain(edition2023_ts),toPlain(edition2023_js)); }); test("nameclash", () => { - expect(toPlain(nameclash_ts)).toStrictEqual(toPlain(nameclash_js)); + assert.deepStrictEqual(toPlain(nameclash_ts),toPlain(nameclash_js)); }); test("test_messages_proto3", () => { - expect(toPlain(test_messages_proto3_ts)).toStrictEqual( + assert.deepStrictEqual(toPlain(test_messages_proto3_ts), toPlain(test_messages_proto3_js), ); }); test("service", () => { - expect(toPlain(service_ts)).toStrictEqual(toPlain(service_js)); + assert.deepStrictEqual(toPlain(service_ts),toPlain(service_js)); }); /** @@ -311,7 +312,7 @@ describe("ts generated code is equal to js generated code", () => { } }); -describe("GenMessage.field", () => { +void suite("GenMessage.field", () => { test("is type safe", () => { proto3_ts.Proto3MessageSchema.field.optionalStringField; // @ts-expect-error TS2339: Property foo does not exist on type @@ -319,12 +320,12 @@ describe("GenMessage.field", () => { }); }); -describe("GenDescEnum.value", () => { +void suite("GenDescEnum.value", () => { test("is type safe", () => { const val = proto3_ts.Proto3EnumSchema.value[proto3_ts.Proto3Enum.YES]; - expect(val.number).toBe(1); - expect(val.name).toBe("PROTO3_ENUM_YES"); - expect(val.localName).toBe("YES"); + assert.strictEqual(val.number, 1); + assert.strictEqual(val.name, "PROTO3_ENUM_YES"); + assert.strictEqual(val.localName, "YES"); // @ts-expect-error TS7053: Element implicitly has an any type because expression of type 77 can't be used to index type Record proto3_ts.Proto3EnumSchema.value[77]; }); diff --git a/packages/protobuf-test/src/is-message.test.ts b/packages/protobuf-test/src/is-message.test.ts index 52521a138..2947da400 100644 --- a/packages/protobuf-test/src/is-message.test.ts +++ b/packages/protobuf-test/src/is-message.test.ts @@ -12,53 +12,54 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { UserSchema } from "./gen/ts/extra/example_pb.js"; import { create, isMessage } from "@bufbuild/protobuf"; import { MessageFieldMessageSchema } from "./gen/ts/extra/msg-message_pb.js"; -describe("isMessage", () => { - test("narrows down to anonymous message", () => { +void suite("isMessage", () => { + void test("narrows down to anonymous message", () => { const unknown = create(UserSchema) as unknown; - expect(isMessage(unknown)).toBe(true); + assert.ok(isMessage(unknown)); if (isMessage(unknown)) { - expect(unknown.$typeName).toBe("example.User"); + assert.strictEqual(unknown.$typeName, "example.User"); } }); - test("narrows down to specific message", () => { + void test("narrows down to specific message", () => { const unknown = create(UserSchema) as unknown; - expect(isMessage(unknown, UserSchema)).toBe(true); + assert.ok(isMessage(unknown, UserSchema)); if (isMessage(unknown, UserSchema)) { - expect(unknown.$typeName).toBe("example.User"); + assert.strictEqual(unknown.$typeName, "example.User"); unknown.firstName = "Homer"; // proves that the type is known } - expect(isMessage(unknown, UserSchema)).toBe(true); - expect(isMessage(unknown, UserSchema)).toBe(true); + assert.ok(isMessage(unknown, UserSchema)); + assert.ok(isMessage(unknown, UserSchema)); }); }); test("rejects foreign message", () => { const user = create(UserSchema); - expect(isMessage(user, MessageFieldMessageSchema)).toBe(false); + assert.strictEqual(isMessage(user, MessageFieldMessageSchema), false); }); test("rejects non-message values", () => { - expect(isMessage(null)).toBe(false); - expect(isMessage(undefined)).toBe(false); - expect(isMessage(123)).toBe(false); - expect(isMessage("str")).toBe(false); - expect(isMessage({})).toBe(false); + assert.strictEqual(isMessage(null), false); + assert.strictEqual(isMessage(undefined), false); + assert.strictEqual(isMessage(123), false); + assert.strictEqual(isMessage("str"), false); + assert.strictEqual(isMessage({}), false); }); test("falsely returns true if the argument is close enough to a Message", () => { - expect( + assert.ok( isMessage({ $typeName: "", }), - ).toBe(true); - expect( + ); + assert.ok( isMessage( { $typeName: "example.User", }, UserSchema, ), - ).toBe(true); + ); }); diff --git a/packages/protobuf-test/src/json.test.ts b/packages/protobuf-test/src/json.test.ts index 8b7f4248d..8e848d28b 100644 --- a/packages/protobuf-test/src/json.test.ts +++ b/packages/protobuf-test/src/json.test.ts @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { type MessageInitShape, type DescMessage, @@ -54,7 +55,7 @@ import { JSTypeProto2NormalMessageSchema } from "./gen/ts/extra/jstype-proto2_pb import { TestAllTypesProto3Schema } from "./gen/ts/google/protobuf/test_messages_proto3_pb.js"; import { compileMessage } from "./helpers.js"; -describe("JSON serialization", () => { +void suite("JSON serialization", () => { testJson( ScalarValuesMessageSchema, { @@ -262,8 +263,8 @@ describe("JSON serialization", () => { repeatedUint64Field: ["123"], }, ); - describe("wkt", () => { - describe("wrappers", () => { + void suite("wkt", () => { + void suite("wrappers", () => { testJson( WrappersMessageSchema, { @@ -292,17 +293,17 @@ describe("JSON serialization", () => { }, ); }); - describe("Any", () => { - test("without value encodes to JSON {}", () => { + void suite("Any", () => { + void test("without value encodes to JSON {}", () => { const any = create(AnySchema); - expect(toJson(AnySchema, any)).toStrictEqual({}); + assert.deepStrictEqual(toJson(AnySchema, any), {}); }); - test("decodes from JSON {}", () => { + void test("decodes from JSON {}", () => { const jsonString = "{}"; const a = fromJsonString(AnySchema, jsonString); - expect(a).toBeDefined(); - expect(a.typeUrl).toBe(""); - expect(a.value.length).toBe(0); + assert.ok(a !== undefined); + assert.strictEqual(a.typeUrl, ""); + assert.strictEqual(a.value.length, 0); }); test(`encodes ${ValueSchema.typeName} with ${StructSchema.typeName} to JSON`, () => { const any = anyPack( @@ -318,11 +319,11 @@ describe("JSON serialization", () => { }, }), ); - expect( + assert.deepStrictEqual( toJson(AnySchema, any, { registry: createRegistry(ValueSchema, StructSchema), }), - ).toStrictEqual({ + { "@type": "type.googleapis.com/google.protobuf.Value", value: { foo: 1, @@ -343,7 +344,7 @@ describe("JSON serialization", () => { const got = toJson(AnySchema, str, { registry: createRegistry(StructSchema, ValueSchema), }); - expect(got).toStrictEqual({ + assert.deepStrictEqual(got, { "@type": "type.googleapis.com/google.protobuf.Struct", value: { foo: 1 }, }); @@ -358,7 +359,7 @@ describe("JSON serialization", () => { const got = toJson(AnySchema, str, { registry: createRegistry(StructSchema, ValueSchema), }); - expect(got).toStrictEqual({ + assert.deepStrictEqual(got, { "@type": "type.googleapis.com/google.protobuf.Value", value: 1, }); @@ -375,9 +376,9 @@ describe("JSON serialization", () => { }, { registry: createRegistry(StructSchema, ValueSchema) }, ); - expect(anyUnpack(any, ValueSchema)).toStrictEqual(want); + assert.deepStrictEqual(anyUnpack(any, ValueSchema), want); }); - test("json_name clash with Any.@type is not prevented", () => { + void test("json_name clash with Any.@type is not prevented", () => { const any = anyPack( JsonNamesMessageSchema, create(JsonNamesMessageSchema, { a: "a", b: "b", c: "c" }), @@ -385,21 +386,21 @@ describe("JSON serialization", () => { const got = toJson(AnySchema, any, { registry: createRegistry(JsonNamesMessageSchema), }); - expect(got).toStrictEqual({ + assert.deepStrictEqual(got, { "@type": "type.googleapis.com/spec.JsonNamesMessage", "": "b", a: "a", }); }); }); - describe("Duration", () => { + void suite("Duration", () => { const testDurationJson = ( init: MessageInitShape, json: string, ) => { testJson(DurationSchema, init, json); }; - describe("3s", () => { + void suite("3s", () => { testDurationJson( { seconds: protoInt64.parse(3), @@ -408,7 +409,7 @@ describe("JSON serialization", () => { "3s", ); }); - describe("3s 1ms", () => { + void suite("3s 1ms", () => { testDurationJson( { seconds: protoInt64.parse(3), @@ -417,7 +418,7 @@ describe("JSON serialization", () => { "3.000001s", ); }); - describe("3s 1ns", () => { + void suite("3s 1ns", () => { testDurationJson( { seconds: protoInt64.parse(3), @@ -426,7 +427,7 @@ describe("JSON serialization", () => { "3.000000001s", ); }); - describe("-3s 1ns", () => { + void suite("-3s 1ns", () => { testDurationJson( { seconds: protoInt64.parse(-3), @@ -435,7 +436,7 @@ describe("JSON serialization", () => { "-3.000000001s", ); }); - describe("0s 5ns", () => { + void suite("0s 5ns", () => { testDurationJson( { seconds: protoInt64.parse(0), @@ -444,7 +445,7 @@ describe("JSON serialization", () => { "0.000000005s", ); }); - describe("0s -5ns", () => { + void suite("0s -5ns", () => { testDurationJson( { seconds: protoInt64.parse(0), @@ -457,7 +458,7 @@ describe("JSON serialization", () => { testJson(TimestampSchema, {}, "1970-01-01T00:00:00Z"); test(`fromJson decodes ${TimestampSchema.typeName}`, () => { const decode = (str: string, seconds: number, nanos: number) => - expect(fromJson(TimestampSchema, str)).toStrictEqual({ + assert.deepStrictEqual(fromJson(TimestampSchema, str), { $typeName: "google.protobuf.Timestamp", seconds: protoInt64.parse(seconds), nanos, @@ -475,7 +476,7 @@ describe("JSON serialization", () => { decode("2025-01-27T11:42:15.0Z", 1737978135, 0); decode("2025-01-27T11:42:15Z", 1737978135, 0); }); - describe("FieldMask", () => { + void suite("FieldMask", () => { testJson( FieldMaskSchema, { @@ -483,23 +484,23 @@ describe("JSON serialization", () => { }, "user.displayName,photo", ); - test("toJson fails on invalid fieldmask paths", () => { + void test("toJson fails on invalid fieldmask paths", () => { const fieldMask = create(FieldMaskSchema, { paths: ["user.displayName", "photo"], }); - expect(() => { + assert.throws(() => { toJson(FieldMaskSchema, fieldMask); - }).toThrow( - 'cannot encode message google.protobuf.FieldMask to JSON: lowerCamelCase of path name "user.displayName" is irreversible', - ); + }, { + message: 'cannot encode message google.protobuf.FieldMask to JSON: lowerCamelCase of path name "user.displayName" is irreversible', + }); }); - test("fromJson fails on invalid json", () => { + void test("fromJson fails on invalid json", () => { const json = "user.display_name,photo"; - expect(() => { + assert.throws(() => { fromJson(FieldMaskSchema, json); - }).toThrow( - "cannot decode message google.protobuf.FieldMask from JSON: path names must be lowerCamelCase", - ); + }, { + message: "cannot decode message google.protobuf.FieldMask from JSON: path names must be lowerCamelCase", + }); }); }); testJson( @@ -512,7 +513,7 @@ describe("JSON serialization", () => { }, { a: 123, b: "abc" }, ); - describe("Value", () => { + void suite("Value", () => { testJson( ValueSchema, { @@ -520,52 +521,52 @@ describe("JSON serialization", () => { }, true, ); - test("encoding unset value to JSON raises error", () => { + void test("encoding unset value to JSON raises error", () => { // Absence of any variant indicates an error. // See struct.proto const value = create(ValueSchema); - expect(() => toJson(ValueSchema, value)).toThrow( - "google.protobuf.Value must have a value", - ); + assert.throws(() => toJson(ValueSchema, value), { + message: "google.protobuf.Value must have a value", + }); }); - test("numberValue must be finite", () => { - expect(() => { + void test("numberValue must be finite", () => { + assert.throws(() => { toJson( ValueSchema, create(ValueSchema, { kind: { case: "numberValue", value: NaN }, }), ); - }).toThrow("google.protobuf.Value cannot be NaN or Infinity"); + }, {message: "google.protobuf.Value cannot be NaN or Infinity"}); - expect(() => { + assert.throws(() => { toJson( ValueSchema, create(ValueSchema, { kind: { case: "numberValue", value: Infinity }, }), ); - }).toThrow("google.protobuf.Value cannot be NaN or Infinity"); + }, {message: "google.protobuf.Value cannot be NaN or Infinity"}); - expect(() => { + assert.throws(() => { toJson( ValueSchema, create(ValueSchema, { kind: { case: "numberValue", value: Number.POSITIVE_INFINITY }, }), ); - }).toThrow("google.protobuf.Value cannot be NaN or Infinity"); + }, {message: "google.protobuf.Value cannot be NaN or Infinity"}); - expect(() => { + assert.throws(() => { toJson( ValueSchema, create(ValueSchema, { kind: { case: "numberValue", value: Number.NEGATIVE_INFINITY }, }), ); - }).toThrow("google.protobuf.Value cannot be NaN or Infinity"); + }, {message: "google.protobuf.Value cannot be NaN or Infinity"}); }); - describe("Value with Struct field", () => { + void suite("Value with Struct field", () => { testJson( ValueSchema, { @@ -585,47 +586,47 @@ describe("JSON serialization", () => { }); }); -describe("extensions in JSON", () => { - describe("proto2", () => { +void suite("extensions in JSON", () => { + void suite("proto2", () => { const extendeeDesc = ext_proto2.Proto2ExtendeeSchema; const jsonOpts = { registry: createRegistry(ext_proto2.file_extra_extensions_proto2), }; - describe("string_ext", () => { + void suite("string_ext", () => { const ext = ext_proto2.string_ext; const goldenJson = { "[proto2ext.string_ext]": "foo", }; const goldenValue = "foo"; - test("encode", () => { + void test("encode", () => { const extendee = create(extendeeDesc); setExtension(extendee, ext, goldenValue); const json = toJson(extendeeDesc, extendee, jsonOpts); - expect(json).toStrictEqual(goldenJson); + assert.deepStrictEqual(json, goldenJson); }); - test("decode", () => { + void test("decode", () => { const extendee = fromJson(extendeeDesc, goldenJson, jsonOpts); - expect(getExtension(extendee, ext)).toStrictEqual(goldenValue); + assert.deepStrictEqual(getExtension(extendee, ext), goldenValue); }); }); - describe("uint64_ext", () => { + void suite("uint64_ext", () => { const ext = ext_proto2.uint64_ext; const goldenJson = { "[proto2ext.uint64_ext]": "123", }; const goldenValue = protoInt64.parse(123); - test("encode", () => { + void test("encode", () => { const extendee = create(extendeeDesc); setExtension(extendee, ext, goldenValue); const json = toJson(extendeeDesc, extendee, jsonOpts); - expect(json).toStrictEqual(goldenJson); + assert.deepStrictEqual(json, goldenJson); }); - test("decode", () => { + void test("decode", () => { const extendee = fromJson(extendeeDesc, goldenJson, jsonOpts); - expect(getExtension(extendee, ext)).toStrictEqual(goldenValue); + assert.deepStrictEqual(getExtension(extendee, ext), goldenValue); }); }); - describe("uint64_ext_js_string", () => { + void suite("uint64_ext_js_string", () => { const ext = ext_proto2.uint64_ext_js_string; const goldenJson = { "[proto2ext.uint64_ext_js_string]": "456", @@ -635,14 +636,14 @@ describe("extensions in JSON", () => { const extendee = create(extendeeDesc); setExtension(extendee, ext, goldenValue); const json = toJson(extendeeDesc, extendee, jsonOpts); - expect(json).toStrictEqual(goldenJson); + assert.deepStrictEqual(json, goldenJson); }); test("decode", () => { const extendee = fromJson(extendeeDesc, goldenJson, jsonOpts); - expect(getExtension(extendee, ext)).toStrictEqual(goldenValue); + assert.deepStrictEqual(getExtension(extendee, ext), goldenValue); }); }); - describe("wrapper_ext", () => { + void suite("wrapper_ext", () => { const ext = ext_proto2.wrapper_ext; const goldenJson = { "[proto2ext.wrapper_ext]": 789, @@ -652,14 +653,14 @@ describe("extensions in JSON", () => { const extendee = create(extendeeDesc); setExtension(extendee, ext, goldenValue); const json = toJson(extendeeDesc, extendee, jsonOpts); - expect(json).toStrictEqual(goldenJson); + assert.deepStrictEqual(json, goldenJson); }); test("decode", () => { const extendee = fromJson(extendeeDesc, goldenJson, jsonOpts); - expect(getExtension(extendee, ext)).toStrictEqual(goldenValue); + assert.deepStrictEqual(getExtension(extendee, ext), goldenValue); }); }); - describe("message_ext", () => { + void suite("message_ext", () => { const ext = ext_proto2.message_ext; const goldenJson = { "[proto2ext.message_ext]": { stringField: "abc" }, @@ -671,20 +672,20 @@ describe("extensions in JSON", () => { const extendee = create(extendeeDesc); setExtension(extendee, ext, goldenValue); const json = toJson(extendeeDesc, extendee, jsonOpts); - expect(json).toStrictEqual(goldenJson); + assert.deepStrictEqual(json, goldenJson); }); test("decode", () => { const extendee = fromJson(extendeeDesc, goldenJson, jsonOpts); - expect(getExtension(extendee, ext)).toStrictEqual(goldenValue); + assert.deepStrictEqual(getExtension(extendee, ext), goldenValue); }); }); }); - describe("proto3", () => { + void suite("proto3", () => { const extendeeDesc = FileOptionsSchema; const jsonOpts = { registry: createRegistry(ext_proto3.file_extra_extensions_proto3), }; - describe("uint32_ext", () => { + void suite("uint32_ext", () => { const ext = ext_proto3.uint32_ext; const goldenJson = { "[proto3ext.uint32_ext]": 0, @@ -694,14 +695,14 @@ describe("extensions in JSON", () => { const extendee = create(extendeeDesc); setExtension(extendee, ext, goldenValue); const json = toJson(extendeeDesc, extendee, jsonOpts); - expect(json).toStrictEqual(goldenJson); + assert.deepStrictEqual(json, goldenJson); }); test("decode", () => { const extendee = fromJson(extendeeDesc, goldenJson, jsonOpts); - expect(getExtension(extendee, ext)).toStrictEqual(goldenValue); + assert.deepStrictEqual(getExtension(extendee, ext), goldenValue); }); }); - describe("message_ext", () => { + void suite("message_ext", () => { const ext = ext_proto3.message_ext; const goldenJson = { "[proto3ext.message_ext]": { stringField: "abc" }, @@ -713,18 +714,18 @@ describe("extensions in JSON", () => { const extendee = create(extendeeDesc); setExtension(extendee, ext, goldenValue); const json = toJson(extendeeDesc, extendee, jsonOpts); - expect(json).toStrictEqual(goldenJson); + assert.deepStrictEqual(json, goldenJson); }); test("decode", () => { const extendee = fromJson(extendeeDesc, goldenJson, jsonOpts); - expect(getExtension(extendee, ext)).toStrictEqual(goldenValue); + assert.deepStrictEqual(getExtension(extendee, ext), goldenValue); }); }); }); }); -describe("JsonWriteOptions", () => { - describe("alwaysEmitImplicit", () => { +void suite("JsonWriteOptions", () => { + void suite("alwaysEmitImplicit", () => { test("emits proto3 implicit fields", async () => { const descMessage = await compileMessage(` syntax="proto3"; @@ -738,7 +739,7 @@ describe("JsonWriteOptions", () => { const json = toJson(descMessage, create(descMessage), { alwaysEmitImplicit: true, }); - expect(json).toStrictEqual({ + assert.deepStrictEqual(json, { int32Field: 0, boolField: false, listField: [], @@ -758,7 +759,7 @@ describe("JsonWriteOptions", () => { const json = toJson(descMessage, create(descMessage), { alwaysEmitImplicit: true, }); - expect(json).toStrictEqual({}); + assert.deepStrictEqual(json, {}); }); test("emits proto2 implicit fields", async () => { const descMessage = await compileMessage(` @@ -772,7 +773,7 @@ describe("JsonWriteOptions", () => { const json = toJson(descMessage, create(descMessage), { alwaysEmitImplicit: true, }); - expect(json).toStrictEqual({ + assert.deepStrictEqual(json, { listField: [], mapField: {}, }); @@ -794,7 +795,7 @@ describe("JsonWriteOptions", () => { const json = toJson(proto3_ts.Proto3MessageSchema, msg, { enumAsInteger: true, }); - expect(json).toStrictEqual({ + assert.deepStrictEqual(json, { singularEnumField: 1, optionalEnumField: 0, repeatedEnumField: [1, 2], @@ -807,7 +808,7 @@ describe("JsonWriteOptions", () => { }, }); }); - describe("useProtoFieldName", () => { + void suite("useProtoFieldName", () => { test("prefers proto field name", () => { const msg = create(proto3_ts.Proto3MessageSchema, { singularStringField: "a", @@ -815,7 +816,7 @@ describe("JsonWriteOptions", () => { const json = toJson(proto3_ts.Proto3MessageSchema, msg, { useProtoFieldName: true, }); - expect(json).toStrictEqual({ + assert.deepStrictEqual(json, { singular_string_field: "a", }); }); @@ -826,7 +827,7 @@ describe("JsonWriteOptions", () => { const json = toJson(JsonNamesMessageSchema, msg, { useProtoFieldName: true, }); - expect(json).toStrictEqual({ + assert.deepStrictEqual(json, { scalar_field: "a", }); }); @@ -837,20 +838,20 @@ describe("JsonWriteOptions", () => { // We do not cover all cases here. Map fields and oneofs are incomplete, // and bytes, string, and other scalar types are not tested. // For serialization errors, see serialization-errors.test.ts -describe("JSON parse errors", () => { +void suite("JSON parse errors", () => { test("fromJsonString() with invalid JSON", () => { - expect(() => fromJsonString(TestAllTypesProto3Schema, "}")).toThrow( - /^cannot decode message protobuf_test_messages.proto3.TestAllTypesProto3 from JSON: Unexpected token .*/, - ); + assert.throws(() => fromJsonString(TestAllTypesProto3Schema, "}"), { + message: /^cannot decode message protobuf_test_messages.proto3.TestAllTypesProto3 from JSON: Unexpected token .*/, + }) }); test("mergeFromJsonString() with invalid JSON", () => { const target = create(TestAllTypesProto3Schema); - expect(() => + assert.throws(() => mergeFromJsonString(TestAllTypesProto3Schema, target, "}"), - ).toThrow( - /^cannot decode message protobuf_test_messages.proto3.TestAllTypesProto3 from JSON: Unexpected token .*/, - ); + { + message: /^cannot decode message protobuf_test_messages.proto3.TestAllTypesProto3 from JSON: Unexpected token .*/, + }); }); test("unknown field", () => { @@ -860,33 +861,33 @@ describe("JSON parse errors", () => { ); }); - describe("Any", () => { + void suite("Any", () => { test("without @type", () => { - expect(() => + assert.throws(() => fromJson(AnySchema, { value: 123, }), - ).toThrow( - /^cannot decode message google.protobuf.Any from JSON: "@type" is empty/, - ); + { + message: /^cannot decode message google.protobuf.Any from JSON: "@type" is empty/, + }); }); test("with blank @type", () => { - expect(() => + assert.throws(() => fromJson(AnySchema, { "@type": "", }), - ).toThrow( - /^cannot decode message google.protobuf.Any from JSON: "@type" is empty/, - ); + { + message: /^cannot decode message google.protobuf.Any from JSON: "@type" is empty/, + }); }); test("with invalid type url in @type", () => { - expect(() => + assert.throws(() => fromJson(AnySchema, { "@type": "/", }), - ).toThrow( - /^cannot decode message google.protobuf.Any from JSON: "@type" is invalid/, - ); + { + message: /^cannot decode message google.protobuf.Any from JSON: "@type" is invalid/, + }); }); }); @@ -1117,7 +1118,7 @@ describe("JSON parse errors", () => { } catch (e) { gotErrorMessage = e instanceof Error ? e.message : e; } - expect(gotErrorMessage).toBe(errorMessage); + assert.strictEqual(gotErrorMessage, errorMessage); } }); @@ -1128,7 +1129,7 @@ function testJson( ) { test(desc.typeName, () => { const msg = create(desc, init); - expect(toJson(desc, msg)).toStrictEqual(json); - expect(fromJson(desc, json)).toStrictEqual(msg); + assert.deepStrictEqual(toJson(desc, msg), json); + assert.deepStrictEqual(fromJson(desc, json), msg); }); } diff --git a/packages/protobuf-test/src/json_types.test.ts b/packages/protobuf-test/src/json_types.test.ts index aecf8b217..74fab8742 100644 --- a/packages/protobuf-test/src/json_types.test.ts +++ b/packages/protobuf-test/src/json_types.test.ts @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { create, createRegistry, @@ -67,8 +68,8 @@ import { } from "@bufbuild/protobuf/wkt"; import * as json_types_ts_json from "./gen/ts,json_types/extra/json_types_pb.js"; -describe("JSON types", () => { - test("toJson() returns JSON type for standard options", () => { +void suite("JSON types", () => { + void test("toJson() returns JSON type for standard options", () => { const msg = create(json_types_ts_json.JsonTypesMessageSchema); let json: json_types_ts_json.JsonTypesMessageJson; json = toJson(json_types_ts_json.JsonTypesMessageSchema, msg); @@ -79,7 +80,7 @@ describe("JSON types", () => { useProtoFieldName: false, registry: createRegistry(json_types_ts_json.JsonTypesMessageSchema), }); - expect(json).toBeDefined(); + assert.ok(json !== undefined); }); test("toJson() returns JsonValue for non-standard options", () => { const msg = create(json_types_ts_json.JsonTypesMessageSchema); @@ -89,7 +90,7 @@ describe("JSON types", () => { }); // @ts-expect-error TS2322: Type JsonValue is not assignable to type JsonTypesMessageJson const typed: json_types_ts_json.JsonTypesMessageJson = json; - expect(typed).toBeDefined(); + assert.ok(typed); } { const json = toJson(json_types_ts_json.JsonTypesMessageSchema, msg, { @@ -97,7 +98,7 @@ describe("JSON types", () => { }); // @ts-expect-error TS2322: Type JsonValue is not assignable to type JsonTypesMessageJson const typed: json_types_ts_json.JsonTypesMessageJson = json; - expect(typed).toBeDefined(); + assert.ok(typed); } { const json = toJson(json_types_ts_json.JsonTypesMessageSchema, msg, { @@ -105,19 +106,19 @@ describe("JSON types", () => { }); // @ts-expect-error TS2322: Type JsonValue is not assignable to type JsonTypesMessageJson const typed: json_types_ts_json.JsonTypesMessageJson = json; - expect(typed).toBeDefined(); + assert.ok(typed); } }); - describe("well-known types", () => { + void suite("well-known types", () => { test("google.protobuf.Any should have JSON type", () => { function f(a: MessageJsonType, b: AnyJson) { a = b; b = a; return b; } - expect(f).toBeDefined(); + assert.ok(f); }); - describe("google.protobuf.Duration should have JSON type", () => { + void suite("google.protobuf.Duration should have JSON type", () => { function f(a: MessageJsonType, b: DurationJson) { a = b; b = a; @@ -125,9 +126,9 @@ describe("JSON types", () => { a = val; return [b, val]; } - expect(f).toBeDefined(); + assert.ok(f); }); - describe("google.protobuf.Empty should have JSON type", () => { + void suite("google.protobuf.Empty should have JSON type", () => { function f(a: MessageJsonType, b: EmptyJson) { a = b; b = a; @@ -135,9 +136,9 @@ describe("JSON types", () => { a = val; return [b, val]; } - expect(f).toBeDefined(); + assert.ok(f); }); - describe("google.protobuf.FieldMask should have JSON type", () => { + void suite("google.protobuf.FieldMask should have JSON type", () => { function f(a: MessageJsonType, b: FieldMaskJson) { a = b; b = a; @@ -145,9 +146,9 @@ describe("JSON types", () => { a = val; return [b, val]; } - expect(f).toBeDefined(); + assert.ok(f); }); - describe("google.protobuf.Struct should have JSON type", () => { + void suite("google.protobuf.Struct should have JSON type", () => { function f(a: MessageJsonType, b: StructJson) { a = b; b = a; @@ -155,9 +156,9 @@ describe("JSON types", () => { a = val; return [b, val]; } - expect(f).toBeDefined(); + assert.ok(f); }); - describe("google.protobuf.Value should have JSON type", () => { + void suite("google.protobuf.Value should have JSON type", () => { function f(a: MessageJsonType, b: ValueJson) { a = b; b = a; @@ -165,9 +166,9 @@ describe("JSON types", () => { a = val; return [b, val]; } - expect(f).toBeDefined(); + assert.ok(f); }); - describe("google.protobuf.ListValue should have JSON type", () => { + void suite("google.protobuf.ListValue should have JSON type", () => { function f(a: MessageJsonType, b: ListValueJson) { a = b; b = a; @@ -175,9 +176,9 @@ describe("JSON types", () => { a = val; return [b, val]; } - expect(f).toBeDefined(); + assert.ok(f); }); - describe("google.protobuf.NullValue should have JSON type", () => { + void suite("google.protobuf.NullValue should have JSON type", () => { function f(a: EnumJsonType, b: NullValueJson) { a = b; b = a; @@ -185,9 +186,9 @@ describe("JSON types", () => { a = val; return [b, val]; } - expect(f).toBeDefined(); + assert.ok(f); }); - describe("google.protobuf.Timestamp should have JSON type", () => { + void suite("google.protobuf.Timestamp should have JSON type", () => { function f(a: MessageJsonType, b: TimestampJson) { a = b; b = a; @@ -195,9 +196,9 @@ describe("JSON types", () => { a = string; return [b, string]; } - expect(f).toBeDefined(); + assert.ok(f); }); - describe("google.protobuf.DoubleValue should have JSON type", () => { + void suite("google.protobuf.DoubleValue should have JSON type", () => { function f( a: MessageJsonType, b: DoubleValueJson, @@ -208,9 +209,9 @@ describe("JSON types", () => { a = val; return [b, val]; } - expect(f).toBeDefined(); + assert.ok(f); }); - describe("google.protobuf.FloatValue should have JSON type", () => { + void suite("google.protobuf.FloatValue should have JSON type", () => { function f( a: MessageJsonType, b: FloatValueJson, @@ -221,9 +222,9 @@ describe("JSON types", () => { a = val; return [b, val]; } - expect(f).toBeDefined(); + assert.ok(f); }); - describe("google.protobuf.Int64Value should have JSON type", () => { + void suite("google.protobuf.Int64Value should have JSON type", () => { function f( a: MessageJsonType, b: Int64ValueJson, @@ -234,9 +235,9 @@ describe("JSON types", () => { a = val; return [b, val]; } - expect(f).toBeDefined(); + assert.ok(f); }); - describe("google.protobuf.UInt64Value should have JSON type", () => { + void suite("google.protobuf.UInt64Value should have JSON type", () => { function f( a: MessageJsonType, b: UInt64ValueJson, @@ -247,9 +248,9 @@ describe("JSON types", () => { a = val; return [b, val]; } - expect(f).toBeDefined(); + assert.ok(f); }); - describe("google.protobuf.Int32Value should have JSON type", () => { + void suite("google.protobuf.Int32Value should have JSON type", () => { function f( a: MessageJsonType, b: Int32ValueJson, @@ -260,9 +261,9 @@ describe("JSON types", () => { a = val; return [b, val]; } - expect(f).toBeDefined(); + assert.ok(f); }); - describe("google.protobuf.UInt32Value should have JSON type", () => { + void suite("google.protobuf.UInt32Value should have JSON type", () => { function f( a: MessageJsonType, b: UInt32ValueJson, @@ -273,9 +274,9 @@ describe("JSON types", () => { a = val; return [b, val]; } - expect(f).toBeDefined(); + assert.ok(f); }); - describe("google.protobuf.BoolValue should have JSON type", () => { + void suite("google.protobuf.BoolValue should have JSON type", () => { function f(a: MessageJsonType, b: BoolValueJson) { a = b; b = a; @@ -283,9 +284,9 @@ describe("JSON types", () => { a = val; return [b, val]; } - expect(f).toBeDefined(); + assert.ok(f); }); - describe("google.protobuf.StringValue should have JSON type", () => { + void suite("google.protobuf.StringValue should have JSON type", () => { function f( a: MessageJsonType, b: StringValueJson, @@ -296,9 +297,9 @@ describe("JSON types", () => { a = val; return [b, val]; } - expect(f).toBeDefined(); + assert.ok(f); }); - describe("google.protobuf.BytesValue should have JSON type", () => { + void suite("google.protobuf.BytesValue should have JSON type", () => { function f( a: MessageJsonType, b: BytesValueJson, @@ -309,10 +310,10 @@ describe("JSON types", () => { a = val; return [b, val]; } - expect(f).toBeDefined(); + assert.ok(f); }); }); - describe("enumToJson()", () => { + void suite("enumToJson()", () => { test("returns proto name", () => { const json: | "JSON_TYPE_ENUM_YES" @@ -321,47 +322,47 @@ describe("JSON types", () => { json_types_ts_json.JsonTypeEnumSchema, json_types_ts_json.JsonTypeEnum.YES, ); - expect(json).toBe("JSON_TYPE_ENUM_YES"); + assert.strictEqual(json, "JSON_TYPE_ENUM_YES"); }); test("returns null for google.protobuf.NullValue", () => { const json: null = enumToJson(NullValueSchema, NullValue.NULL_VALUE); - expect(json).toBe(null); + assert.strictEqual(json, null); }); test("returns string|null for anonymous descriptor", () => { const json: string | null = enumToJson( json_types_ts_json.JsonTypeEnumSchema as DescEnum, json_types_ts_json.JsonTypeEnum.YES, ); - expect(json).toBe("JSON_TYPE_ENUM_YES"); + assert.strictEqual(json, "JSON_TYPE_ENUM_YES"); }); }); - describe("enumFromJson()", () => { + void suite("enumFromJson()", () => { test("parses known string", () => { const e: json_types_ts_json.JsonTypeEnum = enumFromJson( json_types_ts_json.JsonTypeEnumSchema, "JSON_TYPE_ENUM_YES", ); - expect(e).toBe(json_types_ts_json.JsonTypeEnum.YES); + assert.strictEqual(e, json_types_ts_json.JsonTypeEnum.YES); }); test("parses number for anonymous descriptor", () => { const e: number = enumFromJson( json_types_ts_json.JsonTypeEnumSchema as DescEnum, "JSON_TYPE_ENUM_YES", ); - expect(e).toBe(json_types_ts_json.JsonTypeEnum.YES); + assert.strictEqual(e, json_types_ts_json.JsonTypeEnum.YES); }); test("parses null for google.protobuf.NullValue", () => { const e: NullValue = enumFromJson(NullValueSchema, null); - expect(e).toBe(NullValue.NULL_VALUE); + assert.strictEqual(e, NullValue.NULL_VALUE); }); test("raises error on unknown string", () => { - expect(() => { + assert.throws(() => { // @ts-expect-error TS2345 enumFromJson(json_types_ts_json.JsonTypeEnumSchema, "FOO"); - }).toThrow(/cannot decode enum spec.JsonTypeEnum from JSON: "FOO"/); + }, {message: /cannot decode enum spec.JsonTypeEnum from JSON: "FOO"/}); }); }); - describe("isEnumJson()", () => { + void suite("isEnumJson()", () => { test("narrows type", () => { const str: string = "FOO"; if (isEnumJson(json_types_ts_json.JsonTypeEnumSchema, str)) { @@ -369,7 +370,7 @@ describe("JSON types", () => { | "JSON_TYPE_ENUM_YES" | "JSON_TYPE_ENUM_NO" | "JSON_TYPE_ENUM_UNSPECIFIED" = str; - expect(yes).toBeDefined(); + assert.ok(yes); } }); test("returns true for known value", () => { @@ -377,11 +378,11 @@ describe("JSON types", () => { json_types_ts_json.JsonTypeEnumSchema, "JSON_TYPE_ENUM_YES", ); - expect(ok).toBe(true); + assert.ok(ok); }); test("returns false for unknown value", () => { const ok = isEnumJson(json_types_ts_json.JsonTypeEnumSchema, "FOO"); - expect(ok).toBe(false); + assert.strictEqual(ok, false); }); }); }); diff --git a/packages/protobuf-test/src/merge.test.ts b/packages/protobuf-test/src/merge.test.ts index 005431299..970629879 100644 --- a/packages/protobuf-test/src/merge.test.ts +++ b/packages/protobuf-test/src/merge.test.ts @@ -12,13 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { create, merge } from "@bufbuild/protobuf"; import * as proto3_ts from "./gen/ts/extra/proto3_pb.js"; import { WireType } from "@bufbuild/protobuf/wire"; -describe("merge()", () => { - test("sets scalar field in target, replacing existing fields", () => { +void suite("merge()", () => { + void test("sets scalar field in target, replacing existing fields", () => { const target = create(proto3_ts.Proto3MessageSchema, { singularMessageField: { singularStringField: "old", @@ -41,21 +42,21 @@ describe("merge()", () => { }); merge(proto3_ts.Proto3MessageSchema, target, source); // sets scalar field in target - expect(target.singularStringField).toBe("abc"); - expect(target.optionalStringField).toBe("abc"); - expect(target.singularBytesField).toBe(source.singularBytesField); // bytes field is copied by reference - expect(target.singularEnumField).toBe(proto3_ts.Proto3Enum.YES); + assert.strictEqual(target.singularStringField, "abc"); + assert.strictEqual(target.optionalStringField, "abc"); + assert.strictEqual(target.singularBytesField, source.singularBytesField); // bytes field is copied by reference + assert.strictEqual(target.singularEnumField, proto3_ts.Proto3Enum.YES); // replaces existing fields - expect(target.singularMessageField?.singularStringField).toBe("abc"); - expect(target.singularMessageField?.optionalStringField).toBe("abc"); - expect(target.singularMessageField?.singularBytesField).toBe( + assert.strictEqual(target.singularMessageField?.singularStringField, "abc"); + assert.strictEqual(target.singularMessageField?.optionalStringField, "abc"); + assert.strictEqual(target.singularMessageField?.singularBytesField, source.singularMessageField?.singularBytesField, ); // bytes field is copied by reference - expect(target.singularMessageField?.singularEnumField).toBe( + assert.strictEqual(target.singularMessageField?.singularEnumField, proto3_ts.Proto3Enum.YES, ); }); - test("sets map values in target", () => { + void test("sets map values in target", () => { const target = create(proto3_ts.Proto3MessageSchema, { mapStringStringField: { a: "A", @@ -69,7 +70,7 @@ describe("merge()", () => { }, }); merge(proto3_ts.Proto3MessageSchema, target, source); - expect(target.mapStringStringField).toStrictEqual({ + assert.deepStrictEqual(target.mapStringStringField, { a: "A", b: "beta", c: "C", @@ -84,8 +85,8 @@ describe("merge()", () => { repeatedInt32Field: [1, 2], }); merge(proto3_ts.Proto3MessageSchema, target, source); - expect(target.repeatedStringField).toStrictEqual(["a", "b", "c"]); - expect(target.repeatedInt32Field).toStrictEqual([1, 2]); + assert.deepStrictEqual(target.repeatedStringField, ["a", "b", "c"]); + assert.deepStrictEqual(target.repeatedInt32Field, [1, 2]); }); test("merges message field with field in target", () => { const target = create(proto3_ts.Proto3MessageSchema, { @@ -105,11 +106,11 @@ describe("merge()", () => { }); const targetSingularMessageField = target.singularMessageField; merge(proto3_ts.Proto3MessageSchema, target, source); - expect(target.optionalMessageField).toBe(source.optionalMessageField); // message field is copied by reference - expect(target.singularMessageField).not.toBe(source.singularMessageField); - expect(target.singularMessageField).toBe(targetSingularMessageField); // target message field reference is maintained - expect(target.singularMessageField?.singularStringField).toBe("DEF"); - expect(target.singularMessageField?.repeatedInt32Field).toStrictEqual([ + assert.strictEqual(target.optionalMessageField, source.optionalMessageField); // message field is copied by reference + assert.notStrictEqual(target.singularMessageField, source.singularMessageField); + assert.strictEqual(target.singularMessageField, targetSingularMessageField); // target message field reference is maintained + assert.strictEqual(target.singularMessageField?.singularStringField, "DEF"); + assert.deepStrictEqual(target.singularMessageField?.repeatedInt32Field, [ 1, 2, ]); }); @@ -131,7 +132,7 @@ describe("merge()", () => { }, ]; merge(proto3_ts.Proto3MessageSchema, target, source); - expect(target.$unknown).toStrictEqual([ + assert.deepStrictEqual(target.$unknown, [ { no: 98, wireType: WireType.Varint, diff --git a/packages/protobuf-test/src/name-clash.test.ts b/packages/protobuf-test/src/name-clash.test.ts index 7225b0d9b..4de19641d 100644 --- a/packages/protobuf-test/src/name-clash.test.ts +++ b/packages/protobuf-test/src/name-clash.test.ts @@ -12,60 +12,61 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import * as ts_name_clash from "./gen/ts/extra/name-clash_pb.js"; import * as js_name_clash from "./gen/js/extra/name-clash_pb.js"; import { create } from "@bufbuild/protobuf"; -describe("message looking like a oneof ADT", () => { - test("takes all fields in constructor", () => { +void suite("message looking like a oneof ADT", () => { + void test("takes all fields in constructor", () => { const m = create(ts_name_clash.NoClashOneofADTSchema, { m: { case: "value", value: "xxx", }, }); - expect(m.m?.case).toBe("value"); - expect(m.m?.value).toBe("xxx"); + assert.strictEqual(m.m?.case, "value"); + assert.strictEqual(m.m?.value, "xxx"); }); - test("takes partial input in constructor", () => { + void test("takes partial input in constructor", () => { const m = create(ts_name_clash.NoClashOneofADTSchema, { m: { case: "value", }, }); - expect(m.m?.case).toBe("value"); - expect(m.m?.value).toBeUndefined(); + assert.strictEqual(m.m?.case, "value"); + assert.strictEqual(m.m?.value, undefined); }); }); -describe("enum values", () => { - test("reserved property names (generated ts)", () => { +void suite("enum values", () => { + void test("reserved property names (generated ts)", () => { const e = ts_name_clash.ReservedPropertyNames_EnumBuiltIn; - expect(e.constructor$).toBe(0); - expect(e.toString$).toBe(1); - expect(e.toJSON$).toBe(2); - expect(e.valueOf$).toBe(3); + assert.strictEqual(e.constructor$, 0); + assert.strictEqual(e.toString$, 1); + assert.strictEqual(e.toJSON$, 2); + assert.strictEqual(e.valueOf$, 3); }); - test("reserved property names with prefix (generated ts)", () => { + void test("reserved property names with prefix (generated ts)", () => { const e = ts_name_clash.ReservedPropertyNames_EnumBuiltInPrefixed; - expect(e.constructor$).toBe(0); - expect(e.toString$).toBe(1); - expect(e.toJSON$).toBe(2); - expect(e.valueOf$).toBe(3); + assert.strictEqual(e.constructor$, 0); + assert.strictEqual(e.toString$, 1); + assert.strictEqual(e.toJSON$, 2); + assert.strictEqual(e.valueOf$, 3); }); - test("reserved property names (generated js)", () => { + void test("reserved property names (generated js)", () => { const e = js_name_clash.ReservedPropertyNames_EnumBuiltIn; - expect(e.constructor$).toBe(0); - expect(e.toString$).toBe(1); - expect(e.toJSON$).toBe(2); - expect(e.valueOf$).toBe(3); + assert.strictEqual(e.constructor$, 0); + assert.strictEqual(e.toString$, 1); + assert.strictEqual(e.toJSON$, 2); + assert.strictEqual(e.valueOf$, 3); }); - test("reserved property names with prefix (generated js)", () => { + void test("reserved property names with prefix (generated js)", () => { const e = js_name_clash.ReservedPropertyNames_EnumBuiltInPrefixed; - expect(e.constructor$).toBe(0); - expect(e.toString$).toBe(1); - expect(e.toJSON$).toBe(2); - expect(e.valueOf$).toBe(3); + assert.strictEqual(e.constructor$, 0); + assert.strictEqual(e.toString$, 1); + assert.strictEqual(e.toJSON$, 2); + assert.strictEqual(e.valueOf$, 3); }); }); diff --git a/packages/protobuf-test/src/options.test.ts b/packages/protobuf-test/src/options.test.ts index 399cae6e0..9f92faece 100644 --- a/packages/protobuf-test/src/options.test.ts +++ b/packages/protobuf-test/src/options.test.ts @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, test, expect } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { type AnyDesc, type DescExtension, @@ -45,105 +46,105 @@ import { } from "./gen/ts/extra/option-usage_pb.js"; import { Proto3MessageSchema } from "./gen/ts/extra/proto3_pb.js"; -describe("hasOption()", () => { - test("supports anonymous descriptor and extension", () => { +void suite("hasOption()", () => { + void test("supports anonymous descriptor and extension", () => { const file: AnyDesc = file_extra_option_usage; const ext: DescExtension = file_option_retention_runtime; const has = hasOption(file, ext); - expect(has).toBe(true); + assert.ok(has); }); - test("returns false if extendee does not match", () => { + void test("returns false if extendee does not match", () => { const file = file_extra_option_usage; const ext = oneof_option_retention_runtime; // @ts-expect-error TS2345 const has = hasOption(file, ext); - expect(has).toBe(false); + assert.strictEqual(has, false); }); - test("returns false if descriptor has no options", () => { - expect(Proto3MessageSchema.proto.options).toBeUndefined(); + void test("returns false if descriptor has no options", () => { + assert.strictEqual(Proto3MessageSchema.proto.options, undefined); const has = hasOption( Proto3MessageSchema, message_option_retention_runtime, ); - expect(has).toBe(false); + assert.strictEqual(has, false); }); }); -describe("getOption()", () => { - test("supports anonymous descriptor and extension", () => { +void suite("getOption()", () => { + void test("supports anonymous descriptor and extension", () => { const file: AnyDesc = file_extra_option_usage; const ext: DescExtension = file_option_retention_runtime; const val = getOption(file, ext); - expect(val).toBe("file option retention runtime"); + assert.strictEqual(val, "file option retention runtime"); }); - test("returns zero value if descriptor has no options", () => { + void test("returns zero value if descriptor has no options", () => { const field = Proto3MessageSchema.fields[0]; - expect(field.proto.options).toBeUndefined(); + assert.strictEqual(field.proto.options, undefined); const val = getOption(field, field_option_retention_runtime); - expect(val).toBe(""); + assert.strictEqual(val, ""); }); - test("returns option", () => { + void test("returns option", () => { const file = file_extra_option_usage; - expect(getOption(file, file_option_retention_unknown)).toBe( + assert.strictEqual(getOption(file, file_option_retention_unknown), "file option retention unknown", ); - expect(getOption(file, file_option_retention_runtime)).toBe( + assert.strictEqual(getOption(file, file_option_retention_runtime), "file option retention runtime", ); const message = MessageWithOptionsSchema; - expect(getOption(message, message_option_retention_unknown)).toBe( + assert.strictEqual(getOption(message, message_option_retention_unknown), "message option retention unknown", ); - expect(getOption(message, message_option_retention_runtime)).toBe( + assert.strictEqual(getOption(message, message_option_retention_runtime), "message option retention runtime", ); const field = MessageWithOptionsSchema.fields[0]; - expect(getOption(field, field_option_retention_unknown)).toBe( + assert.strictEqual(getOption(field, field_option_retention_unknown), "field option retention unknown", ); - expect(getOption(field, field_option_retention_runtime)).toBe( + assert.strictEqual(getOption(field, field_option_retention_runtime), "field option retention runtime", ); const oneof = MessageWithOptionsSchema.oneofs[0]; - expect(getOption(oneof, oneof_option_retention_unknown)).toBe( + assert.strictEqual(getOption(oneof, oneof_option_retention_unknown), "oneof option retention unknown", ); - expect(getOption(oneof, oneof_option_retention_runtime)).toBe( + assert.strictEqual(getOption(oneof, oneof_option_retention_runtime), "oneof option retention runtime", ); const enumeration = EnumWithOptionsSchema; - expect(getOption(enumeration, enum_option_retention_unknown)).toBe( + assert.strictEqual(getOption(enumeration, enum_option_retention_unknown), "enum option retention unknown", ); - expect(getOption(enumeration, enum_option_retention_runtime)).toBe( + assert.strictEqual(getOption(enumeration, enum_option_retention_runtime), "enum option retention runtime", ); const enumValue = EnumWithOptionsSchema.values[0]; - expect(getOption(enumValue, enum_value_option_retention_unknown)).toBe( + assert.strictEqual(getOption(enumValue, enum_value_option_retention_unknown), "enum value option retention unknown", ); - expect(getOption(enumValue, enum_value_option_retention_runtime)).toBe( + assert.strictEqual(getOption(enumValue, enum_value_option_retention_runtime), "enum value option retention runtime", ); const service = ServiceWithOptions; - expect(getOption(service, service_option_retention_unknown)).toBe( + assert.strictEqual(getOption(service, service_option_retention_unknown), "service option retention unknown", ); - expect(getOption(service, service_option_retention_runtime)).toBe( + assert.strictEqual(getOption(service, service_option_retention_runtime), "service option retention runtime", ); const method = ServiceWithOptions.methods[0]; - expect(getOption(method, method_option_retention_unknown)).toBe( + assert.strictEqual(getOption(method, method_option_retention_unknown), "method option retention unknown", ); - expect(getOption(method, method_option_retention_runtime)).toBe( + assert.strictEqual(getOption(method, method_option_retention_runtime), "method option retention runtime", ); }); diff --git a/packages/protobuf-test/src/proto-int64.test.ts b/packages/protobuf-test/src/proto-int64.test.ts index 5869316fd..5ada3d573 100644 --- a/packages/protobuf-test/src/proto-int64.test.ts +++ b/packages/protobuf-test/src/proto-int64.test.ts @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { protoInt64 } from "@bufbuild/protobuf"; import Long from "long"; @@ -63,23 +64,23 @@ const UNSIGNED = { }, } as const; -describe("npm package 'long'", () => { +void suite("npm package 'long'", () => { for (const [k, v] of Object.entries(SIGNED)) { test(`should parse the same bits from string ${k}`, () => { const got = Long.fromString(k, false); - expect({ lo: got.low, hi: got.high }).toStrictEqual(v); - expect(got.toString()).toBe(k); + assert.deepStrictEqual({ lo: got.low, hi: got.high }, v); + assert.strictEqual(got.toString(), k); }); } for (const [k, v] of Object.entries(UNSIGNED)) { test(`should parse the same bits from string ${k}`, () => { const got = Long.fromString(k, true); - expect({ lo: got.low, hi: got.high }).toStrictEqual(v); - expect(got.toString()).toBe(k); + assert.deepStrictEqual({ lo: got.low, hi: got.high }, v); + assert.strictEqual(got.toString(), k); }); } - describe("integration example", () => { - test("should work", () => { + void suite("integration example", () => { + void test("should work", () => { const message = { int64Field: protoInt64.parse("9223372036854775807") }; // convert the field value to a Long @@ -93,19 +94,19 @@ describe("npm package 'long'", () => { message.int64Field = protoInt64.dec(longResult.low, longResult.high); // Assuming int64Field contains 9223372036854775807: - expect(message.int64Field).toBe(protoInt64.parse("9223372036854775806")); + assert.strictEqual(message.int64Field, protoInt64.parse("9223372036854775806")); }); }); }); -describe("protoInt64", () => { - describe("parse()", () => { +void suite("protoInt64", () => { + void suite("parse()", () => { for (const [k] of Object.entries(SIGNED)) { test(`should parse string ${k}`, () => { const val = protoInt64.parse(k); - expect(val.toString()).toBe(k); - expect(typeof val === "bigint").toBe(protoInt64.supported); - expect(typeof val === "string").toBe(!protoInt64.supported); + assert.strictEqual(val.toString(), k); + assert.strictEqual(typeof val === "bigint", protoInt64.supported); + assert.strictEqual(typeof val === "string", !protoInt64.supported); }); test(`should parse number ${k}`, () => { const number = Number(k); @@ -114,29 +115,29 @@ describe("protoInt64", () => { number >= Number.MIN_SAFE_INTEGER ) { const val = protoInt64.parse(k); - expect(val.toString()).toBe(k); - expect(typeof val === "bigint").toBe(protoInt64.supported); - expect(typeof val === "string").toBe(!protoInt64.supported); + assert.strictEqual(val.toString(), k); + assert.strictEqual(typeof val === "bigint", protoInt64.supported); + assert.strictEqual(typeof val === "string", !protoInt64.supported); } }); if (protoInt64.supported) { test(`should parse bigint ${k}`, () => { const bigint = BigInt(k); const val = protoInt64.parse(bigint); - expect(val.toString()).toBe(k); - expect(typeof val).toBe("bigint"); + assert.strictEqual(val.toString(), k); + assert.strictEqual(typeof val, "bigint"); }); } } }); - describe("uParse()", () => { + void suite("uParse()", () => { for (const [k] of Object.entries(UNSIGNED)) { test(`should parse string ${k}`, () => { const val = protoInt64.uParse(k); - expect(val.toString()).toBe(k); - expect(typeof val === "bigint").toBe(protoInt64.supported); - expect(typeof val === "string").toBe(!protoInt64.supported); + assert.strictEqual(val.toString(), k); + assert.strictEqual(typeof val === "bigint", protoInt64.supported); + assert.strictEqual(typeof val === "string", !protoInt64.supported); }); test(`should parse number ${k}`, () => { const number = Number(k); @@ -145,26 +146,26 @@ describe("protoInt64", () => { number >= Number.MIN_SAFE_INTEGER ) { const val = protoInt64.uParse(k); - expect(val.toString()).toBe(k); - expect(typeof val === "bigint").toBe(protoInt64.supported); - expect(typeof val === "string").toBe(!protoInt64.supported); + assert.strictEqual(val.toString(), k); + assert.strictEqual(typeof val === "bigint", protoInt64.supported); + assert.strictEqual(typeof val === "string", !protoInt64.supported); } }); if (protoInt64.supported) { test(`should parse bigint ${k}`, () => { const bigint = BigInt(k); const val = protoInt64.uParse(bigint); - expect(val.toString()).toBe(k); - expect(typeof val).toBe("bigint"); + assert.strictEqual(val.toString(), k); + assert.strictEqual(typeof val, "bigint"); }); } } }); - describe("enc()", () => { + void suite("enc()", () => { for (const [k, v] of Object.entries(SIGNED)) { test(`should encode string ${k}`, () => { - expect(protoInt64.enc(k)).toStrictEqual(v); + assert.deepStrictEqual(protoInt64.enc(k), v); }); test(`should encode number ${k}`, () => { const number = Number(k); @@ -172,31 +173,31 @@ describe("protoInt64", () => { number <= Number.MAX_SAFE_INTEGER && number >= Number.MIN_SAFE_INTEGER ) { - expect(protoInt64.enc(number)).toStrictEqual(v); + assert.deepStrictEqual(protoInt64.enc(number), v); } }); if (protoInt64.supported) { test(`should encode bigint ${k}`, () => { for (const [k, v] of Object.entries(SIGNED)) { const bigint = BigInt(k); - expect(protoInt64.enc(bigint)).toStrictEqual(v); + assert.deepStrictEqual(protoInt64.enc(bigint), v); } }); } } - test("should fail to encode invalid", () => { + void test("should fail to encode invalid", () => { if (protoInt64.supported) { - expect(() => protoInt64.enc(BigInt("18446744073709551615"))).toThrow( - "invalid int64: 18446744073709551615", - ); + assert.throws(() => protoInt64.enc(BigInt("18446744073709551615")), { + message: "invalid int64: 18446744073709551615", + }); } }); }); - describe("uEnc()", () => { + void suite("uEnc()", () => { for (const [k, v] of Object.entries(UNSIGNED)) { test(`should encode string ${k}`, () => { - expect(protoInt64.uEnc(k)).toStrictEqual(v); + assert.deepStrictEqual(protoInt64.uEnc(k), v); }); test(`should encode number ${k}`, () => { const number = Number(k); @@ -204,68 +205,68 @@ describe("protoInt64", () => { number <= Number.MAX_SAFE_INTEGER && number >= Number.MIN_SAFE_INTEGER ) { - expect(protoInt64.uEnc(number)).toStrictEqual(v); + assert.deepStrictEqual(protoInt64.uEnc(number), v); } }); if (protoInt64.supported) { test(`should encode bigint ${k}`, () => { const bigint = BigInt(k); - expect(protoInt64.uEnc(bigint)).toStrictEqual(v); + assert.deepStrictEqual(protoInt64.uEnc(bigint), v); }); } } - test("should fail to encode invalid", () => { + void test("should fail to encode invalid", () => { if (protoInt64.supported) { - expect(() => protoInt64.uEnc(BigInt(-127))).toThrow( - "invalid uint64: -127", - ); - expect(() => protoInt64.uEnc(BigInt("-9007199254740991"))).toThrow( - "invalid uint64: -9007199254740991", - ); - expect(() => protoInt64.uEnc(BigInt("-9223372036854775808"))).toThrow( - "invalid uint64: -9223372036854775808", - ); + assert.throws(() => protoInt64.uEnc(BigInt(-127)), { + message: "invalid uint64: -127", + }); + assert.throws(() => protoInt64.uEnc(BigInt("-9007199254740991")), { + message: "invalid uint64: -9007199254740991", + }); + assert.throws(() => protoInt64.uEnc(BigInt("-9223372036854775808")), { + message: "invalid uint64: -9223372036854775808", + }); } - expect(() => protoInt64.uEnc(-127)).toThrow("invalid uint64: -127"); - expect(() => protoInt64.uEnc("-9007199254740991")).toThrow( - "invalid uint64: -9007199254740991", - ); - expect(() => protoInt64.uEnc("-9223372036854775808")).toThrow( - "invalid uint64: -9223372036854775808", - ); + assert.throws(() => protoInt64.uEnc(-127), {message: "invalid uint64: -127"}); + assert.throws(() => protoInt64.uEnc("-9007199254740991"), { + message: "invalid uint64: -9007199254740991", +}); + assert.throws(() => protoInt64.uEnc("-9223372036854775808"), { + message: "invalid uint64: -9223372036854775808", +}); }); }); - describe("dec()", () => { + void suite("dec()", () => { for (const [k, v] of Object.entries(SIGNED)) { test(`should decode ${k}`, () => { const val = protoInt64.dec(v.lo, v.hi); - expect(val.toString()).toBe(k); - expect(typeof val === "bigint").toBe(protoInt64.supported); - expect(typeof val === "string").toBe(!protoInt64.supported); + assert.strictEqual(val.toString(), k); + assert.strictEqual(typeof val === "bigint", protoInt64.supported); + assert.strictEqual(typeof val === "string", !protoInt64.supported); }); } }); - describe("uDec()", () => { + void suite("uDec()", () => { for (const [k, v] of Object.entries(UNSIGNED)) { test(`should decode ${k}`, () => { const val = protoInt64.uDec(v.lo, v.hi); - expect(val.toString()).toBe(k); - expect(typeof val === "bigint").toBe(protoInt64.supported); - expect(typeof val === "string").toBe(!protoInt64.supported); + assert.strictEqual(val.toString(), k); + assert.strictEqual(typeof val === "bigint", protoInt64.supported); + assert.strictEqual(typeof val === "string", !protoInt64.supported); }); } }); - describe("zero", () => { + void suite("zero", () => { if (protoInt64.supported) { - test("zero is a string ", () => { - expect(protoInt64.zero).toBe(BigInt(0)); + void test("zero is a string ", () => { + assert.strictEqual(protoInt64.zero, BigInt(0)); }); } else { - test("zero is a string ", () => { - expect(protoInt64.zero).toBe("0"); + void test("zero is a string ", () => { + assert.strictEqual(protoInt64.zero, "0"); }); } }); From 3f4a7e63f3429eb1d8c5106013276bf8ee23a76f Mon Sep 17 00:00:00 2001 From: Timo Stamm Date: Mon, 18 Aug 2025 19:17:00 +0200 Subject: [PATCH 08/16] Migrate protobuf-test --- packages/protobuf-test/src/registry.test.ts | 712 +++++++++--------- .../src/serialization-errors.test.ts | 207 ++--- .../src/to-json-default-registry.test.ts | 9 +- packages/protobuf-test/src/types.test.ts | 107 +-- .../protobuf-test/src/valid_types.test.ts | 11 +- 5 files changed, 524 insertions(+), 522 deletions(-) diff --git a/packages/protobuf-test/src/registry.test.ts b/packages/protobuf-test/src/registry.test.ts index 1daf04a93..db02c167c 100644 --- a/packages/protobuf-test/src/registry.test.ts +++ b/packages/protobuf-test/src/registry.test.ts @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { beforeAll, beforeEach, describe, expect, test } from "@jest/globals"; -import assert from "node:assert"; +import { suite, test, beforeEach, before } from "node:test"; +import * as assert from "node:assert"; import { type FileRegistry, createFileRegistry, @@ -45,7 +45,7 @@ import { compileService, } from "./helpers.js"; -describe("createRegistry()", () => { +void suite("createRegistry()", () => { let testReg: FileRegistry; let testDescs: { message: DescMessage; @@ -53,7 +53,7 @@ describe("createRegistry()", () => { service: DescService; extension: DescExtension; }; - beforeAll(async () => { + before(async () => { const fileDescriptorSet = await compileFileDescriptorSet({ "a.proto": ` syntax="proto2"; @@ -65,17 +65,17 @@ describe("createRegistry()", () => { }); testReg = createFileRegistry(fileDescriptorSet); const descMsg = testReg.get("Msg"); - assert(descMsg); - assert(descMsg.kind == "message"); + assert.ok(descMsg); + assert.ok(descMsg.kind == "message"); const descEnu = testReg.get("Enu"); - assert(descEnu); - assert(descEnu.kind == "enum"); + assert.ok(descEnu); + assert.ok(descEnu.kind == "enum"); const descSrv = testReg.get("Srv"); - assert(descSrv); - assert(descSrv.kind == "service"); + assert.ok(descSrv); + assert.ok(descSrv.kind == "service"); const descExt = testReg.get("ext"); - assert(descExt); - assert(descExt.kind == "extension"); + assert.ok(descExt); + assert.ok(descExt.kind == "extension"); testDescs = { message: descMsg, enum: descEnu, @@ -83,70 +83,70 @@ describe("createRegistry()", () => { extension: descExt, }; }); - describe("get()", () => { - test("gets message", () => { + void suite("get()", () => { + void test("gets message", () => { const reg = createRegistry(testDescs.message); - expect(reg.get("Msg")).toBe(testDescs.message); + assert.strictEqual(reg.get("Msg"), testDescs.message); }); - test("gets enum", () => { + void test("gets enum", () => { const reg = createRegistry(testDescs.enum); - expect(reg.get("Enu")).toBe(testDescs.enum); + assert.strictEqual(reg.get("Enu"), testDescs.enum); }); - test("gets service", () => { + void test("gets service", () => { const reg = createRegistry(testDescs.service); - expect(reg.get("Srv")).toBe(testDescs.service); + assert.strictEqual(reg.get("Srv"), testDescs.service); }); - test("gets extension", () => { + void test("gets extension", () => { const reg = createRegistry(testDescs.extension); - expect(reg.get("ext")).toBe(testDescs.extension); + assert.strictEqual(reg.get("ext"), testDescs.extension); }); }); - describe("getMessage()", () => { - test("gets message", () => { + void suite("getMessage()", () => { + void test("gets message", () => { const reg = createRegistry(testDescs.message); const msg: DescMessage | undefined = reg.getMessage("Msg"); - expect(msg).toBe(testDescs.message); + assert.strictEqual(msg, testDescs.message); }); }); - describe("getEnum()", () => { - test("gets enum", () => { + void suite("getEnum()", () => { + void test("gets enum", () => { const reg = createRegistry(testDescs.enum); const msg: DescEnum | undefined = reg.getEnum("Enu"); - expect(msg).toBe(testDescs.enum); + assert.strictEqual(msg, testDescs.enum); }); }); - describe("getService()", () => { - test("gets service", () => { + void suite("getService()", () => { + void test("gets service", () => { const reg = createRegistry(testDescs.service); const msg: DescService | undefined = reg.getService("Srv"); - expect(msg).toBe(testDescs.service); + assert.strictEqual(msg, testDescs.service); }); }); - describe("getExtension()", () => { - test("gets extension", () => { + void suite("getExtension()", () => { + void test("gets extension", () => { const reg = createRegistry(testDescs.extension); const ext: DescExtension | undefined = reg.getExtension("ext"); - expect(ext).toBe(testDescs.extension); + assert.strictEqual(ext, testDescs.extension); }); }); - describe("getExtensionFor()", () => { - test("gets extension", () => { + void suite("getExtensionFor()", () => { + void test("gets extension", () => { const reg = createRegistry(testDescs.extension); const ext: DescExtension | undefined = reg.getExtensionFor( testDescs.message, 1, ); - expect(ext).toBe(testDescs.extension); + assert.strictEqual(ext, testDescs.extension); }); - test("returns undefined on unknown extension field number", () => { + void test("returns undefined on unknown extension field number", () => { const reg = createRegistry(testDescs.extension); const msg: DescExtension | undefined = reg.getExtensionFor( testDescs.message, 2, ); - expect(msg).toBeUndefined(); + assert.strictEqual(msg, undefined); }); - test("returns undefined on unknown extendee", async () => { + void test("returns undefined on unknown extendee", async () => { const fileDescriptorSet = await compileFileDescriptorSet({ "b.proto": ` syntax="proto3"; @@ -155,17 +155,17 @@ describe("createRegistry()", () => { }); const otherMessageDesc = createFileRegistry(fileDescriptorSet).getMessage("OtherMsg"); - assert(otherMessageDesc); + assert.ok(otherMessageDesc); const reg = createRegistry(testDescs.extension); const msg: DescExtension | undefined = reg.getExtensionFor( otherMessageDesc, 2, ); - expect(msg).toBeUndefined(); + assert.strictEqual(msg, undefined); }); }); - describe("iterator", () => { - test("gets registered types", () => { + void suite("iterator", () => { + void test("gets registered types", () => { const reg = createRegistry( testDescs.message, testDescs.enum, @@ -176,15 +176,15 @@ describe("createRegistry()", () => { .map((t) => t.typeName) .sort(); const want = ["Msg", "Enu", "Srv", "ext"].sort(); - expect(actual).toStrictEqual(want); + assert.deepStrictEqual(actual, want); }); }); - describe("from DescMessage", () => { - test("provides message", () => { + void suite("from DescMessage", () => { + void test("provides message", () => { const reg = createRegistry(testDescs.message); - expect(reg.get("Msg")).toBeDefined(); + assert.ok(reg.get("Msg") !== undefined); }); - test("does not make message fields available", async () => { + void test("does not make message fields available", async () => { const fileDescriptorSet = await compileFileDescriptorSet({ "b.proto": ` syntax="proto3"; @@ -196,12 +196,12 @@ describe("createRegistry()", () => { }); const testMessage = createFileRegistry(fileDescriptorSet).getMessage("Msg"); - assert(testMessage); + assert.ok(testMessage); const reg = createRegistry(testMessage); - expect(reg.get("Msg")).toBeDefined(); - expect(reg.get("FieldMsg")).toBeUndefined(); + assert.ok(reg.get("Msg") !== undefined); + assert.strictEqual(reg.get("FieldMsg"), undefined); }); - test("does not make nested messages available", async () => { + void test("does not make nested messages available", async () => { const fileDescriptorSet = await compileFileDescriptorSet({ "b.proto": ` syntax="proto3"; @@ -212,15 +212,15 @@ describe("createRegistry()", () => { }); const testReg = createFileRegistry(fileDescriptorSet); const testMessage = testReg.getMessage("Msg"); - assert(testMessage); + assert.ok(testMessage); const nestedTestMessage = testReg.getMessage("Msg.Nested"); - assert(nestedTestMessage); + assert.ok(nestedTestMessage); const reg = createRegistry(testMessage); - expect(reg.get("Msg")).toBeDefined(); - expect(reg.get("Msg.Nested")).toBeUndefined(); - expect(Array.from(reg).length).toBe(1); + assert.ok(reg.get("Msg") !== undefined); + assert.strictEqual(reg.get("Msg.Nested"), undefined); + assert.strictEqual(Array.from(reg).length, 1); }); - test("later duplicate type overwrites former type", async () => { + void test("later duplicate type overwrites former type", async () => { const fileDescriptorSet = await compileFileDescriptorSet({ "b.proto": ` syntax="proto3"; @@ -229,36 +229,36 @@ describe("createRegistry()", () => { }); const duplicateMessage = createFileRegistry(fileDescriptorSet).getMessage("Msg"); - assert(duplicateMessage); - assert(duplicateMessage.typeName === testDescs.message.typeName); + assert.ok(duplicateMessage); + assert.ok(duplicateMessage.typeName === testDescs.message.typeName); const reg = createRegistry(duplicateMessage, testDescs.message); - expect(reg.getMessage("Msg")).toBe(testDescs.message); + assert.strictEqual(reg.getMessage("Msg"), testDescs.message); }); }); - describe("from DescFile", () => { - test("provides all types from the file", () => { + void suite("from DescFile", () => { + void test("provides all types from the file", () => { const testFile = testReg.getFile("a.proto"); - assert(testFile); + assert.ok(testFile); const reg = createRegistry(testFile); const regTypeNames = Array.from(reg) .map((t) => t.typeName) .sort(); - expect(regTypeNames).toStrictEqual(["Msg", "Enu", "Srv", "ext"].sort()); + assert.deepStrictEqual(regTypeNames, ["Msg", "Enu", "Srv", "ext"].sort()); }); }); - describe("from Registry", () => { - test("creates a copy of the given Registry", () => { + void suite("from Registry", () => { + void test("creates a copy of the given Registry", () => { const testSetTypeNames = Array.from(testReg) .map((t) => t.typeName) .sort(); - assert(testSetTypeNames.length > 0); + assert.ok(testSetTypeNames.length > 0); const reg = createRegistry(testReg); const regTypeNames = Array.from(reg) .map((t) => t.typeName) .sort(); - expect(regTypeNames).toStrictEqual(testSetTypeNames); + assert.deepStrictEqual(regTypeNames, testSetTypeNames); }); - test("merges two Registries", async () => { + void test("merges two Registries", async () => { const secondReg = createFileRegistry( await compileFileDescriptorSet({ "a.proto": ` @@ -274,11 +274,11 @@ describe("createRegistry()", () => { const regTypeNames = Array.from(reg) .map((t) => t.typeName) .sort(); - expect(regTypeNames).toStrictEqual( + assert.deepStrictEqual(regTypeNames, ["Msg", "Enu", "Srv", "ext", "Msg2", "Enu2", "Srv2", "ext2"].sort(), ); }); - test("later duplicate type overwrites former type", async () => { + void test("later duplicate type overwrites former type", async () => { const secondReg = createFileRegistry( await compileFileDescriptorSet({ "a.proto": ` @@ -292,45 +292,45 @@ describe("createRegistry()", () => { const regTypeNames = Array.from(reg) .map((t) => t.typeName) .sort(); - expect(regTypeNames).toStrictEqual( + assert.deepStrictEqual(regTypeNames, ["Msg", "Enu", "Srv", "ext", "Msg3"].sort(), ); - expect(reg.get("Msg")).toBe(secondReg.get("Msg")); - expect(reg.get("Msg")).not.toBe(testReg.get("Msg")); + assert.strictEqual(reg.get("Msg"), secondReg.get("Msg")); + assert.notStrictEqual(reg.get("Msg"), testReg.get("Msg")); }); }); }); -describe("createMutableRegistry()", () => { - test("from DescMessage", async () => { +void suite("createMutableRegistry()", () => { + void test("from DescMessage", async () => { const desc = await compileMessage(` syntax = "proto3"; message A {} `); const reg = createMutableRegistry(desc); - expect(reg.getMessage("A")).toBeDefined(); + assert.ok(reg.getMessage("A") !== undefined); }); - test("add() adds DescMessage", async () => { + void test("add() adds DescMessage", async () => { const desc = await compileMessage(` syntax = "proto3"; message A {} `); const reg = createMutableRegistry(); reg.add(desc); - expect(reg.getMessage("A")).toBeDefined(); + assert.ok(reg.getMessage("A") !== undefined); }); - test("remove() removes DescMessage", async () => { + void test("remove() removes DescMessage", async () => { const desc = await compileMessage(` syntax = "proto3"; message A {} `); const reg = createMutableRegistry(desc); reg.remove(desc); - expect(reg.getMessage("A")).toBeUndefined(); + assert.strictEqual(reg.getMessage("A"), undefined); }); }); -describe("createFileRegistry()", () => { +void suite("createFileRegistry()", () => { let testFileDescriptorSet: FileDescriptorSet; beforeEach(async () => { testFileDescriptorSet = await compileFileDescriptorSet({ @@ -363,25 +363,24 @@ describe("createFileRegistry()", () => { `, }); }); - describe("from FileDescriptorSet", () => { - test("provides files through getFile()", () => { + void suite("from FileDescriptorSet", () => { + void test("provides files through getFile()", () => { const fileReg = createFileRegistry(testFileDescriptorSet); const a = fileReg.getFile("a.proto"); const b = fileReg.getFile("b.proto"); const c = fileReg.getFile("c.proto"); const d = fileReg.getFile("d.proto"); - expect(a).toBeDefined(); - expect(b).toBeDefined(); - expect(c).toBeDefined(); - expect(d).toBeDefined(); - expect(a?.dependencies).toStrictEqual([b, c]); - expect(b?.dependencies).toStrictEqual([d]); - expect(c?.dependencies).toStrictEqual([d]); - expect(d?.dependencies).toStrictEqual([]); + assert.ok(a !== undefined); + assert.ok(b !== undefined); + assert.ok(c !== undefined); + assert.deepStrictEqual(a?.dependencies, [b, c]); + assert.deepStrictEqual(b?.dependencies, [d]); + assert.deepStrictEqual(c?.dependencies, [d]); + assert.deepStrictEqual(d?.dependencies, []); }); test("provides files through file iterable", () => { const fileReg = createFileRegistry(testFileDescriptorSet); - expect(Array.from(fileReg.files).map((f) => f.name)).toStrictEqual([ + assert.deepStrictEqual(Array.from(fileReg.files).map((f) => f.name), [ "d", "b", "c", @@ -389,40 +388,40 @@ describe("createFileRegistry()", () => { ]); }); }); - describe("from FileDescriptorProto", () => { + void suite("from FileDescriptorProto", () => { let descFileA: DescFile; let testFileReg: FileRegistry; - beforeAll(() => { + before(() => { testFileReg = createFileRegistry(testFileDescriptorSet); const a = testFileReg.getFile("a.proto"); - assert(a !== undefined); + assert.ok(a !== undefined); descFileA = a; }); test("resolves all dependencies as FileDescriptorProto", () => { const reg = createFileRegistry(descFileA.proto, (protoFileName) => testFileReg.getFile(protoFileName), ); - expect(reg.getFile("a.proto")).toBeDefined(); - expect(reg.getFile("b.proto")).toBeDefined(); - expect(reg.getFile("c.proto")).toBeDefined(); - expect(reg.getFile("d.proto")).toBeDefined(); - expect(reg.getMessage("A")).toBeDefined(); - expect(reg.getMessage("B")).toBeDefined(); - expect(reg.getMessage("C")).toBeDefined(); - expect(reg.getMessage("D")).toBeDefined(); + assert.ok(reg.getFile("a.proto") !== undefined); + assert.ok(reg.getFile("b.proto") !== undefined); + assert.ok(reg.getFile("c.proto") !== undefined); + assert.ok(reg.getFile("d.proto") !== undefined); + assert.ok(reg.getMessage("A") !== undefined); + assert.ok(reg.getMessage("B") !== undefined); + assert.ok(reg.getMessage("C") !== undefined); + assert.ok(reg.getMessage("D") !== undefined); }); test("resolves all dependencies as DescFile", () => { const reg = createFileRegistry(descFileA.proto, (protoFileName) => testFileReg.getFile(protoFileName), ); - expect(reg.getFile("a.proto")).toBeDefined(); - expect(reg.getFile("b.proto")).toBeDefined(); - expect(reg.getFile("c.proto")).toBeDefined(); - expect(reg.getFile("d.proto")).toBeDefined(); - expect(reg.getMessage("A")).toBeDefined(); - expect(reg.getMessage("B")).toBeDefined(); - expect(reg.getMessage("C")).toBeDefined(); - expect(reg.getMessage("D")).toBeDefined(); + assert.ok(reg.getFile("a.proto") !== undefined); + assert.ok(reg.getFile("b.proto") !== undefined); + assert.ok(reg.getFile("c.proto") !== undefined); + assert.ok(reg.getFile("d.proto") !== undefined); + assert.ok(reg.getMessage("A") !== undefined); + assert.ok(reg.getMessage("B") !== undefined); + assert.ok(reg.getMessage("C") !== undefined); + assert.ok(reg.getMessage("D") !== undefined); }); test("raises error on unresolvable dependency", () => { function t() { @@ -433,15 +432,15 @@ describe("createFileRegistry()", () => { return testFileReg.getFile(protoFileName); }); } - expect(t).toThrow(/^Unable to resolve c.proto, imported by a.proto$/); + assert.throws(t, {message: /^Unable to resolve c.proto, imported by a.proto$/}); }); }); test("accepts empty arguments", () => { const registry = createFileRegistry(); const types = Array.from(registry); const files = Array.from(registry.files); - expect(types.length).toBe(0); - expect(files.length).toBe(0); + assert.strictEqual(types.length, 0); + assert.strictEqual(files.length, 0); }); test("raises error on unsupported edition from the past", () => { testFileDescriptorSet.file[0].syntax = "editions"; @@ -449,7 +448,7 @@ describe("createFileRegistry()", () => { function t() { createFileRegistry(testFileDescriptorSet); } - expect(t).toThrow(/^d.proto: unsupported edition$/); + assert.throws(t, {message: /^d.proto: unsupported edition$/}); }); test("raises error on unsupported edition from the future", () => { testFileDescriptorSet.file[0].syntax = "editions"; @@ -457,9 +456,9 @@ describe("createFileRegistry()", () => { function t() { createFileRegistry(testFileDescriptorSet); } - expect(t).toThrow(/^d.proto: unsupported edition$/); + assert.throws(t, {message: /^d.proto: unsupported edition$/}); }); - describe("from FileRegistry", () => { + void suite("from FileRegistry", () => { test("creates a copy of the given FileRegistry", () => { const testReg = createFileRegistry(testFileDescriptorSet); const testRegFileNames = Array.from(testReg.files) @@ -468,17 +467,17 @@ describe("createFileRegistry()", () => { const testRegTypeNames = Array.from(testReg) .map((t) => t.typeName) .sort(); - assert(testRegTypeNames.length > 0); + assert.ok(testRegTypeNames.length > 0); const reg = createFileRegistry(testReg); const regFileNames = Array.from(reg.files) .map((f) => f.name) .sort(); - expect(regFileNames).toStrictEqual(testRegFileNames); + assert.deepStrictEqual(regFileNames, testRegFileNames); const regTypeNames = Array.from(reg) .map((t) => t.typeName) .sort(); - expect(regTypeNames).toStrictEqual(testRegTypeNames); + assert.deepStrictEqual(regTypeNames, testRegTypeNames); }); test("merges two FileRegistries", async () => { const regA = createFileRegistry( @@ -504,18 +503,17 @@ describe("createFileRegistry()", () => { }), ); const reg = createFileRegistry(regA, regB); - expect( + assert.deepStrictEqual( Array.from(reg) .map((t) => t.typeName) .sort(), - ).toStrictEqual( ["Msg", "Enu", "Srv", "ext", "Msg2", "Enu2", "Srv2", "ext2"].sort(), ); - expect( + assert.deepStrictEqual( Array.from(reg.files) .map((f) => f.name) .sort(), - ).toStrictEqual(["a", "b"].sort()); + ["a", "b"].sort()); }); test("later duplicate file overwrites former file", async () => { const regA = createFileRegistry( @@ -535,28 +533,28 @@ describe("createFileRegistry()", () => { }), ); const reg = createFileRegistry(regA, regB); - expect(Array.from(reg.files).map((f) => f.name)).toStrictEqual(["a"]); - expect( + assert.deepStrictEqual(Array.from(reg.files).map((f) => f.name), ["a"]); + assert.deepStrictEqual( Array.from(reg) .map((t) => t.typeName) .sort(), - ).toStrictEqual(["MsgA", "MsgB"].sort()); + ["MsgA", "MsgB"].sort()); }); }); }); -describe("DescFile", () => { +void suite("DescFile", () => { test("proto2 syntax", async () => { const file = await compileFile(`syntax="proto2";`); - expect(file.edition).toBe(Edition.EDITION_PROTO2); + assert.strictEqual(file.edition, Edition.EDITION_PROTO2); }); test("proto3 syntax", async () => { const file = await compileFile(`syntax="proto3";`); - expect(file.edition).toBe(Edition.EDITION_PROTO3); + assert.strictEqual(file.edition, Edition.EDITION_PROTO3); }); test("edition 2023", async () => { const file = await compileFile(`edition = "2023";`); - expect(file.edition).toBe(Edition.EDITION_2023); + assert.strictEqual(file.edition, Edition.EDITION_2023); }); test("dependencies", async () => { const fileDescriptorSet = await compileFileDescriptorSet({ @@ -580,34 +578,34 @@ describe("DescFile", () => { }); const reg = createFileRegistry(fileDescriptorSet); const a = reg.getFile("a.proto"); - expect(a?.name).toBe("a"); - expect(a?.dependencies.length).toBe(2); - expect(a?.dependencies.map((f) => f.name)).toStrictEqual(["b", "c"]); + assert.strictEqual(a?.name, "a"); + assert.strictEqual(a?.dependencies.length, 2); + assert.deepStrictEqual(a?.dependencies.map((f) => f.name), ["b", "c"]); }); - describe("name", () => { + void suite("name", () => { test("is proto file name without .proto suffix", async () => { const file = await compileFile(`syntax="proto3";`, "foo/bar/baz.proto"); - expect(file.name).toBe("foo/bar/baz"); + assert.strictEqual(file.name, "foo/bar/baz"); }); test("strips only last .proto", async () => { const file = await compileFile( `syntax="proto3";`, "foo.proto/baz.proto.proto", ); - expect(file.name).toBe("foo.proto/baz.proto"); + assert.strictEqual(file.name, "foo.proto/baz.proto"); }); }); }); -describe("DescMessage", () => { - describe("deprecated", () => { +void suite("DescMessage", () => { + void suite("deprecated", () => { test("is false by default", async () => { const descMessage = await compileMessage(` syntax="proto3"; option deprecated = true; message Foo {} `); - expect(descMessage.deprecated).toBe(false); + assert.strictEqual(descMessage.deprecated, false); }); test("is true with option", async () => { const descMessage = await compileMessage(` @@ -616,10 +614,10 @@ describe("DescMessage", () => { option deprecated = true; } `); - expect(descMessage.deprecated).toBe(true); + assert.strictEqual(descMessage.deprecated, true); }); }); - describe("field", () => { + void suite("field", () => { test("contains field by localName", async () => { const descMessage = await compileMessage(` syntax="proto3"; @@ -630,7 +628,7 @@ describe("DescMessage", () => { } } `); - expect(Object.keys(descMessage.field).sort()).toStrictEqual([ + assert.deepStrictEqual(Object.keys(descMessage.field).sort(), [ "fooBar", "oneofField", ]); @@ -638,8 +636,8 @@ describe("DescMessage", () => { }); }); -describe("DescEnum", () => { - describe("open", () => { +void suite("DescEnum", () => { + void suite("open", () => { test("proto3 enum is open", async () => { const descEnum = await compileEnum(` syntax="proto3"; @@ -647,7 +645,7 @@ describe("DescEnum", () => { A = 0; } `); - expect(descEnum.open).toBe(true); + assert.strictEqual(descEnum.open, true); }); test("proto2 enum is closed", async () => { const descEnum = await compileEnum(` @@ -656,7 +654,7 @@ describe("DescEnum", () => { A = 1; } `); - expect(descEnum.open).toBe(false); + assert.strictEqual(descEnum.open, false); }); test("edition 2023 enum is open by default", async () => { const descEnum = await compileEnum(` @@ -665,7 +663,7 @@ describe("DescEnum", () => { A = 0; } `); - expect(descEnum.open).toBe(true); + assert.strictEqual(descEnum.open, true); }); test("edition 2023 enum is closed by file feature", async () => { const descEnum = await compileEnum(` @@ -675,7 +673,7 @@ describe("DescEnum", () => { A = 1; } `); - expect(descEnum.open).toBe(false); + assert.strictEqual(descEnum.open, false); }); test("edition 2023 enum is closed by enum feature", async () => { const descEnum = await compileEnum(` @@ -685,10 +683,10 @@ describe("DescEnum", () => { A = 1; } `); - expect(descEnum.open).toBe(false); + assert.strictEqual(descEnum.open, false); }); }); - describe("sharedPrefix", () => { + void suite("sharedPrefix", () => { test("is shared prefix", async () => { const descEnum = await compileEnum(` syntax="proto3"; @@ -697,7 +695,7 @@ describe("DescEnum", () => { MY_ENUM_B = 1; } `); - expect(descEnum.sharedPrefix).toBe("my_enum_"); + assert.strictEqual(descEnum.sharedPrefix, "my_enum_"); }); test("is shared prefix regardless of casing", async () => { const descEnum = await compileEnum(` @@ -707,7 +705,7 @@ describe("DescEnum", () => { my_enum_B = 1; } `); - expect(descEnum.sharedPrefix).toBe("my_enum_"); + assert.strictEqual(descEnum.sharedPrefix, "my_enum_"); }); test("is undefined without shared prefix", async () => { const descEnum = await compileEnum(` @@ -717,7 +715,7 @@ describe("DescEnum", () => { B = 1; } `); - expect(descEnum.sharedPrefix).toBeUndefined(); + assert.strictEqual(descEnum.sharedPrefix, undefined); }); test("is undefined if any short name starts with a number", async () => { const descEnum = await compileEnum(` @@ -727,10 +725,10 @@ describe("DescEnum", () => { MY_ENUM_23_B = 1; } `); - expect(descEnum.sharedPrefix).toBeUndefined(); + assert.strictEqual(descEnum.sharedPrefix, undefined); }); }); - describe("deprecated", () => { + void suite("deprecated", () => { test("not deprecated by default", async () => { const descEnum = await compileEnum(` syntax="proto3"; @@ -738,7 +736,7 @@ describe("DescEnum", () => { A = 0; } `); - expect(descEnum.deprecated).toBe(false); + assert.strictEqual(descEnum.deprecated, false); }); test("deprecated is deprecated", async () => { const descEnum = await compileEnum(` @@ -748,7 +746,7 @@ describe("DescEnum", () => { A = 0; } `); - expect(descEnum.deprecated).toBe(true); + assert.strictEqual(descEnum.deprecated, true); }); test("deprecated file is not deprecated", async () => { const descEnum = await compileEnum(` @@ -758,27 +756,26 @@ describe("DescEnum", () => { A = 0; } `); - expect(descEnum.deprecated).toBe(false); + assert.strictEqual(descEnum.deprecated, false); }); }); }); -describe("DescEnumValue", () => { - describe("name", () => { - test.each(["MY_ENUM_A", "foo", "__proto__"])( - "is proto name %s", - async (name) => { +void suite("DescEnumValue", () => { + void suite("name", () => { + for (const name of ["MY_ENUM_A", "foo", "__proto__"]) { + void test(`is proto name ${name}`, async () => { const descEnum = await compileEnum(` - syntax="proto3"; - enum MyEnum { - ${name} = 0; - } - `); - expect(descEnum.values[0].name).toBe(name); - }, - ); + syntax="proto3"; + enum MyEnum { + ${name} = 0; + } + `); + assert.strictEqual(descEnum.values[0].name, name); + }); + } }); - describe("localName", () => { + void suite("localName", () => { test("does not change case", async () => { const value = ( await compileEnum(` @@ -788,7 +785,7 @@ describe("DescEnumValue", () => { } `) ).values[0]; - expect(value.localName).toBe("FooBAR_baz_1"); + assert.strictEqual(value.localName, "FooBAR_baz_1"); }); test("drops shared prefix", async () => { const value = ( @@ -800,7 +797,7 @@ describe("DescEnumValue", () => { } `) ).values[0]; - expect(value.localName).toBe("ZERO"); + assert.strictEqual(value.localName, "ZERO"); }); test("escapes reserved property name", async () => { const value = ( @@ -811,7 +808,7 @@ describe("DescEnumValue", () => { } `) ).values[0]; - expect(value.localName).toBe("constructor$"); + assert.strictEqual(value.localName, "constructor$"); }); test("escapes reserved property name with dropped prefix", async () => { const value = ( @@ -822,10 +819,10 @@ describe("DescEnumValue", () => { } `) ).values[0]; - expect(value.localName).toBe("constructor$"); + assert.strictEqual(value.localName, "constructor$"); }); }); - describe("deprecated", () => { + void suite("deprecated", () => { test("not deprecated by default", async () => { const value = ( await compileEnum(` @@ -835,7 +832,7 @@ describe("DescEnumValue", () => { } `) ).values[0]; - expect(value.deprecated).toBe(false); + assert.strictEqual(value.deprecated, false); }); test("deprecated is deprecated", async () => { const value = ( @@ -846,7 +843,7 @@ describe("DescEnumValue", () => { } `) ).values[0]; - expect(value.deprecated).toBe(true); + assert.strictEqual(value.deprecated, true); }); test("deprecated enum is not deprecated", async () => { const value = ( @@ -858,7 +855,7 @@ describe("DescEnumValue", () => { } `) ).values[0]; - expect(value.deprecated).toBe(false); + assert.strictEqual(value.deprecated, false); }); test("deprecated file is not deprecated", async () => { const value = ( @@ -870,13 +867,13 @@ describe("DescEnumValue", () => { } `) ).values[0]; - expect(value.deprecated).toBe(false); + assert.strictEqual(value.deprecated, false); }); }); }); -describe("DescField", () => { - describe("presence", () => { +void suite("DescField", () => { + void suite("presence", () => { test("proto2 optional scalar is EXPLICIT", async () => { const field = await compileField(` syntax="proto2"; @@ -884,7 +881,7 @@ describe("DescField", () => { optional int32 f = 1; } `); - expect(field.presence).toBe(FeatureSet_FieldPresence.EXPLICIT); + assert.strictEqual(field.presence, FeatureSet_FieldPresence.EXPLICIT); }); test("proto2 optional message is EXPLICIT", async () => { const field = await compileField(` @@ -893,7 +890,7 @@ describe("DescField", () => { optional M f = 1; } `); - expect(field.presence).toBe(FeatureSet_FieldPresence.EXPLICIT); + assert.strictEqual(field.presence, FeatureSet_FieldPresence.EXPLICIT); }); test("proto2 required scalar is LEGACY_REQUIRED", async () => { const field = await compileField(` @@ -902,7 +899,7 @@ describe("DescField", () => { required int32 f = 1; } `); - expect(field.presence).toBe(FeatureSet_FieldPresence.LEGACY_REQUIRED); + assert.strictEqual(field.presence, FeatureSet_FieldPresence.LEGACY_REQUIRED); }); test("proto2 required message is LEGACY_REQUIRED", async () => { const field = await compileField(` @@ -911,7 +908,7 @@ describe("DescField", () => { required M f = 1; } `); - expect(field.presence).toBe(FeatureSet_FieldPresence.LEGACY_REQUIRED); + assert.strictEqual(field.presence, FeatureSet_FieldPresence.LEGACY_REQUIRED); }); test("proto2 scalar list is IMPLICIT", async () => { const field = await compileField(` @@ -920,7 +917,7 @@ describe("DescField", () => { repeated int32 f = 1; } `); - expect(field.presence).toBe(FeatureSet_FieldPresence.IMPLICIT); + assert.strictEqual(field.presence, FeatureSet_FieldPresence.IMPLICIT); }); test("proto2 message list is IMPLICIT", async () => { const field = await compileField(` @@ -929,7 +926,7 @@ describe("DescField", () => { repeated M f = 1; } `); - expect(field.presence).toBe(FeatureSet_FieldPresence.IMPLICIT); + assert.strictEqual(field.presence, FeatureSet_FieldPresence.IMPLICIT); }); test("proto2 scalar map is IMPLICIT", async () => { const field = await compileField(` @@ -938,7 +935,7 @@ describe("DescField", () => { map f = 1; } `); - expect(field.presence).toBe(FeatureSet_FieldPresence.IMPLICIT); + assert.strictEqual(field.presence, FeatureSet_FieldPresence.IMPLICIT); }); test("proto2 message map is IMPLICIT", async () => { const field = await compileField(` @@ -947,7 +944,7 @@ describe("DescField", () => { map f = 1; } `); - expect(field.presence).toBe(FeatureSet_FieldPresence.IMPLICIT); + assert.strictEqual(field.presence, FeatureSet_FieldPresence.IMPLICIT); }); test("proto2 oneof is EXPLICIT", async () => { const field = await compileField(` @@ -958,7 +955,7 @@ describe("DescField", () => { } } `); - expect(field.presence).toBe(FeatureSet_FieldPresence.EXPLICIT); + assert.strictEqual(field.presence, FeatureSet_FieldPresence.EXPLICIT); }); test("proto3 scalar is IMPLICIT", async () => { const field = await compileField(` @@ -967,7 +964,7 @@ describe("DescField", () => { int32 f = 1; } `); - expect(field.presence).toBe(FeatureSet_FieldPresence.IMPLICIT); + assert.strictEqual(field.presence, FeatureSet_FieldPresence.IMPLICIT); }); test("proto3 optional scalar is EXPLICIT", async () => { const field = await compileField(` @@ -976,7 +973,7 @@ describe("DescField", () => { optional int32 f = 1; } `); - expect(field.presence).toBe(FeatureSet_FieldPresence.EXPLICIT); + assert.strictEqual(field.presence, FeatureSet_FieldPresence.EXPLICIT); }); test("proto3 scalar list is IMPLICIT", async () => { const field = await compileField(` @@ -985,7 +982,7 @@ describe("DescField", () => { repeated int32 f = 1; } `); - expect(field.presence).toBe(FeatureSet_FieldPresence.IMPLICIT); + assert.strictEqual(field.presence, FeatureSet_FieldPresence.IMPLICIT); }); test("proto3 message list is IMPLICIT", async () => { const field = await compileField(` @@ -994,7 +991,7 @@ describe("DescField", () => { repeated M f = 1; } `); - expect(field.presence).toBe(FeatureSet_FieldPresence.IMPLICIT); + assert.strictEqual(field.presence, FeatureSet_FieldPresence.IMPLICIT); }); test("proto3 scalar map is IMPLICIT", async () => { const field = await compileField(` @@ -1003,7 +1000,7 @@ describe("DescField", () => { map f = 1; } `); - expect(field.presence).toBe(FeatureSet_FieldPresence.IMPLICIT); + assert.strictEqual(field.presence, FeatureSet_FieldPresence.IMPLICIT); }); test("proto3 message map is IMPLICIT", async () => { const field = await compileField(` @@ -1012,7 +1009,7 @@ describe("DescField", () => { map f = 1; } `); - expect(field.presence).toBe(FeatureSet_FieldPresence.IMPLICIT); + assert.strictEqual(field.presence, FeatureSet_FieldPresence.IMPLICIT); }); test("proto3 oneof is EXPLICIT", async () => { const field = await compileField(` @@ -1023,7 +1020,7 @@ describe("DescField", () => { } } `); - expect(field.presence).toBe(FeatureSet_FieldPresence.EXPLICIT); + assert.strictEqual(field.presence, FeatureSet_FieldPresence.EXPLICIT); }); test("proto3 message is EXPLICIT", async () => { const field = await compileField(` @@ -1032,7 +1029,7 @@ describe("DescField", () => { M f = 1; } `); - expect(field.presence).toBe(FeatureSet_FieldPresence.EXPLICIT); + assert.strictEqual(field.presence, FeatureSet_FieldPresence.EXPLICIT); }); test("proto3 optional message is EXPLICIT", async () => { const field = await compileField(` @@ -1041,7 +1038,7 @@ describe("DescField", () => { optional M f = 1; } `); - expect(field.presence).toBe(FeatureSet_FieldPresence.EXPLICIT); + assert.strictEqual(field.presence, FeatureSet_FieldPresence.EXPLICIT); }); test("edition2023 scalar is EXPLICIT", async () => { const field = await compileField(` @@ -1050,7 +1047,7 @@ describe("DescField", () => { int32 f = 1; } `); - expect(field.presence).toBe(FeatureSet_FieldPresence.EXPLICIT); + assert.strictEqual(field.presence, FeatureSet_FieldPresence.EXPLICIT); }); test("edition2023 scalar inherits IMPLICIT", async () => { const field = await compileField(` @@ -1060,7 +1057,7 @@ describe("DescField", () => { int32 f = 1; } `); - expect(field.presence).toBe(FeatureSet_FieldPresence.IMPLICIT); + assert.strictEqual(field.presence, FeatureSet_FieldPresence.IMPLICIT); }); test("edition2023 message is EXPLICIT", async () => { const field = await compileField(` @@ -1070,7 +1067,7 @@ describe("DescField", () => { M f = 1; } `); - expect(field.presence).toBe(FeatureSet_FieldPresence.EXPLICIT); + assert.strictEqual(field.presence, FeatureSet_FieldPresence.EXPLICIT); }); test("edition2023 message does not inherit IMPLICIT", async () => { const field = await compileField(` @@ -1080,7 +1077,7 @@ describe("DescField", () => { M f = 1; } `); - expect(field.presence).toBe(FeatureSet_FieldPresence.EXPLICIT); + assert.strictEqual(field.presence, FeatureSet_FieldPresence.EXPLICIT); }); test("edition2023 scalar list is IMPLICIT", async () => { const field = await compileField(` @@ -1089,7 +1086,7 @@ describe("DescField", () => { repeated int32 f = 1; } `); - expect(field.presence).toBe(FeatureSet_FieldPresence.IMPLICIT); + assert.strictEqual(field.presence, FeatureSet_FieldPresence.IMPLICIT); }); test("edition2023 message list is IMPLICIT", async () => { const field = await compileField(` @@ -1098,7 +1095,7 @@ describe("DescField", () => { repeated M f = 1; } `); - expect(field.presence).toBe(FeatureSet_FieldPresence.IMPLICIT); + assert.strictEqual(field.presence, FeatureSet_FieldPresence.IMPLICIT); }); test("edition2023 scalar with LEGACY_REQUIRED is LEGACY_REQUIRED", async () => { const field = await compileField(` @@ -1107,7 +1104,7 @@ describe("DescField", () => { int32 f = 1 [features.field_presence = LEGACY_REQUIRED]; } `); - expect(field.presence).toBe(FeatureSet_FieldPresence.LEGACY_REQUIRED); + assert.strictEqual(field.presence, FeatureSet_FieldPresence.LEGACY_REQUIRED); }); test("edition2023 message with LEGACY_REQUIRED is LEGACY_REQUIRED", async () => { const field = await compileField(` @@ -1116,10 +1113,10 @@ describe("DescField", () => { M f = 1 [features.field_presence = LEGACY_REQUIRED]; } `); - expect(field.presence).toBe(FeatureSet_FieldPresence.LEGACY_REQUIRED); + assert.strictEqual(field.presence, FeatureSet_FieldPresence.LEGACY_REQUIRED); }); }); - describe("delimitedEncoding", () => { + void suite("delimitedEncoding", () => { test("true for proto2 group", async () => { const field = await compileField(` syntax="proto2"; @@ -1127,9 +1124,9 @@ describe("DescField", () => { optional group GroupField = 2 {} } `); - expect( + assert.strictEqual( field.fieldKind == "message" ? field.delimitedEncoding : undefined, - ).toBe(true); + true); }); test("true for field with features.message_encoding = DELIMITED", async () => { const field = await compileField(` @@ -1138,9 +1135,9 @@ describe("DescField", () => { M f = 1 [features.message_encoding = DELIMITED]; } `); - expect( + assert.strictEqual( field.fieldKind == "message" ? field.delimitedEncoding : undefined, - ).toBe(true); + true); }); test("true for list field with features.message_encoding = DELIMITED", async () => { const field = await compileField(` @@ -1149,11 +1146,11 @@ describe("DescField", () => { repeated M f = 1 [features.message_encoding = DELIMITED]; } `); - expect( + assert.strictEqual( field.fieldKind == "list" && field.listKind == "message" ? field.delimitedEncoding : undefined, - ).toBe(true); + true); }); test("true for file with features.message_encoding = DELIMITED", async () => { const field = await compileField(` @@ -1163,9 +1160,9 @@ describe("DescField", () => { M f = 1; } `); - expect( + assert.strictEqual( field.fieldKind == "message" ? field.delimitedEncoding : undefined, - ).toBe(true); + true); }); test("false for map field with inherited features.message_encoding = DELIMITED", async () => { const field = await compileField(` @@ -1175,12 +1172,12 @@ describe("DescField", () => { map f = 1; } `); - expect( + assert.strictEqual( field.fieldKind == "map" ? field.delimitedEncoding : undefined, - ).toBe(false); + false); }); }); - describe("longAsString", () => { + void suite("longAsString", () => { test("returns default false for option omitted", async () => { const { fields } = await compileMessage(` syntax="proto3"; @@ -1197,59 +1194,58 @@ describe("DescField", () => { repeated uint64 repeated_uint64_field = 15; } `); - expect(fields.length > 0).toBeTruthy(); + assert.ok(fields.length > 0); for (const field of fields) { - expect( + assert.ok( field.fieldKind == "scalar" || (field.fieldKind == "list" && field.listKind == "scalar"), - ).toBeTruthy(); + ); if ( field.fieldKind == "scalar" || (field.fieldKind == "list" && field.listKind == "scalar") ) { - expect(field.longAsString).toBe(false); + assert.strictEqual(field.longAsString, false); } } }); - test.each([ + for (const {jstype, longAsString} of [ { jstype: "JS_NORMAL", longAsString: false }, { jstype: "JS_NUMBER", longAsString: false }, { jstype: "JS_STRING", longAsString: true }, - ] as const)( - "returns default LongType.$longType for jstype=$jstype", - async ({ jstype, longAsString }) => { + ] as const) { + void test(`returns longAsString=${longAsString} for jstype=${jstype}`, async () => { const { fields } = await compileMessage(` - syntax="proto3"; - message M { - fixed64 fixed64_field = 1 [jstype = ${jstype}]; - int64 int64_field = 3 [jstype = ${jstype}]; - sfixed64 sfixed64_field = 4 [jstype = ${jstype}]; - sint64 sint64_field = 5 [jstype = ${jstype}]; - uint64 uint64_field = 6 [jstype = ${jstype}]; - repeated fixed64 repeated_fixed64_field = 11 [jstype = ${jstype}]; - repeated int64 repeated_int64_field = 12 [jstype = ${jstype}]; - repeated sfixed64 repeated_sfixed64_field = 13 [jstype = ${jstype}]; - repeated sint64 repeated_sint64_field = 14 [jstype = ${jstype}]; - repeated uint64 repeated_uint64_field = 15 [jstype = ${jstype}]; - } - `); - expect(fields.length > 0).toBeTruthy(); + syntax="proto3"; + message M { + fixed64 fixed64_field = 1 [jstype = ${jstype}]; + int64 int64_field = 3 [jstype = ${jstype}]; + sfixed64 sfixed64_field = 4 [jstype = ${jstype}]; + sint64 sint64_field = 5 [jstype = ${jstype}]; + uint64 uint64_field = 6 [jstype = ${jstype}]; + repeated fixed64 repeated_fixed64_field = 11 [jstype = ${jstype}]; + repeated int64 repeated_int64_field = 12 [jstype = ${jstype}]; + repeated sfixed64 repeated_sfixed64_field = 13 [jstype = ${jstype}]; + repeated sint64 repeated_sint64_field = 14 [jstype = ${jstype}]; + repeated uint64 repeated_uint64_field = 15 [jstype = ${jstype}]; + } + `); + assert.ok(fields.length > 0); for (const field of fields) { - expect( + assert.ok( field.fieldKind == "scalar" || - (field.fieldKind == "list" && field.listKind == "scalar"), - ).toBeTruthy(); + (field.fieldKind == "list" && field.listKind == "scalar"), + ); if ( field.fieldKind == "scalar" || (field.fieldKind == "list" && field.listKind == "scalar") ) { - expect(field.longAsString).toBe(longAsString); + assert.strictEqual(field.longAsString, longAsString); } } - }, - ); + }); + } }); - describe("localName", () => { + void suite("localName", () => { test("applies protoCamelCase", async () => { const field = await compileField(` syntax="proto3"; @@ -1257,7 +1253,7 @@ describe("DescField", () => { int32 __proto__ = 1; } `); - expect(field.localName).toBe("Proto"); + assert.strictEqual(field.localName, "Proto"); }); test("escapes reserved property name", async () => { const field = await compileField(` @@ -1266,9 +1262,9 @@ describe("DescField", () => { int32 constructor = 1; } `); - expect(field.localName).toBe("constructor$"); + assert.strictEqual(field.localName, "constructor$"); }); - describe("with field in oneof", () => { + void suite("with field in oneof", () => { test("applies protoCamelCase", async () => { const field = await compileField(` syntax="proto3"; @@ -1278,8 +1274,8 @@ describe("DescField", () => { } } `); - expect(field.oneof).toBeDefined(); - expect(field.localName).toBe("Proto"); + assert.ok(field.oneof !== undefined); + assert.strictEqual(field.localName, "Proto"); }); test("does not escape reserved property name", async () => { const field = await compileField(` @@ -1290,39 +1286,37 @@ describe("DescField", () => { } } `); - expect(field.oneof).toBeDefined(); - expect(field.localName).toBe("constructor"); + assert.ok(field.oneof !== undefined); + assert.strictEqual(field.localName, "constructor"); }); }); }); - describe("jsonName", () => { - test.each(["field", "foo_bar", "__proto__", "constructor"])( - "returns compiler-provided json_name for %s", - async (name) => { + void suite("jsonName", () => { + for (const name of ["field", "foo_bar", "__proto__", "constructor"]) { + void test(`returns compiler-provided json_name for ${name}`, async () => { const field = await compileField(` - syntax="proto3"; - message M { - int32 ${name} = 1; - } - `); - expect(field.jsonName).toBe(protoCamelCase(name)); - expect(field.jsonName).toBe(field.proto.jsonName); - }, - ); - test.each(["foo", "foo_bar", "", "@type"])( - "returns custom json_name for %s", - async (name) => { + syntax="proto3"; + message M { + int32 ${name} = 1; + } + `); + assert.strictEqual(field.jsonName, protoCamelCase(name)); + assert.strictEqual(field.jsonName, field.proto.jsonName); + }); + } + for (const name of ["foo", "foo_bar", "", "@type"]) { + void test(`returns custom json_name for ${name}`, async () => { const field = await compileField(` - syntax="proto3"; - message M { - int32 f = 1 [json_name = "${name}"]; - } - `); - expect(field.jsonName).toBe(name); - }, - ); + syntax="proto3"; + message M { + int32 f = 1 [json_name = "${name}"]; + } + `); + assert.strictEqual(field.jsonName, name); + }); + } }); - describe("repeated field packing", () => { + void suite("repeated field packing", () => { test("proto2 is unpacked by default", async () => { const fileDescriptorSet = await compileFileDescriptorSet({ "a.proto": ` @@ -1336,30 +1330,30 @@ describe("DescField", () => { }); const fields = createFileRegistry(fileDescriptorSet).getMessage("M")?.fields; - assert(fields); + assert.ok(fields); { const f = fields.shift(); - assert( + assert.ok( f?.fieldKind == "list" && (f.listKind == "scalar" || f.listKind == "enum"), ); - expect(f.packed).toBe(false); + assert.strictEqual(f.packed, false); } { const f = fields.shift(); - assert( + assert.ok( f?.fieldKind == "list" && (f.listKind == "scalar" || f.listKind == "enum"), ); - expect(f.packed).toBe(true); + assert.strictEqual(f.packed, true); } { const f = fields.shift(); - assert( + assert.ok( f?.fieldKind == "list" && (f.listKind == "scalar" || f.listKind == "enum"), ); - expect(f.packed).toBe(false); + assert.strictEqual(f.packed, false); } }); test("proto3 is packed by default", async () => { @@ -1375,30 +1369,30 @@ describe("DescField", () => { }); const fields = createFileRegistry(fileDescriptorSet).getMessage("M")?.fields; - assert(fields); + assert.ok(fields); { const f = fields.shift(); - assert( + assert.ok( f?.fieldKind == "list" && (f.listKind == "scalar" || f.listKind == "enum"), ); - expect(f.packed).toBe(true); + assert.strictEqual(f.packed, true); } { const f = fields.shift(); - assert( + assert.ok( f?.fieldKind == "list" && (f.listKind == "scalar" || f.listKind == "enum"), ); - expect(f.packed).toBe(true); + assert.strictEqual(f.packed, true); } { const f = fields.shift(); - assert( + assert.ok( f?.fieldKind == "list" && (f.listKind == "scalar" || f.listKind == "enum"), ); - expect(f.packed).toBe(false); + assert.strictEqual(f.packed, false); } }); test("edition2023 is packed by default", async () => { @@ -1414,30 +1408,30 @@ describe("DescField", () => { }); const fields = createFileRegistry(fileDescriptorSet).getMessage("M")?.fields; - assert(fields); + assert.ok(fields); { const f = fields.shift(); - assert( + assert.ok( f?.fieldKind == "list" && (f.listKind == "scalar" || f.listKind == "enum"), ); - expect(f.packed).toBe(true); + assert.strictEqual(f.packed, true); } { const f = fields.shift(); - assert( + assert.ok( f?.fieldKind == "list" && (f.listKind == "scalar" || f.listKind == "enum"), ); - expect(f.packed).toBe(true); + assert.strictEqual(f.packed, true); } { const f = fields.shift(); - assert( + assert.ok( f?.fieldKind == "list" && (f.listKind == "scalar" || f.listKind == "enum"), ); - expect(f.packed).toBe(false); + assert.strictEqual(f.packed, false); } }); test("edition2023 with repeated_field_encoding file option", async () => { @@ -1453,22 +1447,22 @@ describe("DescField", () => { }); const fields = createFileRegistry(fileDescriptorSet).getMessage("M")?.fields; - assert(fields); + assert.ok(fields); { const f = fields.shift(); - assert( + assert.ok( f?.fieldKind == "list" && (f.listKind == "scalar" || f.listKind == "enum"), ); - expect(f.packed).toBe(false); + assert.strictEqual(f.packed, false); } { const f = fields.shift(); - assert( + assert.ok( f?.fieldKind == "list" && (f.listKind == "scalar" || f.listKind == "enum"), ); - expect(f.packed).toBe(true); + assert.strictEqual(f.packed, true); } }); }); @@ -1483,7 +1477,7 @@ describe("DescField", () => { }); const field = createFileRegistry(fileDescriptorSet).getMessage("M")?.fields[0]; - assert(field); + assert.ok(field); // always available field.kind; @@ -1571,7 +1565,7 @@ describe("DescField", () => { const oneof: DescOneof | undefined = field.oneof; - assert([def, oneof].length > 0); + assert.ok([def, oneof].length > 0); break; } case "enum": { @@ -1711,8 +1705,8 @@ describe("DescField", () => { }); }); -describe("DescOneof", () => { - describe("localName", () => { +void suite("DescOneof", () => { + void suite("localName", () => { test("applies protoCamelCase", async () => { const oneof = ( await compileMessage(` @@ -1724,7 +1718,7 @@ describe("DescOneof", () => { } `) ).oneofs[0]; - expect(oneof.localName).toBe("Proto"); + assert.strictEqual(oneof.localName, "Proto"); }); test("escapes reserved property name", async () => { const oneof = ( @@ -1737,10 +1731,10 @@ describe("DescOneof", () => { } `) ).oneofs[0]; - expect(oneof.localName).toBe("constructor$"); + assert.strictEqual(oneof.localName, "constructor$"); }); }); - describe("fields", () => { + void suite("fields", () => { test("has member fields", async () => { const oneof = ( await compileMessage(` @@ -1753,12 +1747,12 @@ describe("DescOneof", () => { } `) ).oneofs[0]; - expect(oneof.fields.length).toBe(2); + assert.strictEqual(oneof.fields.length, 2); }); }); }); -describe("DescExtension", () => { +void suite("DescExtension", () => { test("typeName", async () => { const ext = await compileExtension(` syntax="proto2"; @@ -1767,7 +1761,7 @@ describe("DescExtension", () => { } message M { extensions 1; } `); - expect(ext.typeName).toBe("ext"); + assert.strictEqual(ext.typeName, "ext"); }); test("typeName with package", async () => { const ext = await compileExtension(` @@ -1778,7 +1772,7 @@ describe("DescExtension", () => { } message M { extensions 1; } `); - expect(ext.typeName).toBe("test.ext"); + assert.strictEqual(ext.typeName, "test.ext"); }); test("typeName for nested package", async () => { const message = await compileMessage(` @@ -1792,7 +1786,7 @@ describe("DescExtension", () => { message M { extensions 1; } `); const ext = message.nestedExtensions[0]; - expect(ext.typeName).toBe("test.C.ext"); + assert.strictEqual(ext.typeName, "test.C.ext"); }); test("jsonName", async () => { const message = await compileMessage(` @@ -1806,7 +1800,7 @@ describe("DescExtension", () => { message M { extensions 1; } `); const ext = message.nestedExtensions[0]; - expect(ext.jsonName).toBe("[test.C.ext]"); + assert.strictEqual(ext.jsonName, "[test.C.ext]"); }); test("extendee", async () => { const file = await compileFile(` @@ -1819,7 +1813,7 @@ describe("DescExtension", () => { `); const ext = file.extensions[0]; const M = file.messages[0]; - expect(ext.extendee).toBe(M); + assert.strictEqual(ext.extendee, M); }); test("parent", async () => { const message = await compileMessage(` @@ -1833,9 +1827,9 @@ describe("DescExtension", () => { message M { extensions 1; } `); const ext = message.nestedExtensions[0]; - expect(ext.parent).toBe(message); + assert.strictEqual(ext.parent, message); }); - describe("presence", () => { + void suite("presence", () => { test("proto3 implicit field is EXPLICIT", async () => { const ext = await compileExtension(` syntax="proto3"; @@ -1844,7 +1838,7 @@ describe("DescExtension", () => { int32 ext = 1001; } `); - expect(ext.presence).toBe(FeatureSet_FieldPresence.EXPLICIT); + assert.strictEqual(ext.presence, FeatureSet_FieldPresence.EXPLICIT); }); test("proto3 list is IMPLICIT", async () => { const ext = await compileExtension(` @@ -1854,10 +1848,10 @@ describe("DescExtension", () => { repeated int32 ext = 1001; } `); - expect(ext.presence).toBe(FeatureSet_FieldPresence.IMPLICIT); + assert.strictEqual(ext.presence, FeatureSet_FieldPresence.IMPLICIT); }); }); - describe("delimitedEncoding", () => { + void suite("delimitedEncoding", () => { test("true for proto2 group", async () => { const ext = await compileExtension(` syntax="proto2"; @@ -1866,9 +1860,9 @@ describe("DescExtension", () => { } message M { extensions 1; } `); - expect( + assert.strictEqual( ext.fieldKind == "message" ? ext.delimitedEncoding : undefined, - ).toBe(true); + true); }); test("true for field with features.message_encoding = DELIMITED", async () => { const ext = await compileExtension(` @@ -1878,21 +1872,21 @@ describe("DescExtension", () => { } message M { extensions 1; } `); - expect( + assert.strictEqual( ext.fieldKind == "message" ? ext.delimitedEncoding : undefined, - ).toBe(true); + true); }); }); }); -describe("DescService", () => { +void suite("DescService", () => { test("typeName", async () => { const service = await compileService(` syntax="proto3"; package test; service Foo {} `); - expect(service.typeName).toBe("test.Foo"); + assert.strictEqual(service.typeName, "test.Foo"); }); test("methods", async () => { const service = await compileService(` @@ -1904,16 +1898,16 @@ describe("DescService", () => { message I {} message O {} `); - expect(service.methods.length).toBe(2); - expect(service.deprecated).toBe(false); + assert.strictEqual(service.methods.length, 2); + assert.strictEqual(service.deprecated, false); }); - describe("deprecated", () => { + void suite("deprecated", () => { test("is false by default", async () => { const service = await compileService(` syntax="proto3"; service Foo {} `); - expect(service.deprecated).toBe(false); + assert.strictEqual(service.deprecated, false); }); test("is true with option", async () => { const service = await compileService(` @@ -1922,13 +1916,13 @@ describe("DescService", () => { option deprecated = true; } `); - expect(service.deprecated).toBe(true); + assert.strictEqual(service.deprecated, true); }); }); }); -describe("DescMethod", () => { - describe("methodKind", () => { +void suite("DescMethod", () => { + void suite("methodKind", () => { test("unary", async () => { const method = await compileMethod(` syntax="proto3"; @@ -1938,7 +1932,7 @@ describe("DescMethod", () => { message I {} message O {} `); - expect(method.methodKind).toBe("unary"); + assert.strictEqual(method.methodKind, "unary"); }); test("server-streaming", async () => { const method = await compileMethod(` @@ -1949,7 +1943,7 @@ describe("DescMethod", () => { message I {} message O {} `); - expect(method.methodKind).toBe("server_streaming"); + assert.strictEqual(method.methodKind, "server_streaming"); }); test("client-streaming", async () => { const method = await compileMethod(` @@ -1960,7 +1954,7 @@ describe("DescMethod", () => { message I {} message O {} `); - expect(method.methodKind).toBe("client_streaming"); + assert.strictEqual(method.methodKind, "client_streaming"); }); test("bidi-streaming", async () => { const method = await compileMethod(` @@ -1971,10 +1965,10 @@ describe("DescMethod", () => { message I {} message O {} `); - expect(method.methodKind).toBe("bidi_streaming"); + assert.strictEqual(method.methodKind, "bidi_streaming"); }); }); - describe("idempotency", () => { + void suite("idempotency", () => { test("is IDEMPOTENCY_UNKNOWN if unset", async () => { const method = await compileMethod(` syntax="proto3"; @@ -1984,7 +1978,7 @@ describe("DescMethod", () => { message I {} message O {} `); - expect(method.idempotency).toBe( + assert.strictEqual(method.idempotency, MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN, ); }); @@ -1999,7 +1993,7 @@ describe("DescMethod", () => { message I {} message O {} `); - expect(method.idempotency).toBe( + assert.strictEqual(method.idempotency, MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN, ); }); @@ -2014,7 +2008,7 @@ describe("DescMethod", () => { message I {} message O {} `); - expect(method.idempotency).toBe( + assert.strictEqual(method.idempotency, MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS, ); }); @@ -2029,12 +2023,12 @@ describe("DescMethod", () => { message I {} message O {} `); - expect(method.idempotency).toBe( + assert.strictEqual(method.idempotency, MethodOptions_IdempotencyLevel.IDEMPOTENT, ); }); }); - describe("deprecated", () => { + void suite("deprecated", () => { test("is false by default", async () => { const method = await compileMethod(` syntax="proto3"; @@ -2044,7 +2038,7 @@ describe("DescMethod", () => { message I {} message O {} `); - expect(method.deprecated).toBe(false); + assert.strictEqual(method.deprecated, false); }); test("is true with option", async () => { const method = await compileMethod(` @@ -2057,10 +2051,10 @@ describe("DescMethod", () => { message I {} message O {} `); - expect(method.deprecated).toBe(true); + assert.strictEqual(method.deprecated, true); }); }); - describe("localName", () => { + void suite("localName", () => { test("makes first letter lowerCase", async () => { const rpc = ( await compileService(` @@ -2071,7 +2065,7 @@ describe("DescMethod", () => { message E {} `) ).methods[0]; - expect(rpc.localName).toBe("foo_bar_BAZ"); + assert.strictEqual(rpc.localName, "foo_bar_BAZ"); }); test("escapes reserved property name", async () => { const rpc = ( @@ -2083,7 +2077,7 @@ describe("DescMethod", () => { message E {} `) ).methods[0]; - expect(rpc.localName).toBe("constructor$"); + assert.strictEqual(rpc.localName, "constructor$"); }); }); }); diff --git a/packages/protobuf-test/src/serialization-errors.test.ts b/packages/protobuf-test/src/serialization-errors.test.ts index 1b6522341..e21319737 100644 --- a/packages/protobuf-test/src/serialization-errors.test.ts +++ b/packages/protobuf-test/src/serialization-errors.test.ts @@ -12,131 +12,132 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { create, toBinary, toJson } from "@bufbuild/protobuf"; import { FieldMaskSchema, ValueSchema } from "@bufbuild/protobuf/wkt"; import * as proto3_ts from "./gen/ts/extra/proto3_pb.js"; import * as proto2_ts from "./gen/ts/extra/proto2_pb.js"; import * as scalar_ts from "./gen/ts/extra/msg-scalar_pb.js"; -describe("serialization errors", () => { - describe("google.protobuf.FieldMask ", () => { - describe("lowerCamelCase path name irreversible", () => { +void suite("serialization errors", () => { + void suite("google.protobuf.FieldMask ", () => { + void suite("lowerCamelCase path name irreversible", () => { const fieldMask = create(FieldMaskSchema, { paths: ["user.displayName", "photo"], }); - test("toJson", () => { - expect(() => { + void test("toJson", () => { + assert.throws(() => { toJson(FieldMaskSchema, fieldMask); - }).toThrow( - 'cannot encode message google.protobuf.FieldMask to JSON: lowerCamelCase of path name "user.displayName" is irreversible', - ); + }, { + message: 'cannot encode message google.protobuf.FieldMask to JSON: lowerCamelCase of path name "user.displayName" is irreversible', + }); }); - test("toBinary", () => { - expect(() => { + void test("toBinary", () => { + assert.doesNotThrow(() => { toBinary(FieldMaskSchema, fieldMask); - }).not.toThrow(); + }); }); }); }); - describe("google.protobuf.Value", () => { - describe("unset value", () => { + void suite("google.protobuf.Value", () => { + void suite("unset value", () => { // Absence of any variant indicates an error. // See struct.proto const value = create(ValueSchema); - test("toJson", () => { - expect(() => toJson(ValueSchema, value)).toThrow( - "google.protobuf.Value must have a value", - ); + void test("toJson", () => { + assert.throws(() => toJson(ValueSchema, value), { + message: "google.protobuf.Value must have a value", + }); }); - test("toBinary", () => { - expect(() => toBinary(ValueSchema, value)).not.toThrow(); + void test("toBinary", () => { + assert.doesNotThrow(() => toBinary(ValueSchema, value)); }); }); - describe("numberValue NaN", () => { + void suite("numberValue NaN", () => { const value = create(ValueSchema, { kind: { case: "numberValue", value: NaN }, }); - test("toJson", () => { - expect(() => toJson(ValueSchema, value)).toThrow( - "google.protobuf.Value cannot be NaN or Infinity", - ); + void test("toJson", () => { + assert.throws(() => toJson(ValueSchema, value), { + message: "google.protobuf.Value cannot be NaN or Infinity", + }); }); - test("toBinary", () => { - expect(() => toBinary(ValueSchema, value)).not.toThrow(); + void test("toBinary", () => { + assert.doesNotThrow(() => toBinary(ValueSchema, value)); }); }); - describe("numberValue Infinity", () => { + void suite("numberValue Infinity", () => { const value = create(ValueSchema, { kind: { case: "numberValue", value: Infinity }, }); - test("toJson", () => { - expect(() => toJson(ValueSchema, value)).toThrow( - "google.protobuf.Value cannot be NaN or Infinity", - ); + void test("toJson", () => { + assert.throws(() => toJson(ValueSchema, value), { + message: "google.protobuf.Value cannot be NaN or Infinity", + }); }); - test("toBinary", () => { - expect(() => toBinary(ValueSchema, value)).not.toThrow(); + void test("toBinary", () => { + assert.doesNotThrow(() => toBinary(ValueSchema, value)); }); }); - describe("numberValue -Infinity", () => { + void suite("numberValue -Infinity", () => { const value = create(ValueSchema, { kind: { case: "numberValue", value: -Infinity }, }); - test("toJson", () => { - expect(() => toJson(ValueSchema, value)).toThrow( - "google.protobuf.Value cannot be NaN or Infinity", - ); + void test("toJson", () => { + assert.throws(() => toJson(ValueSchema, value), { + message: "google.protobuf.Value cannot be NaN or Infinity", + }); }); - test("toBinary", () => { - expect(() => toBinary(ValueSchema, value)).not.toThrow(); + void test("toBinary", () => { + assert.doesNotThrow(() => toBinary(ValueSchema, value)); }); }); }); - describe("enum field", () => { + void suite("enum field", () => { const desc = proto3_ts.Proto3MessageSchema; const msg = create(desc); // @ts-expect-error TS2322 msg.singularEnumField = "abc"; - test("toJson", () => { - expect(() => toJson(desc, msg)).toThrow( - /^cannot encode enum spec.Proto3Enum to JSON: expected number, got "abc"$/, - ); + void test("toJson", () => { + assert.throws(() => toJson(desc, msg), { + message: /^cannot encode enum spec.Proto3Enum to JSON: expected number, got "abc"$/, + }); }); test("toBinary", () => { - expect(() => toBinary(desc, msg)).toThrow( - /^cannot encode field spec.Proto3Message.singular_enum_field to binary: invalid int32: NaN$/, - ); + assert.throws(() => toBinary(desc, msg), { + message: /^cannot encode field spec.Proto3Message.singular_enum_field to binary: invalid int32: NaN$/, + }); }); }); - describe("repeated enum field", () => { + void suite("repeated enum field", () => { const desc = proto3_ts.Proto3MessageSchema; const msg = create(desc); // @ts-expect-error TS2322 msg.repeatedEnumField = ["abc"]; test("toJson", () => { - expect(() => toJson(desc, msg)).toThrow( - /^cannot encode enum spec.Proto3Enum to JSON: expected number, got "abc"$/, - ); + assert.throws(() => toJson(desc, msg), { + message: /^cannot encode enum spec.Proto3Enum to JSON: expected number, got "abc"$/, + }); }); test("toBinary", () => { - expect(() => toBinary(desc, msg)).toThrow( - /^cannot encode field spec.Proto3Message.repeated_enum_field to binary: invalid int32: NaN$/, - ); + assert.throws(() => toBinary(desc, msg), { + message: /^cannot encode field spec.Proto3Message.repeated_enum_field to binary: invalid int32: NaN$/, + }); }); }); - describe("required field", () => { + void suite("required field", () => { const desc = proto2_ts.Proto2MessageSchema; const msg = create(desc); test("toJson", () => { - expect(() => toJson(desc, msg)).toThrow( - /^cannot encode field spec.Proto2Message.required_string_field to JSON: required field not set$/, - ); + assert.throws(() => toJson(desc, msg), { + message: /^cannot encode field spec.Proto2Message.required_string_field to JSON: required field not set$/, + }); }); test("toBinary", () => { - expect(() => toBinary(desc, msg)).toThrow( - /^cannot encode field spec.Proto2Message.required_string_field to binary: required field not set$/, - ); + assert.throws(() => toBinary(desc, msg), { + message: /^cannot encode field spec.Proto2Message.required_string_field to binary: required field not set$/, + }); }); }); type ScalarCase = { @@ -145,7 +146,7 @@ describe("serialization errors", () => { jsonErr: RegExp | null; binaryErr: RegExp | null; }; - describe.each([ + for (const kase of [ { name: "int32 field string", val(m) { @@ -216,32 +217,34 @@ describe("serialization errors", () => { binaryErr: /^cannot encode field spec.ScalarValuesMessage.bytes_field to binary: invalid uint32: undefined$/, }, - ] as ScalarCase[])("$name", (kase) => { - const desc = scalar_ts.ScalarValuesMessageSchema; - const msg = create(desc); - kase.val(msg); - test("toJson", () => { - if (kase.jsonErr === null) { - expect(() => toJson(desc, msg)).not.toThrow(); - } else { - expect(() => toJson(desc, msg)).toThrow(kase.jsonErr); - } - }); - test("toBinary", () => { - if (kase.binaryErr === null) { - expect(() => toBinary(desc, msg)).not.toThrow(); - } else { - expect(() => toBinary(desc, msg)).toThrow(kase.binaryErr); - } + ] satisfies ScalarCase[]) { + void suite(`${kase.name}`, () => { + const desc = scalar_ts.ScalarValuesMessageSchema; + const msg = create(desc); + kase.val(msg); + void test("toJson", () => { + if (kase.jsonErr === null) { + assert.doesNotThrow(() => toJson(desc, msg)); + } else { + assert.throws(() => toJson(desc, msg), {message: kase.jsonErr}); + } + }); + void test("toBinary", () => { + if (kase.binaryErr === null) { + assert.doesNotThrow(() => toBinary(desc, msg)); + } else { + assert.throws(() => toBinary(desc, msg), {message: kase.binaryErr}); + } + }); }); - }); + } type RepeatedScalarCase = { name: string; val(m: scalar_ts.RepeatedScalarValuesMessage): void; jsonErr: RegExp | null; binaryErr: RegExp | null; }; - describe.each([ + for (const kase of [ { name: "repeated uint32 field [-1]", val(m) { @@ -262,23 +265,25 @@ describe("serialization errors", () => { binaryErr: /^cannot encode field spec.RepeatedScalarValuesMessage.int32_field to binary: invalid int32: NaN$/, }, - ] as RepeatedScalarCase[])("$name", (kase) => { - const desc = scalar_ts.RepeatedScalarValuesMessageSchema; - const msg = create(desc); - kase.val(msg); - test("toJson", () => { - if (kase.jsonErr === null) { - expect(() => toJson(desc, msg)).not.toThrow(); - } else { - expect(() => toJson(desc, msg)).toThrow(kase.jsonErr); - } - }); - test("toBinary", () => { - if (kase.binaryErr === null) { - expect(() => toBinary(desc, msg)).not.toThrow(); - } else { - expect(() => toBinary(desc, msg)).toThrow(kase.binaryErr); - } + ] satisfies RepeatedScalarCase[]) { + void suite(`${kase.name}`, () => { + const desc = scalar_ts.RepeatedScalarValuesMessageSchema; + const msg = create(desc); + kase.val(msg); + void test("toJson", () => { + if (kase.jsonErr === null) { + assert.doesNotThrow(() => toJson(desc, msg)); + } else { + assert.throws(() => toJson(desc, msg), {message: kase.jsonErr}); + } + }); + void test("toBinary", () => { + if (kase.binaryErr === null) { + assert.doesNotThrow(() => toBinary(desc, msg)); + } else { + assert.throws(() => toBinary(desc, msg), { message: kase.binaryErr }); + } + }); }); - }); + } }); diff --git a/packages/protobuf-test/src/to-json-default-registry.test.ts b/packages/protobuf-test/src/to-json-default-registry.test.ts index d22cf6930..066380e8c 100644 --- a/packages/protobuf-test/src/to-json-default-registry.test.ts +++ b/packages/protobuf-test/src/to-json-default-registry.test.ts @@ -12,15 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { create, createRegistry, toJson as toJsonOriginal, } from "@bufbuild/protobuf"; import { anyPack, AnySchema, DurationSchema } from "@bufbuild/protobuf/wkt"; -import { describe, expect, test } from "@jest/globals"; -describe("default registry with custom toJson()", () => { +void suite("default registry with custom toJson()", () => { // Define you own default registry const registry = createRegistry( // You can register as many types as you need. In this example, we only @@ -34,7 +35,7 @@ describe("default registry with custom toJson()", () => { return toJsonOriginal(schema, message, options ?? { registry }) as any; }; - test("works as expected", () => { + void test("works as expected", () => { // Create a google.protobuf.Any that holds a google.protobuf.Duration const duration = create(DurationSchema, { nanos: 123 }); const any = anyPack(DurationSchema, duration); @@ -42,7 +43,7 @@ describe("default registry with custom toJson()", () => { // Serializing to JSON requires a registry that contains google.protobuf.Duration const json = toJson(AnySchema, any); - expect(json).toStrictEqual({ + assert.deepStrictEqual(json, { "@type": "type.googleapis.com/google.protobuf.Duration", value: "0.000000123s", }); diff --git a/packages/protobuf-test/src/types.test.ts b/packages/protobuf-test/src/types.test.ts index 9d2303501..587c43d72 100644 --- a/packages/protobuf-test/src/types.test.ts +++ b/packages/protobuf-test/src/types.test.ts @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import { create, type MessageShape, @@ -47,34 +48,34 @@ import type * as valid_types_ts from "./gen/ts,valid_types/extra/valid_types_pb. import type * as valid_types_ts_novalid from "./gen/ts/extra/valid_types_pb.js"; import type * as codegenv1 from "@bufbuild/protobuf/codegenv1"; -describe("type Message", () => { - describe("assigning different messages with same shape to each other", () => { - test("is a type error", () => { +void suite("type Message", () => { + void suite("assigning different messages with same shape to each other", () => { + void test("is a type error", () => { const duration = "fake" as unknown as Duration; const timestamp = "fake" as unknown as Timestamp; // @ts-expect-error TS2322 const duration2: Duration = timestamp; // @ts-expect-error TS2322 const timestamp2: Timestamp = duration; - expect(duration2).toBeDefined(); - expect(timestamp2).toBeDefined(); + assert.ok(duration2); + assert.ok(timestamp2); }); }); - describe("narrow down from message shape union", () => { + void suite("narrow down from message shape union", () => { const msg = create(UserSchema) as unknown as Proto3Message | User; - test("can switch on Message.$typeName against literal string type", () => { + void test("can switch on Message.$typeName against literal string type", () => { switch (msg.$typeName) { case "example.User": - expect(msg.firstName).toBeDefined(); + assert.ok(msg.firstName !== undefined); break; default: throw new Error(); } }); - test("can switch on Message.$typeName against embedded desc's typeName", () => { + void test("can switch on Message.$typeName against embedded desc's typeName", () => { switch (msg.$typeName) { case UserSchema.typeName: - expect(msg.firstName).toBeDefined(); + assert.ok(msg.firstName !== undefined); break; default: throw new Error(); @@ -83,33 +84,33 @@ describe("type Message", () => { }); }); -describe("type MessageShape", () => { - test("derives generated shape", () => { +void suite("type MessageShape", () => { + void test("derives generated shape", () => { function t(derived: MessageShape, direct: User) { derived = direct; direct = derived; } - expect(t).toBeDefined(); + assert.ok(t); }); - test("supports codegenv1", () => { + void test("supports codegenv1", () => { type M = Message<"M"> & { v1: true }; function t(derived: MessageShape>, direct: M) { derived = direct; direct = derived; } - expect(t).toBeDefined(); + assert.ok(t); }); - test("derives anonymous shape", () => { + void test("derives anonymous shape", () => { function t(derived: MessageShape, anon: Message) { derived = anon; anon = derived; } - expect(t).toBeDefined(); + assert.ok(t); }); }); -describe("type EnumShape", () => { - test("derives generated shape", () => { +void suite("type EnumShape", () => { + void test("derives generated shape", () => { function t( derived: EnumShape, direct: Proto3Enum, @@ -117,52 +118,52 @@ describe("type EnumShape", () => { derived = direct; direct = derived; } - expect(t).toBeDefined(); + assert.ok(t); }); - test("supports codegenv1", () => { + void test("supports codegenv1", () => { type E = 1; function t(derived: EnumShape>, direct: E) { derived = direct; direct = derived; } - expect(t).toBeDefined(); + assert.ok(t); }); - test("derives anonymous shape", () => { + void test("derives anonymous shape", () => { function t(derived: EnumShape, anon: number) { derived = anon; anon = derived; } - expect(t).toBeDefined(); + assert.ok(t); }); }); -describe("type Extendee", () => { - test("derives generated type info", () => { +void suite("type Extendee", () => { + void test("derives generated type info", () => { function t(derived: Extendee, direct: Proto2Extendee) { derived = direct; direct = derived; } - expect(t).toBeDefined(); + assert.ok(t); }); - test("supports codegenv1", () => { + void test("supports codegenv1", () => { type E = Message<"E"> & { v1: true }; function t(derived: Extendee>, direct: E) { derived = direct; direct = derived; } - expect(t).toBeDefined(); + assert.ok(t); }); - test("derives anonymous type info", () => { + void test("derives anonymous type info", () => { function t(derived: Extendee, anon: Message) { derived = anon; anon = derived; } - expect(t).toBeDefined(); + assert.ok(t); }); }); -describe("type ExtensionValueShape", () => { - test("derives generated type info for singular scalar", () => { +void suite("type ExtensionValueShape", () => { + void test("derives generated type info for singular scalar", () => { function t( derived: ExtensionValueShape, direct: number, @@ -170,17 +171,17 @@ describe("type ExtensionValueShape", () => { derived = direct; direct = derived; } - expect(t).toBeDefined(); + assert.ok(t); }); - test("supports codegenv1", () => { + void test("supports codegenv1", () => { type E = Message<"E"> & { v1: true }; function t(derived: Extendee>, direct: E) { derived = direct; direct = derived; } - expect(t).toBeDefined(); + assert.ok(t); }); - test("derives generated type info for repeated scalar", () => { + void test("derives generated type info for repeated scalar", () => { function t( derived: ExtensionValueShape, direct: string[], @@ -188,7 +189,7 @@ describe("type ExtensionValueShape", () => { derived = direct; direct = derived; } - expect(t).toBeDefined(); + assert.ok(t); }); test("derives generated type info for singular message", () => { function t( @@ -198,7 +199,7 @@ describe("type ExtensionValueShape", () => { derived = direct; direct = derived; } - expect(t).toBeDefined(); + assert.ok(t); }); test("derives generated type info for repeated message", () => { function t( @@ -208,18 +209,18 @@ describe("type ExtensionValueShape", () => { derived = direct; direct = derived; } - expect(t).toBeDefined(); + assert.ok(t); }); test("derives anonymous as unknown", () => { function t(derived: ExtensionValueShape, anon: unknown) { derived = anon; anon = derived; } - expect(t).toBeDefined(); + assert.ok(t); }); }); -describe("type MessageJsonType", () => { +void suite("type MessageJsonType", () => { test("should resolve generated type", () => { function f( derived: MessageJsonType< @@ -230,7 +231,7 @@ describe("type MessageJsonType", () => { direct = derived; return direct; } - expect(f).toBeDefined(); + assert.ok(f); }); test("supports codegenv1", () => { function t( @@ -247,7 +248,7 @@ describe("type MessageJsonType", () => { derived = direct; direct = derived; } - expect(t).toBeDefined(); + assert.ok(t); }); test("should resolve JsonValue without generated type", () => { function f( @@ -260,11 +261,11 @@ describe("type MessageJsonType", () => { derived = direct; return derived; } - expect(f).toBeDefined(); + assert.ok(f); }); }); -describe("type EnumJsonType", () => { +void suite("type EnumJsonType", () => { test("should resolve generated type", () => { function f( derived: EnumJsonType, @@ -274,7 +275,7 @@ describe("type EnumJsonType", () => { derived = direct; return direct; } - expect(f).toBeDefined(); + assert.ok(f); }); test("supports codegenv1", () => { function t( @@ -291,7 +292,7 @@ describe("type EnumJsonType", () => { derived = direct; direct = derived; } - expect(t).toBeDefined(); + assert.ok(t); }); test("should resolve string without generated type", () => { function f( @@ -302,11 +303,11 @@ describe("type EnumJsonType", () => { direct = derived; return derived; } - expect(f).toBeDefined(); + assert.ok(f); }); }); -describe("type MessageValidType", () => { +void suite("type MessageValidType", () => { test("should resolve generated type", () => { function f( derived: MessageValidType, @@ -317,7 +318,7 @@ describe("type MessageValidType", () => { direct = derived; return [direct, str]; } - expect(f).toBeDefined(); + assert.ok(f); }); test("should resolve regular type as fallback", () => { function f( @@ -328,6 +329,6 @@ describe("type MessageValidType", () => { direct = derived; return direct; } - expect(f).toBeDefined(); + assert.ok(f); }); }); diff --git a/packages/protobuf-test/src/valid_types.test.ts b/packages/protobuf-test/src/valid_types.test.ts index 4fa77e1e6..f5e59c721 100644 --- a/packages/protobuf-test/src/valid_types.test.ts +++ b/packages/protobuf-test/src/valid_types.test.ts @@ -12,19 +12,20 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { describe, expect, test } from "@jest/globals"; +import { suite, test } from "node:test"; +import * as assert from "node:assert"; import type { VTypes, VTypesValid, } from "./gen/ts,valid_types/extra/valid_types_pb.js"; -describe("Valid types", () => { +void suite("Valid types", () => { test("Valid type is assignable to regular type", () => { function f(vtypes: VTypes, vtypesValid: VTypesValid) { vtypes = vtypesValid; return vtypes; } - expect(f).toBeDefined(); + assert.ok(f); }); test("regular type is not assignable to Valid type", () => { function f(vtypes: VTypes, vtypesValid: VTypesValid) { @@ -32,13 +33,13 @@ describe("Valid types", () => { vtypesValid = vtypes; return vtypesValid; } - expect(f).toBeDefined(); + assert.ok(f); }); test("regular type is not assignable to Valid type", () => { function f(vtypesValid: VTypesValid) { const str: string = vtypesValid.requiredMsg.$typeName; return str; } - expect(f).toBeDefined(); + assert.ok(f); }); }); From 0507ba9d5d5680db2904a3fb12ced9ea7089b460 Mon Sep 17 00:00:00 2001 From: Timo Stamm Date: Mon, 18 Aug 2025 19:17:41 +0200 Subject: [PATCH 09/16] npm run format --- packages/protobuf-test/src/binary.test.ts | 4 +- packages/protobuf-test/src/clone.test.ts | 114 ++++++++--- packages/protobuf-test/src/create.test.ts | 121 +++++++++--- .../src/edition2023-serialize.test.ts | 6 +- .../src/enum-open-closed.test.ts | 6 +- packages/protobuf-test/src/equals.test.ts | 16 +- packages/protobuf-test/src/extensions.test.ts | 88 ++++++--- packages/protobuf-test/src/fields.test.ts | 3 +- .../protobuf-test/src/generate-code.test.ts | 37 ++-- packages/protobuf-test/src/json.test.ts | 181 +++++++++++------- packages/protobuf-test/src/json_types.test.ts | 11 +- packages/protobuf-test/src/merge.test.ts | 23 ++- packages/protobuf-test/src/options.test.ts | 48 +++-- .../protobuf-test/src/proto-int64.test.ts | 19 +- .../protobuf-test/src/reflect/error.test.ts | 12 +- .../protobuf-test/src/reflect/names.test.ts | 21 +- .../src/reflect/nested-types.test.ts | 21 +- .../protobuf-test/src/reflect/path.test.ts | 12 +- .../src/reflect/reflect-list.test.ts | 10 +- .../src/reflect/reflect-map.test.ts | 10 +- .../protobuf-test/src/reflect/reflect.test.ts | 55 ++++-- packages/protobuf-test/src/registry.test.ts | 97 ++++++---- .../src/serialization-errors.test.ts | 38 ++-- packages/protobuf-test/src/types.test.ts | 27 +-- .../src/wire/base64-encoding.test.ts | 27 ++- .../src/wire/binary-encoding.test.ts | 99 +++++----- .../src/wire/size-delimited.test.ts | 2 +- .../src/wire/text-encoding.test.ts | 6 +- .../protobuf-test/src/wkt/timestamp.test.ts | 12 +- 29 files changed, 732 insertions(+), 394 deletions(-) diff --git a/packages/protobuf-test/src/binary.test.ts b/packages/protobuf-test/src/binary.test.ts index dee564cb2..c4f2d8891 100644 --- a/packages/protobuf-test/src/binary.test.ts +++ b/packages/protobuf-test/src/binary.test.ts @@ -44,7 +44,6 @@ import { OneofMessageSchema } from "./gen/ts/extra/msg-oneof_pb.js"; import { JsonNamesMessageSchema } from "./gen/ts/extra/msg-json-names_pb.js"; import { JSTypeProto2NormalMessageSchema } from "./gen/ts/extra/jstype-proto2_pb.js"; - void suite(`binary serialization`, () => { testBinary(ScalarValuesMessageSchema, { doubleField: 0.75, @@ -207,7 +206,8 @@ void suite(`binary serialization`, () => { }); assert.throws(() => toBinary(ScalarValuesMessageSchema, msg), { name: "Error", - message: "cannot encode field spec.ScalarValuesMessage.uint32_field to binary: invalid uint32: -1", + message: + "cannot encode field spec.ScalarValuesMessage.uint32_field to binary: invalid uint32: -1", }); }); }); diff --git a/packages/protobuf-test/src/clone.test.ts b/packages/protobuf-test/src/clone.test.ts index d1f14b91d..8701c1eba 100644 --- a/packages/protobuf-test/src/clone.test.ts +++ b/packages/protobuf-test/src/clone.test.ts @@ -36,11 +36,13 @@ void suite("clone()", () => { { no: 10100, wireType: WireType.Varint, data: new Uint8Array([0]) }, ]; const copy = clone(proto3_ts.Proto3MessageSchema, msg); - assert.deepStrictEqual(copy.singularMessageField?.$unknown, + assert.deepStrictEqual( + copy.singularMessageField?.$unknown, msg.singularMessageField.$unknown, ); // Make sure it is copy - assert.notStrictEqual(copy.singularMessageField?.$unknown, + assert.notStrictEqual( + copy.singularMessageField?.$unknown, msg.singularMessageField.$unknown, ); }); @@ -94,15 +96,23 @@ void suite("clone()", () => { }); void test("singularMessageField", () => { const copy = clone(desc, msg); - assert.notStrictEqual(copy.singularMessageField, msg.singularMessageField); - assert.deepStrictEqual(copy.singularMessageField, msg.singularMessageField); + assert.notStrictEqual( + copy.singularMessageField, + msg.singularMessageField, + ); + assert.deepStrictEqual( + copy.singularMessageField, + msg.singularMessageField, + ); }); void test("optionalWrappedUint32Field", () => { const copy = clone(desc, msg); - assert.strictEqual(copy.optionalWrappedUint32Field, + assert.strictEqual( + copy.optionalWrappedUint32Field, msg.optionalWrappedUint32Field, ); - assert.deepStrictEqual(copy.optionalWrappedUint32Field, + assert.deepStrictEqual( + copy.optionalWrappedUint32Field, msg.optionalWrappedUint32Field, ); }); @@ -113,34 +123,52 @@ void suite("clone()", () => { }); void test("repeatedMessageField", () => { const copy = clone(desc, msg); - assert.notStrictEqual(copy.repeatedMessageField, msg.repeatedMessageField); + assert.notStrictEqual( + copy.repeatedMessageField, + msg.repeatedMessageField, + ); assert.strictEqual(copy.repeatedMessageField.length, 2); - assert.notStrictEqual(copy.repeatedMessageField[0], + assert.notStrictEqual( + copy.repeatedMessageField[0], msg.repeatedMessageField[0], ); - assert.deepStrictEqual(copy.repeatedMessageField[0], + assert.deepStrictEqual( + copy.repeatedMessageField[0], msg.repeatedMessageField[0], ); - assert.notStrictEqual(copy.repeatedMessageField[1], + assert.notStrictEqual( + copy.repeatedMessageField[1], msg.repeatedMessageField[1], ); - assert.deepStrictEqual(copy.repeatedMessageField[1], + assert.deepStrictEqual( + copy.repeatedMessageField[1], msg.repeatedMessageField[1], ); }); void test("mapStringStringField", () => { const copy = clone(desc, msg); - assert.notStrictEqual(copy.mapStringStringField, msg.mapStringStringField); - assert.deepStrictEqual(copy.mapStringStringField, msg.mapStringStringField); + assert.notStrictEqual( + copy.mapStringStringField, + msg.mapStringStringField, + ); + assert.deepStrictEqual( + copy.mapStringStringField, + msg.mapStringStringField, + ); }); void test("mapInt32MessageField", () => { const copy = clone(desc, msg); - assert.notStrictEqual(copy.mapInt32MessageField, msg.mapInt32MessageField); + assert.notStrictEqual( + copy.mapInt32MessageField, + msg.mapInt32MessageField, + ); assert.deepStrictEqual(Object.keys(copy), Object.keys(msg)); - assert.notStrictEqual(copy.mapInt32MessageField[123], + assert.notStrictEqual( + copy.mapInt32MessageField[123], msg.mapInt32MessageField[123], ); - assert.deepStrictEqual(copy.mapInt32MessageField[123], + assert.deepStrictEqual( + copy.mapInt32MessageField[123], msg.mapInt32MessageField[123], ); }); @@ -236,15 +264,23 @@ void suite("clone()", () => { }); void test("requiredMessageField", () => { const copy = clone(desc, msg); - assert.notStrictEqual(copy.requiredMessageField, msg.requiredMessageField); - assert.deepStrictEqual(copy.requiredMessageField, msg.requiredMessageField); + assert.notStrictEqual( + copy.requiredMessageField, + msg.requiredMessageField, + ); + assert.deepStrictEqual( + copy.requiredMessageField, + msg.requiredMessageField, + ); }); void test("optionalWrappedUint32Field", () => { const copy = clone(desc, msg); - assert.strictEqual(copy.optionalWrappedUint32Field, + assert.strictEqual( + copy.optionalWrappedUint32Field, msg.optionalWrappedUint32Field, ); - assert.deepStrictEqual(copy.optionalWrappedUint32Field, + assert.deepStrictEqual( + copy.optionalWrappedUint32Field, msg.optionalWrappedUint32Field, ); }); @@ -255,34 +291,52 @@ void suite("clone()", () => { }); void test("repeatedMessageField", () => { const copy = clone(desc, msg); - assert.notStrictEqual(copy.repeatedMessageField, msg.repeatedMessageField); + assert.notStrictEqual( + copy.repeatedMessageField, + msg.repeatedMessageField, + ); assert.strictEqual(copy.repeatedMessageField.length, 2); - assert.notStrictEqual(copy.repeatedMessageField[0], + assert.notStrictEqual( + copy.repeatedMessageField[0], msg.repeatedMessageField[0], ); - assert.deepStrictEqual(copy.repeatedMessageField[0], + assert.deepStrictEqual( + copy.repeatedMessageField[0], msg.repeatedMessageField[0], ); - assert.notStrictEqual(copy.repeatedMessageField[1], + assert.notStrictEqual( + copy.repeatedMessageField[1], msg.repeatedMessageField[1], ); - assert.deepStrictEqual(copy.repeatedMessageField[1], + assert.deepStrictEqual( + copy.repeatedMessageField[1], msg.repeatedMessageField[1], ); }); void test("mapStringStringField", () => { const copy = clone(desc, msg); - assert.notStrictEqual(copy.mapStringStringField, msg.mapStringStringField); - assert.deepStrictEqual(copy.mapStringStringField, msg.mapStringStringField); + assert.notStrictEqual( + copy.mapStringStringField, + msg.mapStringStringField, + ); + assert.deepStrictEqual( + copy.mapStringStringField, + msg.mapStringStringField, + ); }); void test("mapInt32MessageField", () => { const copy = clone(desc, msg); - assert.notStrictEqual(copy.mapInt32MessageField, msg.mapInt32MessageField); + assert.notStrictEqual( + copy.mapInt32MessageField, + msg.mapInt32MessageField, + ); assert.deepStrictEqual(Object.keys(copy).sort(), Object.keys(msg).sort()); - assert.notStrictEqual(copy.mapInt32MessageField[123], + assert.notStrictEqual( + copy.mapInt32MessageField[123], msg.mapInt32MessageField[123], ); - assert.deepStrictEqual(copy.mapInt32MessageField[123], + assert.deepStrictEqual( + copy.mapInt32MessageField[123], msg.mapInt32MessageField[123], ); }); diff --git a/packages/protobuf-test/src/create.test.ts b/packages/protobuf-test/src/create.test.ts index 0bed909a3..918e5fd6b 100644 --- a/packages/protobuf-test/src/create.test.ts +++ b/packages/protobuf-test/src/create.test.ts @@ -85,7 +85,10 @@ void suite("create()", () => { assert.strictEqual(hasOwn("singularFloatField"), true); assert.strictEqual(msg.singularBoolField, false); assert.strictEqual(hasOwn("singularBoolField"), true); - assert.strictEqual(msg.singularEnumField, proto3_ts.Proto3Enum.UNSPECIFIED); + assert.strictEqual( + msg.singularEnumField, + proto3_ts.Proto3Enum.UNSPECIFIED, + ); assert.strictEqual(hasOwn("singularEnumField"), true); assert.strictEqual(msg.singularMessageField, undefined); assert.strictEqual(hasOwn("singularMessageField"), false); @@ -211,13 +214,20 @@ void suite("create()", () => { assert.strictEqual(hasOwn("requiredInt32Field"), false); assert.strictEqual(msg.requiredDefaultInt32Field, 128); assert.strictEqual(hasOwn("requiredInt64Field"), false); - assert.strictEqual(msg.requiredDefaultInt64Field, protoInt64.parse(-256)); + assert.strictEqual( + msg.requiredDefaultInt64Field, + protoInt64.parse(-256), + ); assert.strictEqual(hasOwn("requiredInt64Field"), false); - assert.strictEqual(msg.requiredDefaultInt64JsNumberField, + assert.strictEqual( + msg.requiredDefaultInt64JsNumberField, protoInt64.parse(-256), ); assert.strictEqual(hasOwn("requiredDefaultInt64JsNumberField"), false); - assert.strictEqual(typeof msg.requiredDefaultInt64JsStringField, "string"); + assert.strictEqual( + typeof msg.requiredDefaultInt64JsStringField, + "string", + ); assert.strictEqual(msg.requiredDefaultInt64JsStringField, "-256"); assert.strictEqual(hasOwn("requiredDefaultInt64JsStringField"), false); assert.strictEqual(hasOwn("requiredFloatField"), false); @@ -225,7 +235,10 @@ void suite("create()", () => { assert.strictEqual(hasOwn("requiredBoolField"), false); assert.strictEqual(msg.requiredDefaultBoolField, true); assert.strictEqual(hasOwn("requiredEnumField"), false); - assert.strictEqual(msg.requiredDefaultEnumField, proto2_ts.Proto2Enum.YES); + assert.strictEqual( + msg.requiredDefaultEnumField, + proto2_ts.Proto2Enum.YES, + ); assert.strictEqual(hasOwn("requiredDefaultEnumField"), false); assert.strictEqual(msg.requiredDefaultMessageField, undefined); assert.strictEqual(hasOwn("requiredDefaultMessageField"), false); @@ -295,9 +308,13 @@ void suite("create()", () => { assert.strictEqual(hasOwn("optionalDefaultBytesField"), false); assert.strictEqual(msg.optionalDefaultInt32Field, 128); assert.strictEqual(hasOwn("optionalDefaultInt32Field"), false); - assert.strictEqual(msg.optionalDefaultInt64Field, protoInt64.parse(-256)); + assert.strictEqual( + msg.optionalDefaultInt64Field, + protoInt64.parse(-256), + ); assert.strictEqual(hasOwn("optionalDefaultInt64Field"), false); - assert.strictEqual(msg.optionalDefaultInt64JsNumberField, + assert.strictEqual( + msg.optionalDefaultInt64JsNumberField, protoInt64.parse(-256), ); assert.strictEqual(hasOwn("optionalDefaultInt64JsNumberField"), false); @@ -307,7 +324,10 @@ void suite("create()", () => { assert.strictEqual(hasOwn("optionalDefaultFloatField"), false); assert.strictEqual(msg.optionalDefaultBoolField, true); assert.strictEqual(hasOwn("optionalDefaultBoolField"), false); - assert.strictEqual(msg.optionalDefaultEnumField, proto2_ts.Proto2Enum.YES); + assert.strictEqual( + msg.optionalDefaultEnumField, + proto2_ts.Proto2Enum.YES, + ); assert.strictEqual(hasOwn("optionalDefaultEnumField"), false); assert.strictEqual(msg.optionalDefaultMessageField, undefined); assert.strictEqual(hasOwn("optionalDefaultMessageField"), false); @@ -370,11 +390,13 @@ void suite("create()", () => { assert.strictEqual(hasOwn("explicitFloatField"), false); assert.strictEqual(msg.explicitBoolField, false); assert.strictEqual(hasOwn("explicitBoolField"), false); - assert.strictEqual(msg.explicitEnumOpenField, + assert.strictEqual( + msg.explicitEnumOpenField, edition2023_ts.Edition2023EnumOpen.UNSPECIFIED, ); assert.strictEqual(hasOwn("explicitEnumOpenField"), false); - assert.strictEqual(msg.explicitEnumClosedField, + assert.strictEqual( + msg.explicitEnumClosedField, edition2023_ts.Edition2023EnumClosed.A, ); assert.strictEqual(hasOwn("explicitEnumClosedField"), false); @@ -404,7 +426,8 @@ void suite("create()", () => { assert.strictEqual(hasOwn("implicitFloatField"), true); assert.strictEqual(msg.implicitBoolField, false); assert.strictEqual(hasOwn("implicitBoolField"), true); - assert.strictEqual(msg.implicitEnumOpenField, + assert.strictEqual( + msg.implicitEnumOpenField, edition2023_ts.Edition2023EnumOpen.UNSPECIFIED, ); assert.strictEqual(hasOwn("implicitEnumOpenField"), true); @@ -428,11 +451,13 @@ void suite("create()", () => { assert.strictEqual(hasOwn("requiredFloatField"), false); assert.strictEqual(msg.requiredBoolField, false); assert.strictEqual(hasOwn("requiredBoolField"), false); - assert.strictEqual(msg.requiredEnumOpenField, + assert.strictEqual( + msg.requiredEnumOpenField, edition2023_ts.Edition2023EnumOpen.UNSPECIFIED, ); assert.strictEqual(hasOwn("requiredEnumOpenField"), false); - assert.strictEqual(msg.requiredEnumClosedField, + assert.strictEqual( + msg.requiredEnumClosedField, edition2023_ts.Edition2023EnumClosed.A, ); assert.strictEqual(hasOwn("requiredEnumClosedField"), false); @@ -452,13 +477,20 @@ void suite("create()", () => { assert.strictEqual(hasOwn("requiredInt32Field"), false); assert.strictEqual(msg.requiredDefaultInt32Field, 128); assert.strictEqual(hasOwn("requiredInt64Field"), false); - assert.strictEqual(msg.requiredDefaultInt64Field, protoInt64.parse(-256)); + assert.strictEqual( + msg.requiredDefaultInt64Field, + protoInt64.parse(-256), + ); assert.strictEqual(hasOwn("requiredInt64Field"), false); - assert.strictEqual(msg.requiredDefaultInt64JsNumberField, + assert.strictEqual( + msg.requiredDefaultInt64JsNumberField, protoInt64.parse(-256), ); assert.strictEqual(hasOwn("requiredDefaultInt64JsNumberField"), false); - assert.strictEqual(typeof msg.requiredDefaultInt64JsStringField, "string"); + assert.strictEqual( + typeof msg.requiredDefaultInt64JsStringField, + "string", + ); assert.strictEqual(msg.requiredDefaultInt64JsStringField, "-256"); assert.strictEqual(hasOwn("requiredDefaultInt64JsStringField"), false); assert.strictEqual(msg.requiredDefaultFloatField, -512.13); @@ -467,11 +499,13 @@ void suite("create()", () => { assert.strictEqual(hasOwn("requiredDefaultFloatField"), false); assert.strictEqual(msg.requiredDefaultBoolField, true); assert.strictEqual(hasOwn("requiredDefaultBoolField"), false); - assert.strictEqual(msg.requiredDefaultEnumOpenField, + assert.strictEqual( + msg.requiredDefaultEnumOpenField, edition2023_ts.Edition2023EnumOpen.A, ); assert.strictEqual(hasOwn("requiredDefaultEnumOpenField"), false); - assert.strictEqual(msg.requiredDefaultEnumClosedField, + assert.strictEqual( + msg.requiredDefaultEnumClosedField, edition2023_ts.Edition2023EnumClosed.A, ); @@ -649,7 +683,7 @@ void suite("create()", () => { const msg = create(desc, init); const r = reflect(desc, msg); assert.strictEqual(r.isSet(field), false); - }) + }); } }); } @@ -670,7 +704,7 @@ void suite("create()", () => { const msg = create(desc, init); const r = reflect(desc, msg); assert.strictEqual(r.isSet(field), false); - }) + }); } }); } @@ -774,8 +808,14 @@ void suite("create()", () => { }); assert.strictEqual(msg.singularBytesField instanceof Uint8Array, true); assert.strictEqual(msg.repeatedBytesField.length, 2); - assert.strictEqual(msg.repeatedBytesField[0] instanceof Uint8Array, true); - assert.strictEqual(msg.repeatedBytesField[1] instanceof Uint8Array, true); + assert.strictEqual( + msg.repeatedBytesField[0] instanceof Uint8Array, + true, + ); + assert.strictEqual( + msg.repeatedBytesField[1] instanceof Uint8Array, + true, + ); assert.strictEqual(msg.either.case, "oneofBytesField"); assert.strictEqual(msg.either.value instanceof Uint8Array, true); }); @@ -802,13 +842,19 @@ void suite("create()", () => { }, }); assert.ok(msg.singularMessageField !== undefined); - assert.strictEqual(msg.singularMessageField?.singularStringField, "str"); + assert.strictEqual( + msg.singularMessageField?.singularStringField, + "str", + ); assert.ok( isMessage(msg.singularMessageField, proto3_ts.Proto3MessageSchema), ); assert.strictEqual(msg.repeatedMessageField.length, 1); - assert.strictEqual(msg.repeatedMessageField[0].singularStringField, "str"); + assert.strictEqual( + msg.repeatedMessageField[0].singularStringField, + "str", + ); assert.ok( isMessage(msg.repeatedMessageField[0], proto3_ts.Proto3MessageSchema), ); @@ -823,7 +869,8 @@ void suite("create()", () => { isMessage( msg.mapInt32MessageField[123], proto3_ts.Proto3MessageSchema, - )); + ), + ); }); test("accepts full message", () => { const testMessageSingular = create(proto3_ts.Proto3MessageSchema); @@ -841,10 +888,19 @@ void suite("create()", () => { 123: testMessageMap, }, }); - assert.strictEqual(msg.singularMessageField === testMessageSingular, true); - assert.strictEqual(msg.repeatedMessageField[0] === testMessageList, true); + assert.strictEqual( + msg.singularMessageField === testMessageSingular, + true, + ); + assert.strictEqual( + msg.repeatedMessageField[0] === testMessageList, + true, + ); assert.strictEqual(msg.either.value === testMessageOneof, true); - assert.strictEqual(msg.mapInt32MessageField[123] === testMessageMap, true); + assert.strictEqual( + msg.mapInt32MessageField[123] === testMessageMap, + true, + ); }); }); void suite("enum field", () => { @@ -910,17 +966,20 @@ void suite("create()", () => { assert.strictEqual(msg.singularWrappedUint32Field, 123); assert.strictEqual(msg.either.case, "oneofWrappedUint32Field"); if (msg.either.case == "oneofWrappedUint32Field") { - assert.strictEqual(msg.either.value.$typeName, + assert.strictEqual( + msg.either.value.$typeName, "google.protobuf.UInt32Value", ); assert.strictEqual(msg.either.value.value, 123); } assert.strictEqual(msg.repeatedWrappedUint32Field.length, 1); - assert.strictEqual(msg.repeatedWrappedUint32Field[0].$typeName, + assert.strictEqual( + msg.repeatedWrappedUint32Field[0].$typeName, "google.protobuf.UInt32Value", ); assert.strictEqual(msg.repeatedWrappedUint32Field[0].value, 123); - assert.strictEqual(msg.mapInt32WrappedUint32Field[123].$typeName, + assert.strictEqual( + msg.mapInt32WrappedUint32Field[123].$typeName, "google.protobuf.UInt32Value", ); assert.strictEqual(msg.mapInt32WrappedUint32Field[123].value, 123); diff --git a/packages/protobuf-test/src/edition2023-serialize.test.ts b/packages/protobuf-test/src/edition2023-serialize.test.ts index dc0a58a0d..f3c338560 100644 --- a/packages/protobuf-test/src/edition2023-serialize.test.ts +++ b/packages/protobuf-test/src/edition2023-serialize.test.ts @@ -53,7 +53,8 @@ void suite("edition2023 serialization", () => { const msgProto2 = fillProto2Message(create(descProto2)); const descEdition = edition2023_ts.Edition2023FromProto2MessageSchema; const msgEdition = fillEditionMessage(create(descEdition)); - assert.deepStrictEqual(toBinary(descEdition, msgEdition), + assert.deepStrictEqual( + toBinary(descEdition, msgEdition), toBinary(descProto2, msgProto2), ); }); @@ -154,7 +155,8 @@ void suite("edition2023 serialization", () => { const msgProto3 = fillProto3Message(create(descProto3)); const descEdition = edition2023_ts.Edition2023FromProto3MessageSchema; const msgEdition = fillEditionMessage(create(descEdition)); - assert.deepStrictEqual(toBinary(descEdition, msgEdition), + assert.deepStrictEqual( + toBinary(descEdition, msgEdition), toBinary(descProto3, msgProto3), ); }); diff --git a/packages/protobuf-test/src/enum-open-closed.test.ts b/packages/protobuf-test/src/enum-open-closed.test.ts index f3fd05cdd..98ada21de 100644 --- a/packages/protobuf-test/src/enum-open-closed.test.ts +++ b/packages/protobuf-test/src/enum-open-closed.test.ts @@ -63,11 +63,13 @@ void suite("closed enum", () => { assert.strictEqual(msg.optionalEnumField, proto2_ts.Proto2Enum.YES); assert.ok(msg.$unknown !== undefined); assert.strictEqual(msg.$unknown?.length, 1); - assert.strictEqual(msg.$unknown?.[0].no, + assert.strictEqual( + msg.$unknown?.[0].no, proto2_ts.Proto2MessageSchema.field.optionalEnumField.number, ); assert.strictEqual(msg.$unknown?.[0].wireType, WireType.Varint); - assert.deepStrictEqual(msg.$unknown?.[0].data, + assert.deepStrictEqual( + msg.$unknown?.[0].data, new BinaryWriter().int32(foreignValue).finish(), ); }); diff --git a/packages/protobuf-test/src/equals.test.ts b/packages/protobuf-test/src/equals.test.ts index 2c7d5fda3..9223f9194 100644 --- a/packages/protobuf-test/src/equals.test.ts +++ b/packages/protobuf-test/src/equals.test.ts @@ -43,9 +43,11 @@ void suite("equals()", () => { const b = a; assert.strictEqual(equals(proto3_ts.Proto3MessageSchema, a, b), true); }); - for (const desc of [proto3_ts.Proto3MessageSchema, + for (const desc of [ + proto3_ts.Proto3MessageSchema, proto2_ts.Proto2MessageSchema, - edition2023_ts.Edition2023MessageSchema,]) { + edition2023_ts.Edition2023MessageSchema, + ]) { void test(`equal zero messages are equal ${desc.typeName}`, () => { const a = create(desc); const b = create(desc); @@ -74,10 +76,12 @@ void suite("equals()", () => { test("different message types are not equal", () => { const a = create(proto3_ts.Proto3MessageSchema); const b = create(UserSchema); - assert.strictEqual(equals(proto3_ts.Proto3MessageSchema as DescMessage, a, b), + assert.strictEqual( + equals(proto3_ts.Proto3MessageSchema as DescMessage, a, b), false, ); - assert.strictEqual(equals(proto3_ts.Proto3MessageSchema as DescMessage, b, b), + assert.strictEqual( + equals(proto3_ts.Proto3MessageSchema as DescMessage, b, b), false, ); }); @@ -115,7 +119,7 @@ void suite("equals()", () => { beforeEach(() => { b = fillProto3Message(create(desc)); }); - for (const f of desc.fields.filter(f => reflect(desc, a).isSet(f))) { + for (const f of desc.fields.filter((f) => reflect(desc, a).isSet(f))) { void test(`${f.name}`, () => { reflect(desc, b).clear(f); assert.strictEqual(reflect(desc, b).isSet(f), false); @@ -131,7 +135,7 @@ void suite("equals()", () => { beforeEach(() => { b = fillEdition2023Message(create(desc)); }); - for (const f of desc.fields.filter(f => reflect(desc, a).isSet(f))) { + for (const f of desc.fields.filter((f) => reflect(desc, a).isSet(f))) { void test(`${f.name}`, () => { reflect(desc, b).clear(f); assert.strictEqual(reflect(desc, b).isSet(f), false); diff --git a/packages/protobuf-test/src/extensions.test.ts b/packages/protobuf-test/src/extensions.test.ts index 3aa02ab2a..0636fa35f 100644 --- a/packages/protobuf-test/src/extensions.test.ts +++ b/packages/protobuf-test/src/extensions.test.ts @@ -151,11 +151,12 @@ const goldenValuesZero: extensionWithValueCollection = [ void suite("getExtension()", () => { void test("should throw error if extendee does not match", () => { const msg = create(UserSchema); - assert.throws(() => - getExtension(msg as unknown as Proto2Extendee, uint32_ext), + assert.throws( + () => getExtension(msg as unknown as Proto2Extendee, uint32_ext), { - message: /^extension proto2ext.uint32_ext can only be applied to message proto2ext.Proto2Extendee$/, - } + message: + /^extension proto2ext.uint32_ext can only be applied to message proto2ext.Proto2Extendee$/, + }, ); }); void suite("for scalar", () => { @@ -187,16 +188,24 @@ void suite("getExtension()", () => { assert.strictEqual(getExtension(msg, uint32_ext), 456); }); void test("should return zero value if unset", () => { - assert.strictEqual(getExtension(create(Proto2ExtendeeSchema), string_ext), ""); - assert.strictEqual(getExtension(create(Proto2ExtendeeSchema), uint32_ext), 0); + assert.strictEqual( + getExtension(create(Proto2ExtendeeSchema), string_ext), + "", + ); + assert.strictEqual( + getExtension(create(Proto2ExtendeeSchema), uint32_ext), + 0, + ); }); void test("should return default value if unset", () => { assert.strictEqual( getExtension(create(Proto2ExtendeeSchema), string_ext_with_default), - `hello " */ `); + `hello " */ `, + ); assert.strictEqual( getExtension(create(Proto2ExtendeeSchema), uint32_ext_with_default), - 999); + 999, + ); }); }); void suite("for repeated scalar", () => { @@ -214,7 +223,10 @@ void suite("getExtension()", () => { data: new BinaryWriter().uint32(456).finish(), }, ]; - assert.deepStrictEqual(getExtension(msg, unpacked_uint32_ext), [123, 456]); + assert.deepStrictEqual( + getExtension(msg, unpacked_uint32_ext), + [123, 456], + ); }); void test("should parse from packed unknown field", () => { const msg = create(Proto2ExtendeeSchema); @@ -246,12 +258,16 @@ void suite("getExtension()", () => { data: new BinaryWriter().string("b").finish(), }, ]; - assert.deepStrictEqual(getExtension(msg, repeated_string_ext), ["a", "b"]); + assert.deepStrictEqual(getExtension(msg, repeated_string_ext), [ + "a", + "b", + ]); }); void test("should return zero value if unset", () => { assert.deepStrictEqual( - getExtension(create(Proto2ExtendeeSchema), unpacked_uint32_ext) - , []); + getExtension(create(Proto2ExtendeeSchema), unpacked_uint32_ext), + [], + ); }); }); void suite("for enum", () => { @@ -283,14 +299,16 @@ void suite("getExtension()", () => { assert.strictEqual(getExtension(message, enum_ext), Proto2ExtEnum.NO); }); void test("should return zero value if unset", () => { - assert.strictEqual(getExtension(create(Proto2ExtendeeSchema), enum_ext), + assert.strictEqual( + getExtension(create(Proto2ExtendeeSchema), enum_ext), Proto2ExtEnum.YES, ); }); void test("should return default value if unset", () => { assert.strictEqual( - getExtension(create(Proto2ExtendeeSchema), enum_ext_with_default) - , Proto2ExtEnum.NO); + getExtension(create(Proto2ExtendeeSchema), enum_ext_with_default), + Proto2ExtEnum.NO, + ); }); }); void suite("for repeated enum", () => { @@ -323,8 +341,9 @@ void suite("getExtension()", () => { }); void test("should return zero value if unset", () => { assert.deepStrictEqual( - getExtension(create(Proto2ExtendeeSchema), repeated_enum_ext) - , []); + getExtension(create(Proto2ExtendeeSchema), repeated_enum_ext), + [], + ); }); }); void suite("for message", () => { @@ -544,9 +563,7 @@ void suite("getExtension()", () => { const msg = create(Proto2ExtendeeSchema); const value = getExtension(msg, groupext); assert.ok(isMessage(value, GroupExtSchema)); - assert.ok( - equals(GroupExtSchema, value, create(GroupExtSchema)), - ); + assert.ok(equals(GroupExtSchema, value, create(GroupExtSchema))); }); }); void suite("for repeated group", () => { @@ -654,7 +671,10 @@ void suite("clearExtension()", () => { } }); void test("should clear unknown fields with extension number and leave others untouched", () => { - assert.deepStrictEqual(listUnknownFieldNumbers(msg), [500, 1001, 1001, 1500]); + assert.deepStrictEqual( + listUnknownFieldNumbers(msg), + [500, 1001, 1001, 1500], + ); clearExtension(msg, uint32_ext); assert.deepStrictEqual(listUnknownFieldNumbers(msg), [500, 1500]); clearExtension(msg, uint32_ext); @@ -662,22 +682,28 @@ void suite("clearExtension()", () => { }); void test("should throw error if extendee does not match", () => { const msg = create(UserSchema); - assert.throws(() => - clearExtension(msg as unknown as Proto2Extendee, uint32_ext), { - message: /^extension proto2ext.uint32_ext can only be applied to message proto2ext.Proto2Extendee$/, - }); + assert.throws( + () => clearExtension(msg as unknown as Proto2Extendee, uint32_ext), + { + message: + /^extension proto2ext.uint32_ext can only be applied to message proto2ext.Proto2Extendee$/, + }, + ); }); }); void suite("setExtension()", () => { void test("should throw error if extendee does not match", () => { const msg = create(UserSchema); - assert.throws(() => - setExtension(msg as unknown as Proto2Extendee, uint32_ext, 123), { - message: /^extension proto2ext.uint32_ext can only be applied to message proto2ext.Proto2Extendee$/, - }); + assert.throws( + () => setExtension(msg as unknown as Proto2Extendee, uint32_ext, 123), + { + message: + /^extension proto2ext.uint32_ext can only be applied to message proto2ext.Proto2Extendee$/, + }, + ); }); - for (const {ext, val} of goldenValues) { + for (const { ext, val } of goldenValues) { void test(`should set ${ext.typeName} as expected`, () => { const msg = create(Proto2ExtendeeSchema); assert.strictEqual(hasExtension(msg, ext), false); @@ -686,7 +712,7 @@ void suite("setExtension()", () => { assert.deepStrictEqual(getExtension(msg, ext), val); }); } - for (const {ext, val} of goldenValuesZero) { + for (const { ext, val } of goldenValuesZero) { void test(`should set zero ${ext.typeName} as expected`, () => { const msg = create(Proto2ExtendeeSchema); assert.strictEqual(hasExtension(msg, ext), false); diff --git a/packages/protobuf-test/src/fields.test.ts b/packages/protobuf-test/src/fields.test.ts index 45519dd42..53a7754c8 100644 --- a/packages/protobuf-test/src/fields.test.ts +++ b/packages/protobuf-test/src/fields.test.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import {beforeEach, suite, test } from "node:test"; +import { beforeEach, suite, test } from "node:test"; import * as assert from "node:assert"; import { clearField, create, isFieldSet } from "@bufbuild/protobuf"; import * as proto3_ts from "./gen/ts/extra/proto3_pb.js"; @@ -85,7 +85,6 @@ void suite("isFieldSet()", () => { fillProto2Message(msg); const set = isFieldSet(msg, desc.field[name]); assert.strictEqual(set, true); - }); } }); diff --git a/packages/protobuf-test/src/generate-code.test.ts b/packages/protobuf-test/src/generate-code.test.ts index a4404f8c9..201827321 100644 --- a/packages/protobuf-test/src/generate-code.test.ts +++ b/packages/protobuf-test/src/generate-code.test.ts @@ -46,33 +46,38 @@ test("source retention options are unavailable in generated code", () => { assert.strictEqual( !!fileOptions && hasExtension(fileOptions, options_ts.file_option_retention_source), - false); + false, + ); const messageOptions = option_usage_ts.MessageWithOptionsSchema.proto.options; assert.strictEqual( !!messageOptions && hasExtension(messageOptions, options_ts.message_option_retention_source), - false); + false, + ); const fieldOptions = option_usage_ts.MessageWithOptionsSchema.fields[0].proto.options; assert.strictEqual( !!fieldOptions && hasExtension(fieldOptions, options_ts.field_option_retention_source), - false); + false, + ); const oneofOptions = option_usage_ts.MessageWithOptionsSchema.oneofs[0].proto.options; assert.strictEqual( !!oneofOptions && hasExtension(oneofOptions, options_ts.oneof_option_retention_source), - false); + false, + ); const enumOptions = option_usage_ts.EnumWithOptionsSchema.proto.options; assert.strictEqual( !!enumOptions && hasExtension(enumOptions, options_ts.enum_option_retention_source), - false); + false, + ); const enumValueOptions = option_usage_ts.EnumWithOptionsSchema.values[0].proto.options; @@ -82,20 +87,23 @@ test("source retention options are unavailable in generated code", () => { enumValueOptions, options_ts.enum_value_option_retention_source, ), - false); + false, + ); const serviceOptions = option_usage_ts.ServiceWithOptions.proto.options; assert.strictEqual( !!serviceOptions && hasExtension(serviceOptions, options_ts.service_option_retention_source), - false); + false, + ); const methodOptions = option_usage_ts.ServiceWithOptions.methods[0].proto.options; assert.strictEqual( !!methodOptions && hasExtension(methodOptions, options_ts.method_option_retention_source), - false); + false, + ); }); void suite("JSON types", () => { @@ -258,24 +266,25 @@ test("service generates as expected", () => { void suite("ts generated code is equal to js generated code", () => { void test("proto2", () => { - assert.deepStrictEqual(toPlain(proto2_ts),toPlain(proto2_js)); + assert.deepStrictEqual(toPlain(proto2_ts), toPlain(proto2_js)); }); test("proto3", () => { - assert.deepStrictEqual(toPlain(proto3_ts),toPlain(proto3_js)); + assert.deepStrictEqual(toPlain(proto3_ts), toPlain(proto3_js)); }); test("edition2023", () => { - assert.deepStrictEqual(toPlain(edition2023_ts),toPlain(edition2023_js)); + assert.deepStrictEqual(toPlain(edition2023_ts), toPlain(edition2023_js)); }); test("nameclash", () => { - assert.deepStrictEqual(toPlain(nameclash_ts),toPlain(nameclash_js)); + assert.deepStrictEqual(toPlain(nameclash_ts), toPlain(nameclash_js)); }); test("test_messages_proto3", () => { - assert.deepStrictEqual(toPlain(test_messages_proto3_ts), + assert.deepStrictEqual( + toPlain(test_messages_proto3_ts), toPlain(test_messages_proto3_js), ); }); test("service", () => { - assert.deepStrictEqual(toPlain(service_ts),toPlain(service_js)); + assert.deepStrictEqual(toPlain(service_ts), toPlain(service_js)); }); /** diff --git a/packages/protobuf-test/src/json.test.ts b/packages/protobuf-test/src/json.test.ts index 8e848d28b..978e927b1 100644 --- a/packages/protobuf-test/src/json.test.ts +++ b/packages/protobuf-test/src/json.test.ts @@ -323,12 +323,13 @@ void suite("JSON serialization", () => { toJson(AnySchema, any, { registry: createRegistry(ValueSchema, StructSchema), }), - { - "@type": "type.googleapis.com/google.protobuf.Value", - value: { - foo: 1, + { + "@type": "type.googleapis.com/google.protobuf.Value", + value: { + foo: 1, + }, }, - }); + ); }); test(`encodes ${StructSchema.typeName} to JSON`, () => { const str = anyPack( @@ -488,19 +489,27 @@ void suite("JSON serialization", () => { const fieldMask = create(FieldMaskSchema, { paths: ["user.displayName", "photo"], }); - assert.throws(() => { - toJson(FieldMaskSchema, fieldMask); - }, { - message: 'cannot encode message google.protobuf.FieldMask to JSON: lowerCamelCase of path name "user.displayName" is irreversible', - }); + assert.throws( + () => { + toJson(FieldMaskSchema, fieldMask); + }, + { + message: + 'cannot encode message google.protobuf.FieldMask to JSON: lowerCamelCase of path name "user.displayName" is irreversible', + }, + ); }); void test("fromJson fails on invalid json", () => { const json = "user.display_name,photo"; - assert.throws(() => { - fromJson(FieldMaskSchema, json); - }, { - message: "cannot decode message google.protobuf.FieldMask from JSON: path names must be lowerCamelCase", - }); + assert.throws( + () => { + fromJson(FieldMaskSchema, json); + }, + { + message: + "cannot decode message google.protobuf.FieldMask from JSON: path names must be lowerCamelCase", + }, + ); }); }); testJson( @@ -526,45 +535,57 @@ void suite("JSON serialization", () => { // See struct.proto const value = create(ValueSchema); assert.throws(() => toJson(ValueSchema, value), { - message: "google.protobuf.Value must have a value", + message: "google.protobuf.Value must have a value", }); }); void test("numberValue must be finite", () => { - assert.throws(() => { - toJson( - ValueSchema, - create(ValueSchema, { - kind: { case: "numberValue", value: NaN }, - }), - ); - }, {message: "google.protobuf.Value cannot be NaN or Infinity"}); + assert.throws( + () => { + toJson( + ValueSchema, + create(ValueSchema, { + kind: { case: "numberValue", value: NaN }, + }), + ); + }, + { message: "google.protobuf.Value cannot be NaN or Infinity" }, + ); - assert.throws(() => { - toJson( - ValueSchema, - create(ValueSchema, { - kind: { case: "numberValue", value: Infinity }, - }), - ); - }, {message: "google.protobuf.Value cannot be NaN or Infinity"}); + assert.throws( + () => { + toJson( + ValueSchema, + create(ValueSchema, { + kind: { case: "numberValue", value: Infinity }, + }), + ); + }, + { message: "google.protobuf.Value cannot be NaN or Infinity" }, + ); - assert.throws(() => { - toJson( - ValueSchema, - create(ValueSchema, { - kind: { case: "numberValue", value: Number.POSITIVE_INFINITY }, - }), - ); - }, {message: "google.protobuf.Value cannot be NaN or Infinity"}); + assert.throws( + () => { + toJson( + ValueSchema, + create(ValueSchema, { + kind: { case: "numberValue", value: Number.POSITIVE_INFINITY }, + }), + ); + }, + { message: "google.protobuf.Value cannot be NaN or Infinity" }, + ); - assert.throws(() => { - toJson( - ValueSchema, - create(ValueSchema, { - kind: { case: "numberValue", value: Number.NEGATIVE_INFINITY }, - }), - ); - }, {message: "google.protobuf.Value cannot be NaN or Infinity"}); + assert.throws( + () => { + toJson( + ValueSchema, + create(ValueSchema, { + kind: { case: "numberValue", value: Number.NEGATIVE_INFINITY }, + }), + ); + }, + { message: "google.protobuf.Value cannot be NaN or Infinity" }, + ); }); void suite("Value with Struct field", () => { testJson( @@ -841,17 +862,20 @@ void suite("JsonWriteOptions", () => { void suite("JSON parse errors", () => { test("fromJsonString() with invalid JSON", () => { assert.throws(() => fromJsonString(TestAllTypesProto3Schema, "}"), { - message: /^cannot decode message protobuf_test_messages.proto3.TestAllTypesProto3 from JSON: Unexpected token .*/, - }) + message: + /^cannot decode message protobuf_test_messages.proto3.TestAllTypesProto3 from JSON: Unexpected token .*/, + }); }); test("mergeFromJsonString() with invalid JSON", () => { const target = create(TestAllTypesProto3Schema); - assert.throws(() => - mergeFromJsonString(TestAllTypesProto3Schema, target, "}"), - { - message: /^cannot decode message protobuf_test_messages.proto3.TestAllTypesProto3 from JSON: Unexpected token .*/, - }); + assert.throws( + () => mergeFromJsonString(TestAllTypesProto3Schema, target, "}"), + { + message: + /^cannot decode message protobuf_test_messages.proto3.TestAllTypesProto3 from JSON: Unexpected token .*/, + }, + ); }); test("unknown field", () => { @@ -863,31 +887,40 @@ void suite("JSON parse errors", () => { void suite("Any", () => { test("without @type", () => { - assert.throws(() => - fromJson(AnySchema, { - value: 123, - }), + assert.throws( + () => + fromJson(AnySchema, { + value: 123, + }), { - message: /^cannot decode message google.protobuf.Any from JSON: "@type" is empty/, - }); + message: + /^cannot decode message google.protobuf.Any from JSON: "@type" is empty/, + }, + ); }); test("with blank @type", () => { - assert.throws(() => - fromJson(AnySchema, { - "@type": "", - }), + assert.throws( + () => + fromJson(AnySchema, { + "@type": "", + }), { - message: /^cannot decode message google.protobuf.Any from JSON: "@type" is empty/, - }); + message: + /^cannot decode message google.protobuf.Any from JSON: "@type" is empty/, + }, + ); }); test("with invalid type url in @type", () => { - assert.throws(() => - fromJson(AnySchema, { - "@type": "/", - }), - { - message: /^cannot decode message google.protobuf.Any from JSON: "@type" is invalid/, - }); + assert.throws( + () => + fromJson(AnySchema, { + "@type": "/", + }), + { + message: + /^cannot decode message google.protobuf.Any from JSON: "@type" is invalid/, + }, + ); }); }); diff --git a/packages/protobuf-test/src/json_types.test.ts b/packages/protobuf-test/src/json_types.test.ts index 74fab8742..cafc4e63a 100644 --- a/packages/protobuf-test/src/json_types.test.ts +++ b/packages/protobuf-test/src/json_types.test.ts @@ -356,10 +356,13 @@ void suite("JSON types", () => { assert.strictEqual(e, NullValue.NULL_VALUE); }); test("raises error on unknown string", () => { - assert.throws(() => { - // @ts-expect-error TS2345 - enumFromJson(json_types_ts_json.JsonTypeEnumSchema, "FOO"); - }, {message: /cannot decode enum spec.JsonTypeEnum from JSON: "FOO"/}); + assert.throws( + () => { + // @ts-expect-error TS2345 + enumFromJson(json_types_ts_json.JsonTypeEnumSchema, "FOO"); + }, + { message: /cannot decode enum spec.JsonTypeEnum from JSON: "FOO"/ }, + ); }); }); void suite("isEnumJson()", () => { diff --git a/packages/protobuf-test/src/merge.test.ts b/packages/protobuf-test/src/merge.test.ts index 970629879..98e20a9ae 100644 --- a/packages/protobuf-test/src/merge.test.ts +++ b/packages/protobuf-test/src/merge.test.ts @@ -49,10 +49,12 @@ void suite("merge()", () => { // replaces existing fields assert.strictEqual(target.singularMessageField?.singularStringField, "abc"); assert.strictEqual(target.singularMessageField?.optionalStringField, "abc"); - assert.strictEqual(target.singularMessageField?.singularBytesField, + assert.strictEqual( + target.singularMessageField?.singularBytesField, source.singularMessageField?.singularBytesField, ); // bytes field is copied by reference - assert.strictEqual(target.singularMessageField?.singularEnumField, + assert.strictEqual( + target.singularMessageField?.singularEnumField, proto3_ts.Proto3Enum.YES, ); }); @@ -106,13 +108,20 @@ void suite("merge()", () => { }); const targetSingularMessageField = target.singularMessageField; merge(proto3_ts.Proto3MessageSchema, target, source); - assert.strictEqual(target.optionalMessageField, source.optionalMessageField); // message field is copied by reference - assert.notStrictEqual(target.singularMessageField, source.singularMessageField); + assert.strictEqual( + target.optionalMessageField, + source.optionalMessageField, + ); // message field is copied by reference + assert.notStrictEqual( + target.singularMessageField, + source.singularMessageField, + ); assert.strictEqual(target.singularMessageField, targetSingularMessageField); // target message field reference is maintained assert.strictEqual(target.singularMessageField?.singularStringField, "DEF"); - assert.deepStrictEqual(target.singularMessageField?.repeatedInt32Field, [ - 1, 2, - ]); + assert.deepStrictEqual( + target.singularMessageField?.repeatedInt32Field, + [1, 2], + ); }); test("adds unknown fields to target", () => { const target = create(proto3_ts.Proto3MessageSchema); diff --git a/packages/protobuf-test/src/options.test.ts b/packages/protobuf-test/src/options.test.ts index 9f92faece..2b3cfbd43 100644 --- a/packages/protobuf-test/src/options.test.ts +++ b/packages/protobuf-test/src/options.test.ts @@ -85,66 +85,82 @@ void suite("getOption()", () => { }); void test("returns option", () => { const file = file_extra_option_usage; - assert.strictEqual(getOption(file, file_option_retention_unknown), + assert.strictEqual( + getOption(file, file_option_retention_unknown), "file option retention unknown", ); - assert.strictEqual(getOption(file, file_option_retention_runtime), + assert.strictEqual( + getOption(file, file_option_retention_runtime), "file option retention runtime", ); const message = MessageWithOptionsSchema; - assert.strictEqual(getOption(message, message_option_retention_unknown), + assert.strictEqual( + getOption(message, message_option_retention_unknown), "message option retention unknown", ); - assert.strictEqual(getOption(message, message_option_retention_runtime), + assert.strictEqual( + getOption(message, message_option_retention_runtime), "message option retention runtime", ); const field = MessageWithOptionsSchema.fields[0]; - assert.strictEqual(getOption(field, field_option_retention_unknown), + assert.strictEqual( + getOption(field, field_option_retention_unknown), "field option retention unknown", ); - assert.strictEqual(getOption(field, field_option_retention_runtime), + assert.strictEqual( + getOption(field, field_option_retention_runtime), "field option retention runtime", ); const oneof = MessageWithOptionsSchema.oneofs[0]; - assert.strictEqual(getOption(oneof, oneof_option_retention_unknown), + assert.strictEqual( + getOption(oneof, oneof_option_retention_unknown), "oneof option retention unknown", ); - assert.strictEqual(getOption(oneof, oneof_option_retention_runtime), + assert.strictEqual( + getOption(oneof, oneof_option_retention_runtime), "oneof option retention runtime", ); const enumeration = EnumWithOptionsSchema; - assert.strictEqual(getOption(enumeration, enum_option_retention_unknown), + assert.strictEqual( + getOption(enumeration, enum_option_retention_unknown), "enum option retention unknown", ); - assert.strictEqual(getOption(enumeration, enum_option_retention_runtime), + assert.strictEqual( + getOption(enumeration, enum_option_retention_runtime), "enum option retention runtime", ); const enumValue = EnumWithOptionsSchema.values[0]; - assert.strictEqual(getOption(enumValue, enum_value_option_retention_unknown), + assert.strictEqual( + getOption(enumValue, enum_value_option_retention_unknown), "enum value option retention unknown", ); - assert.strictEqual(getOption(enumValue, enum_value_option_retention_runtime), + assert.strictEqual( + getOption(enumValue, enum_value_option_retention_runtime), "enum value option retention runtime", ); const service = ServiceWithOptions; - assert.strictEqual(getOption(service, service_option_retention_unknown), + assert.strictEqual( + getOption(service, service_option_retention_unknown), "service option retention unknown", ); - assert.strictEqual(getOption(service, service_option_retention_runtime), + assert.strictEqual( + getOption(service, service_option_retention_runtime), "service option retention runtime", ); const method = ServiceWithOptions.methods[0]; - assert.strictEqual(getOption(method, method_option_retention_unknown), + assert.strictEqual( + getOption(method, method_option_retention_unknown), "method option retention unknown", ); - assert.strictEqual(getOption(method, method_option_retention_runtime), + assert.strictEqual( + getOption(method, method_option_retention_runtime), "method option retention runtime", ); }); diff --git a/packages/protobuf-test/src/proto-int64.test.ts b/packages/protobuf-test/src/proto-int64.test.ts index 5ada3d573..8c550a077 100644 --- a/packages/protobuf-test/src/proto-int64.test.ts +++ b/packages/protobuf-test/src/proto-int64.test.ts @@ -94,7 +94,10 @@ void suite("npm package 'long'", () => { message.int64Field = protoInt64.dec(longResult.low, longResult.high); // Assuming int64Field contains 9223372036854775807: - assert.strictEqual(message.int64Field, protoInt64.parse("9223372036854775806")); + assert.strictEqual( + message.int64Field, + protoInt64.parse("9223372036854775806"), + ); }); }); }); @@ -219,21 +222,23 @@ void suite("protoInt64", () => { if (protoInt64.supported) { assert.throws(() => protoInt64.uEnc(BigInt(-127)), { message: "invalid uint64: -127", - }); + }); assert.throws(() => protoInt64.uEnc(BigInt("-9007199254740991")), { message: "invalid uint64: -9007199254740991", - }); + }); assert.throws(() => protoInt64.uEnc(BigInt("-9223372036854775808")), { message: "invalid uint64: -9223372036854775808", - }); + }); } - assert.throws(() => protoInt64.uEnc(-127), {message: "invalid uint64: -127"}); + assert.throws(() => protoInt64.uEnc(-127), { + message: "invalid uint64: -127", + }); assert.throws(() => protoInt64.uEnc("-9007199254740991"), { message: "invalid uint64: -9007199254740991", -}); + }); assert.throws(() => protoInt64.uEnc("-9223372036854775808"), { message: "invalid uint64: -9223372036854775808", -}); + }); }); }); diff --git a/packages/protobuf-test/src/reflect/error.test.ts b/packages/protobuf-test/src/reflect/error.test.ts index bf80f0aef..c20cb9953 100644 --- a/packages/protobuf-test/src/reflect/error.test.ts +++ b/packages/protobuf-test/src/reflect/error.test.ts @@ -33,24 +33,28 @@ void suite("FieldError", () => { void suite("isFieldError()", () => { test("returns true for FieldError instances", () => { - assert.strictEqual(isFieldError(new FieldError(UserSchema.fields[0], "foo")), + assert.strictEqual( + isFieldError(new FieldError(UserSchema.fields[0], "foo")), true, ); assert.strictEqual( isFieldError( new FieldError(UserSchema.fields[0], "foo", "FieldValueInvalidError"), ), - true); + true, + ); assert.strictEqual( isFieldError( new FieldError(UserSchema.fields[0], "foo", "FieldListRangeError"), ), - true); + true, + ); assert.strictEqual( isFieldError( new FieldError(UserSchema.fields[0], "foo", "ForeignFieldError"), ), - true); + true, + ); }); test("narrows down to FieldError", () => { const u: unknown = null; diff --git a/packages/protobuf-test/src/reflect/names.test.ts b/packages/protobuf-test/src/reflect/names.test.ts index b7307f1b1..382b77663 100644 --- a/packages/protobuf-test/src/reflect/names.test.ts +++ b/packages/protobuf-test/src/reflect/names.test.ts @@ -67,22 +67,28 @@ service FooService { // foo.bar.FooService assert.strictEqual(qualifiedName(m0.oneofs[0]), "foo.bar.Message.id"); assert.strictEqual(qualifiedName(m0.fields[0]), "foo.bar.Message.name"); assert.strictEqual(qualifiedName(m0.fields[1]), "foo.bar.Message.num"); - assert.strictEqual(qualifiedName(m0.nestedMessages[0]), + assert.strictEqual( + qualifiedName(m0.nestedMessages[0]), "foo.bar.Message.NestedMessage", ); - assert.strictEqual(qualifiedName(m0.nestedMessages[0].nestedExtensions[0]), + assert.strictEqual( + qualifiedName(m0.nestedMessages[0].nestedExtensions[0]), "foo.bar.Message.NestedMessage.fizz", ); - assert.strictEqual(qualifiedName(m0.nestedMessages[0].nestedEnums[0]), + assert.strictEqual( + qualifiedName(m0.nestedMessages[0].nestedEnums[0]), "foo.bar.Message.NestedMessage.Kind", ); - assert.strictEqual(qualifiedName(m0.nestedMessages[0].nestedEnums[0].values[0]), + assert.strictEqual( + qualifiedName(m0.nestedMessages[0].nestedEnums[0].values[0]), "foo.bar.Message.NestedMessage.NULL", ); - assert.strictEqual(qualifiedName(m0.nestedMessages[0].nestedEnums[0].values[1]), + assert.strictEqual( + qualifiedName(m0.nestedMessages[0].nestedEnums[0].values[1]), "foo.bar.Message.NestedMessage.PRIMARY", ); - assert.strictEqual(qualifiedName(m0.nestedMessages[0].nestedEnums[0].values[2]), + assert.strictEqual( + qualifiedName(m0.nestedMessages[0].nestedEnums[0].values[2]), "foo.bar.Message.NestedMessage.SECONDARY", ); assert.strictEqual(qualifiedName(m0.fields[2]), "foo.bar.Message.extra"); @@ -116,7 +122,8 @@ void suite("safeObjectProperty", () => { }); void suite("protoCamelCase", () => { - for (const name of [ "foo_bar", + for (const name of [ + "foo_bar", "__proto__", "fieldname1", "field_name2", diff --git a/packages/protobuf-test/src/reflect/nested-types.test.ts b/packages/protobuf-test/src/reflect/nested-types.test.ts index 0b1791fd7..3a96c872a 100644 --- a/packages/protobuf-test/src/reflect/nested-types.test.ts +++ b/packages/protobuf-test/src/reflect/nested-types.test.ts @@ -48,15 +48,18 @@ void suite("nestedTypes()", () => { } `); const nested = Array.from(nestedTypes(file)); - assert.deepStrictEqual(nested.map((d) => d.toString()), [ - "message A", - "message A.B", - "enum A.E", - "extension A.ext", - "enum E", - "service S", - "extension ext", - ]); + assert.deepStrictEqual( + nested.map((d) => d.toString()), + [ + "message A", + "message A.B", + "enum A.E", + "extension A.ext", + "enum E", + "service S", + "extension ext", + ], + ); }); }); diff --git a/packages/protobuf-test/src/reflect/path.test.ts b/packages/protobuf-test/src/reflect/path.test.ts index b5126eb5b..e8955a732 100644 --- a/packages/protobuf-test/src/reflect/path.test.ts +++ b/packages/protobuf-test/src/reflect/path.test.ts @@ -40,13 +40,11 @@ void suite("parsePath()", () => { } for (const { schema, input, error } of invalid) { test(`fails to parse invalid "${input}"`, () => { - assert.throws(() => parsePath(schema, input), - { - name: "InvalidPathError", - message: error, - path: input, - }, - ); + assert.throws(() => parsePath(schema, input), { + name: "InvalidPathError", + message: error, + path: input, + }); }); } }); diff --git a/packages/protobuf-test/src/reflect/reflect-list.test.ts b/packages/protobuf-test/src/reflect/reflect-list.test.ts index 83a353c5c..3b020a46d 100644 --- a/packages/protobuf-test/src/reflect/reflect-list.test.ts +++ b/packages/protobuf-test/src/reflect/reflect-list.test.ts @@ -134,7 +134,10 @@ void suite("ReflectList", () => { const list = reflectList(repeatedMessageField, []); const err = catchFieldError(() => list.add(reflect(UserSchema))); assert.ok(err !== undefined); - assert.match(err.message, /^list item #1: expected ReflectMessage \(spec.Proto3Message\), got ReflectMessage \(example.User\)$/); + assert.match( + err.message, + /^list item #1: expected ReflectMessage \(spec.Proto3Message\), got ReflectMessage \(example.User\)$/, + ); }); test("throws error for invalid scalar", () => { const list = reflectList(repeatedStringField, []); @@ -182,7 +185,10 @@ void suite("ReflectList", () => { const list = reflectList(repeatedMessageField, [null]); const err = catchFieldError(() => list.set(0, reflect(UserSchema))); assert.ok(err !== undefined); - assert.match(err.message, /^list item #1: expected ReflectMessage \(spec.Proto3Message\), got ReflectMessage \(example.User\)$/); + assert.match( + err.message, + /^list item #1: expected ReflectMessage \(spec.Proto3Message\), got ReflectMessage \(example.User\)$/, + ); }); }); void suite("clear()", () => { diff --git a/packages/protobuf-test/src/reflect/reflect-map.test.ts b/packages/protobuf-test/src/reflect/reflect-map.test.ts index ce9fea267..5510e466c 100644 --- a/packages/protobuf-test/src/reflect/reflect-map.test.ts +++ b/packages/protobuf-test/src/reflect/reflect-map.test.ts @@ -215,7 +215,10 @@ void suite("ReflectMap", () => { const map = reflectMap(mapInt32Int32Field, {}); const err = catchFieldError(() => map.set(true, "A")); assert.ok(err !== undefined); - assert.match(err.message, /^invalid map key: expected number \(int32\), got true$/); + assert.match( + err.message, + /^invalid map key: expected number \(int32\), got true$/, + ); }); test("throws error for invalid scalar value", () => { const map = reflectMap(mapStringStringField, {}); @@ -227,7 +230,10 @@ void suite("ReflectMap", () => { const map = reflectMap(mapInt32MessageField, {}); const err = catchFieldError(() => map.set(1, reflect(UserSchema))); assert.ok(err !== undefined); - assert.match(err.message, /^map entry 1: expected ReflectMessage \(spec.Proto3Message\), got ReflectMessage \(example.User\)$/); + assert.match( + err.message, + /^map entry 1: expected ReflectMessage \(spec.Proto3Message\), got ReflectMessage \(example.User\)$/, + ); }); }); void suite("delete()", () => { diff --git a/packages/protobuf-test/src/reflect/reflect.test.ts b/packages/protobuf-test/src/reflect/reflect.test.ts index d12616da3..f5f443d6e 100644 --- a/packages/protobuf-test/src/reflect/reflect.test.ts +++ b/packages/protobuf-test/src/reflect/reflect.test.ts @@ -117,7 +117,8 @@ void suite("ReflectMessage", () => { const foreignOneof = foreignMessage.oneofs[0]; const r = reflect(proto3_ts.Proto3MessageSchema); assert.throws(() => r.oneofCase(foreignOneof), { - message: /^cannot use oneof Foreign.foo with message spec.Proto3Message$/, + message: + /^cannot use oneof Foreign.foo with message spec.Proto3Message$/, }); }); }); @@ -195,10 +196,14 @@ void suite("ReflectMessage", () => { assert.strictEqual(isReflectMessage(r.get(f), StructSchema), true); break; case "list": - assert.strictEqual(isReflectMessage(r.get(f).get(0), StructSchema), true); + assert.strictEqual( + isReflectMessage(r.get(f).get(0), StructSchema), + true, + ); break; case "map": - assert.strictEqual(isReflectMessage(r.get(f).get(123), StructSchema), + assert.strictEqual( + isReflectMessage(r.get(f).get(123), StructSchema), true, ); break; @@ -263,7 +268,8 @@ void suite("ReflectMessage", () => { const foreignField = foreignMessage.fields[0]; assert.ok(foreignField.fieldKind == "scalar"); assert.throws(() => r.get(foreignField), { - message: /^cannot use field Foreign.foreign with message spec.Proto3Message$/, + message: + /^cannot use field Foreign.foreign with message spec.Proto3Message$/, }); }); }); @@ -310,11 +316,20 @@ void suite("ReflectMessage", () => { test("sets number, string, bigint as bigint for 64-bit integer field", () => { const f = desc.field.singularInt64Field; r.set(f, protoInt64.parse(123)); - assert.strictEqual(msg.singularInt64Field === protoInt64.parse(123), true); + assert.strictEqual( + msg.singularInt64Field === protoInt64.parse(123), + true, + ); r.set(f, 123); - assert.strictEqual(msg.singularInt64Field === protoInt64.parse(123), true); + assert.strictEqual( + msg.singularInt64Field === protoInt64.parse(123), + true, + ); r.set(f, "123"); - assert.strictEqual(msg.singularInt64Field === protoInt64.parse(123), true); + assert.strictEqual( + msg.singularInt64Field === protoInt64.parse(123), + true, + ); }); test("sets number, string, bigint as string for 64-bit integer field with jstype=JS_STRING", () => { const f = desc.field.singularInt64JsStringField; @@ -390,14 +405,18 @@ void suite("ReflectMessage", () => { `); const foreignField = foreignMessage.fields[0]; assert.throws(() => r.set(foreignField, "value"), { - message: /^cannot use field Foreign.foreign with message spec.Proto3Message$/, + message: + /^cannot use field Foreign.foreign with message spec.Proto3Message$/, }); }); test("returns error setting number out of range", () => { const f = desc.field.singularInt32Field; const err = catchFieldError(() => r.set(f, Number.MAX_SAFE_INTEGER)); assert.ok(err !== undefined); - assert.match(err.message, /^expected number \(int32\): 9007199254740991 out of range$/); + assert.match( + err.message, + /^expected number \(int32\): 9007199254740991 out of range$/, + ); assert.equal(err.name, "FieldValueInvalidError"); }); test("returns error setting float for int", () => { @@ -454,7 +473,8 @@ void suite("ReflectMessage", () => { r.set(f, create(proto3_ts.Proto3MessageSchema)), ); assert.ok(err !== undefined); - assert.match(err.message, + assert.match( + err.message, /^expected .*, got message spec.Proto3Message$/, ); assert.equal(err.name, "FieldValueInvalidError"); @@ -521,7 +541,8 @@ void suite("ReflectMessage", () => { r.set(f, reflect(example_ts.UserSchema)), ); assert.ok(err !== undefined); - assert.match(err.message, + assert.match( + err.message, /^expected ReflectMessage \(spec.Proto3Message\), got ReflectMessage \(example.User\)$/, ); assert.equal(err.name, "FieldValueInvalidError"); @@ -533,7 +554,8 @@ void suite("ReflectMessage", () => { const map = reflectMap(mapStringStringField); const err = catchFieldError(() => r.set(mapInt32Int32Field, map)); assert.ok(err !== undefined); - assert.match(err.message, + assert.match( + err.message, /^expected ReflectMap \(INT32, INT32\), got ReflectMap \(STRING, STRING\)$/, ); assert.equal(err.name, "FieldValueInvalidError"); @@ -545,7 +567,8 @@ void suite("ReflectMessage", () => { const list = reflectList(repeatedStringField); const err = catchFieldError(() => r.set(repeatedInt32Field, list)); assert.ok(err !== undefined); - assert.match(err.message, + assert.match( + err.message, /^expected ReflectList \(INT32\), got ReflectList \(STRING\)$/, ); assert.equal(err.name, "FieldValueInvalidError"); @@ -619,7 +642,8 @@ void suite("ReflectMessage", () => { const foreignField = foreignMessage.fields[0]; const r = reflect(proto3_ts.Proto3MessageSchema); assert.throws(() => r.isSet(foreignField), { - message: /^cannot use field Foreign.foreign with message spec.Proto3Message$/, + message: + /^cannot use field Foreign.foreign with message spec.Proto3Message$/, }); }); }); @@ -680,7 +704,8 @@ void suite("ReflectMessage", () => { const foreignField = foreignMessage.fields[0]; assert.ok(foreignField.fieldKind == "list"); assert.throws(() => r.clear(foreignField), { - message: /^cannot use field Foreign.foreign with message spec.Proto3Message$/, + message: + /^cannot use field Foreign.foreign with message spec.Proto3Message$/, }); }); }); diff --git a/packages/protobuf-test/src/registry.test.ts b/packages/protobuf-test/src/registry.test.ts index db02c167c..04da3c197 100644 --- a/packages/protobuf-test/src/registry.test.ts +++ b/packages/protobuf-test/src/registry.test.ts @@ -274,7 +274,8 @@ void suite("createRegistry()", () => { const regTypeNames = Array.from(reg) .map((t) => t.typeName) .sort(); - assert.deepStrictEqual(regTypeNames, + assert.deepStrictEqual( + regTypeNames, ["Msg", "Enu", "Srv", "ext", "Msg2", "Enu2", "Srv2", "ext2"].sort(), ); }); @@ -292,7 +293,8 @@ void suite("createRegistry()", () => { const regTypeNames = Array.from(reg) .map((t) => t.typeName) .sort(); - assert.deepStrictEqual(regTypeNames, + assert.deepStrictEqual( + regTypeNames, ["Msg", "Enu", "Srv", "ext", "Msg3"].sort(), ); assert.strictEqual(reg.get("Msg"), secondReg.get("Msg")); @@ -380,12 +382,10 @@ void suite("createFileRegistry()", () => { }); test("provides files through file iterable", () => { const fileReg = createFileRegistry(testFileDescriptorSet); - assert.deepStrictEqual(Array.from(fileReg.files).map((f) => f.name), [ - "d", - "b", - "c", - "a", - ]); + assert.deepStrictEqual( + Array.from(fileReg.files).map((f) => f.name), + ["d", "b", "c", "a"], + ); }); }); void suite("from FileDescriptorProto", () => { @@ -432,7 +432,9 @@ void suite("createFileRegistry()", () => { return testFileReg.getFile(protoFileName); }); } - assert.throws(t, {message: /^Unable to resolve c.proto, imported by a.proto$/}); + assert.throws(t, { + message: /^Unable to resolve c.proto, imported by a.proto$/, + }); }); }); test("accepts empty arguments", () => { @@ -448,7 +450,7 @@ void suite("createFileRegistry()", () => { function t() { createFileRegistry(testFileDescriptorSet); } - assert.throws(t, {message: /^d.proto: unsupported edition$/}); + assert.throws(t, { message: /^d.proto: unsupported edition$/ }); }); test("raises error on unsupported edition from the future", () => { testFileDescriptorSet.file[0].syntax = "editions"; @@ -456,7 +458,7 @@ void suite("createFileRegistry()", () => { function t() { createFileRegistry(testFileDescriptorSet); } - assert.throws(t, {message: /^d.proto: unsupported edition$/}); + assert.throws(t, { message: /^d.proto: unsupported edition$/ }); }); void suite("from FileRegistry", () => { test("creates a copy of the given FileRegistry", () => { @@ -513,7 +515,8 @@ void suite("createFileRegistry()", () => { Array.from(reg.files) .map((f) => f.name) .sort(), - ["a", "b"].sort()); + ["a", "b"].sort(), + ); }); test("later duplicate file overwrites former file", async () => { const regA = createFileRegistry( @@ -533,12 +536,16 @@ void suite("createFileRegistry()", () => { }), ); const reg = createFileRegistry(regA, regB); - assert.deepStrictEqual(Array.from(reg.files).map((f) => f.name), ["a"]); + assert.deepStrictEqual( + Array.from(reg.files).map((f) => f.name), + ["a"], + ); assert.deepStrictEqual( Array.from(reg) .map((t) => t.typeName) .sort(), - ["MsgA", "MsgB"].sort()); + ["MsgA", "MsgB"].sort(), + ); }); }); }); @@ -580,7 +587,10 @@ void suite("DescFile", () => { const a = reg.getFile("a.proto"); assert.strictEqual(a?.name, "a"); assert.strictEqual(a?.dependencies.length, 2); - assert.deepStrictEqual(a?.dependencies.map((f) => f.name), ["b", "c"]); + assert.deepStrictEqual( + a?.dependencies.map((f) => f.name), + ["b", "c"], + ); }); void suite("name", () => { test("is proto file name without .proto suffix", async () => { @@ -899,7 +909,10 @@ void suite("DescField", () => { required int32 f = 1; } `); - assert.strictEqual(field.presence, FeatureSet_FieldPresence.LEGACY_REQUIRED); + assert.strictEqual( + field.presence, + FeatureSet_FieldPresence.LEGACY_REQUIRED, + ); }); test("proto2 required message is LEGACY_REQUIRED", async () => { const field = await compileField(` @@ -908,7 +921,10 @@ void suite("DescField", () => { required M f = 1; } `); - assert.strictEqual(field.presence, FeatureSet_FieldPresence.LEGACY_REQUIRED); + assert.strictEqual( + field.presence, + FeatureSet_FieldPresence.LEGACY_REQUIRED, + ); }); test("proto2 scalar list is IMPLICIT", async () => { const field = await compileField(` @@ -1104,7 +1120,10 @@ void suite("DescField", () => { int32 f = 1 [features.field_presence = LEGACY_REQUIRED]; } `); - assert.strictEqual(field.presence, FeatureSet_FieldPresence.LEGACY_REQUIRED); + assert.strictEqual( + field.presence, + FeatureSet_FieldPresence.LEGACY_REQUIRED, + ); }); test("edition2023 message with LEGACY_REQUIRED is LEGACY_REQUIRED", async () => { const field = await compileField(` @@ -1113,7 +1132,10 @@ void suite("DescField", () => { M f = 1 [features.field_presence = LEGACY_REQUIRED]; } `); - assert.strictEqual(field.presence, FeatureSet_FieldPresence.LEGACY_REQUIRED); + assert.strictEqual( + field.presence, + FeatureSet_FieldPresence.LEGACY_REQUIRED, + ); }); }); void suite("delimitedEncoding", () => { @@ -1126,7 +1148,8 @@ void suite("DescField", () => { `); assert.strictEqual( field.fieldKind == "message" ? field.delimitedEncoding : undefined, - true); + true, + ); }); test("true for field with features.message_encoding = DELIMITED", async () => { const field = await compileField(` @@ -1137,7 +1160,8 @@ void suite("DescField", () => { `); assert.strictEqual( field.fieldKind == "message" ? field.delimitedEncoding : undefined, - true); + true, + ); }); test("true for list field with features.message_encoding = DELIMITED", async () => { const field = await compileField(` @@ -1150,7 +1174,8 @@ void suite("DescField", () => { field.fieldKind == "list" && field.listKind == "message" ? field.delimitedEncoding : undefined, - true); + true, + ); }); test("true for file with features.message_encoding = DELIMITED", async () => { const field = await compileField(` @@ -1162,7 +1187,8 @@ void suite("DescField", () => { `); assert.strictEqual( field.fieldKind == "message" ? field.delimitedEncoding : undefined, - true); + true, + ); }); test("false for map field with inherited features.message_encoding = DELIMITED", async () => { const field = await compileField(` @@ -1174,7 +1200,8 @@ void suite("DescField", () => { `); assert.strictEqual( field.fieldKind == "map" ? field.delimitedEncoding : undefined, - false); + false, + ); }); }); void suite("longAsString", () => { @@ -1208,7 +1235,7 @@ void suite("DescField", () => { } } }); - for (const {jstype, longAsString} of [ + for (const { jstype, longAsString } of [ { jstype: "JS_NORMAL", longAsString: false }, { jstype: "JS_NUMBER", longAsString: false }, { jstype: "JS_STRING", longAsString: true }, @@ -1233,7 +1260,7 @@ void suite("DescField", () => { for (const field of fields) { assert.ok( field.fieldKind == "scalar" || - (field.fieldKind == "list" && field.listKind == "scalar"), + (field.fieldKind == "list" && field.listKind == "scalar"), ); if ( field.fieldKind == "scalar" || @@ -1862,7 +1889,8 @@ void suite("DescExtension", () => { `); assert.strictEqual( ext.fieldKind == "message" ? ext.delimitedEncoding : undefined, - true); + true, + ); }); test("true for field with features.message_encoding = DELIMITED", async () => { const ext = await compileExtension(` @@ -1874,7 +1902,8 @@ void suite("DescExtension", () => { `); assert.strictEqual( ext.fieldKind == "message" ? ext.delimitedEncoding : undefined, - true); + true, + ); }); }); }); @@ -1978,7 +2007,8 @@ void suite("DescMethod", () => { message I {} message O {} `); - assert.strictEqual(method.idempotency, + assert.strictEqual( + method.idempotency, MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN, ); }); @@ -1993,7 +2023,8 @@ void suite("DescMethod", () => { message I {} message O {} `); - assert.strictEqual(method.idempotency, + assert.strictEqual( + method.idempotency, MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN, ); }); @@ -2008,7 +2039,8 @@ void suite("DescMethod", () => { message I {} message O {} `); - assert.strictEqual(method.idempotency, + assert.strictEqual( + method.idempotency, MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS, ); }); @@ -2023,7 +2055,8 @@ void suite("DescMethod", () => { message I {} message O {} `); - assert.strictEqual(method.idempotency, + assert.strictEqual( + method.idempotency, MethodOptions_IdempotencyLevel.IDEMPOTENT, ); }); diff --git a/packages/protobuf-test/src/serialization-errors.test.ts b/packages/protobuf-test/src/serialization-errors.test.ts index e21319737..8fa1829fd 100644 --- a/packages/protobuf-test/src/serialization-errors.test.ts +++ b/packages/protobuf-test/src/serialization-errors.test.ts @@ -27,11 +27,15 @@ void suite("serialization errors", () => { paths: ["user.displayName", "photo"], }); void test("toJson", () => { - assert.throws(() => { - toJson(FieldMaskSchema, fieldMask); - }, { - message: 'cannot encode message google.protobuf.FieldMask to JSON: lowerCamelCase of path name "user.displayName" is irreversible', - }); + assert.throws( + () => { + toJson(FieldMaskSchema, fieldMask); + }, + { + message: + 'cannot encode message google.protobuf.FieldMask to JSON: lowerCamelCase of path name "user.displayName" is irreversible', + }, + ); }); void test("toBinary", () => { assert.doesNotThrow(() => { @@ -101,12 +105,14 @@ void suite("serialization errors", () => { msg.singularEnumField = "abc"; void test("toJson", () => { assert.throws(() => toJson(desc, msg), { - message: /^cannot encode enum spec.Proto3Enum to JSON: expected number, got "abc"$/, + message: + /^cannot encode enum spec.Proto3Enum to JSON: expected number, got "abc"$/, }); }); test("toBinary", () => { assert.throws(() => toBinary(desc, msg), { - message: /^cannot encode field spec.Proto3Message.singular_enum_field to binary: invalid int32: NaN$/, + message: + /^cannot encode field spec.Proto3Message.singular_enum_field to binary: invalid int32: NaN$/, }); }); }); @@ -117,12 +123,14 @@ void suite("serialization errors", () => { msg.repeatedEnumField = ["abc"]; test("toJson", () => { assert.throws(() => toJson(desc, msg), { - message: /^cannot encode enum spec.Proto3Enum to JSON: expected number, got "abc"$/, + message: + /^cannot encode enum spec.Proto3Enum to JSON: expected number, got "abc"$/, }); }); test("toBinary", () => { assert.throws(() => toBinary(desc, msg), { - message: /^cannot encode field spec.Proto3Message.repeated_enum_field to binary: invalid int32: NaN$/, + message: + /^cannot encode field spec.Proto3Message.repeated_enum_field to binary: invalid int32: NaN$/, }); }); }); @@ -131,12 +139,14 @@ void suite("serialization errors", () => { const msg = create(desc); test("toJson", () => { assert.throws(() => toJson(desc, msg), { - message: /^cannot encode field spec.Proto2Message.required_string_field to JSON: required field not set$/, + message: + /^cannot encode field spec.Proto2Message.required_string_field to JSON: required field not set$/, }); }); test("toBinary", () => { assert.throws(() => toBinary(desc, msg), { - message: /^cannot encode field spec.Proto2Message.required_string_field to binary: required field not set$/, + message: + /^cannot encode field spec.Proto2Message.required_string_field to binary: required field not set$/, }); }); }); @@ -226,14 +236,14 @@ void suite("serialization errors", () => { if (kase.jsonErr === null) { assert.doesNotThrow(() => toJson(desc, msg)); } else { - assert.throws(() => toJson(desc, msg), {message: kase.jsonErr}); + assert.throws(() => toJson(desc, msg), { message: kase.jsonErr }); } }); void test("toBinary", () => { if (kase.binaryErr === null) { assert.doesNotThrow(() => toBinary(desc, msg)); } else { - assert.throws(() => toBinary(desc, msg), {message: kase.binaryErr}); + assert.throws(() => toBinary(desc, msg), { message: kase.binaryErr }); } }); }); @@ -274,7 +284,7 @@ void suite("serialization errors", () => { if (kase.jsonErr === null) { assert.doesNotThrow(() => toJson(desc, msg)); } else { - assert.throws(() => toJson(desc, msg), {message: kase.jsonErr}); + assert.throws(() => toJson(desc, msg), { message: kase.jsonErr }); } }); void test("toBinary", () => { diff --git a/packages/protobuf-test/src/types.test.ts b/packages/protobuf-test/src/types.test.ts index 587c43d72..912099a36 100644 --- a/packages/protobuf-test/src/types.test.ts +++ b/packages/protobuf-test/src/types.test.ts @@ -49,18 +49,21 @@ import type * as valid_types_ts_novalid from "./gen/ts/extra/valid_types_pb.js"; import type * as codegenv1 from "@bufbuild/protobuf/codegenv1"; void suite("type Message", () => { - void suite("assigning different messages with same shape to each other", () => { - void test("is a type error", () => { - const duration = "fake" as unknown as Duration; - const timestamp = "fake" as unknown as Timestamp; - // @ts-expect-error TS2322 - const duration2: Duration = timestamp; - // @ts-expect-error TS2322 - const timestamp2: Timestamp = duration; - assert.ok(duration2); - assert.ok(timestamp2); - }); - }); + void suite( + "assigning different messages with same shape to each other", + () => { + void test("is a type error", () => { + const duration = "fake" as unknown as Duration; + const timestamp = "fake" as unknown as Timestamp; + // @ts-expect-error TS2322 + const duration2: Duration = timestamp; + // @ts-expect-error TS2322 + const timestamp2: Timestamp = duration; + assert.ok(duration2); + assert.ok(timestamp2); + }); + }, + ); void suite("narrow down from message shape union", () => { const msg = create(UserSchema) as unknown as Proto3Message | User; void test("can switch on Message.$typeName against literal string type", () => { diff --git a/packages/protobuf-test/src/wire/base64-encoding.test.ts b/packages/protobuf-test/src/wire/base64-encoding.test.ts index cba967f6f..5cae80fd5 100644 --- a/packages/protobuf-test/src/wire/base64-encoding.test.ts +++ b/packages/protobuf-test/src/wire/base64-encoding.test.ts @@ -199,7 +199,10 @@ void suite("base64Decode()", () => { "c3VyZQ=\r\n\r\n=", ]) { void test(`ignores white-space, including line breaks and tabs in ${b64}`, () => { - assert.deepStrictEqual(base64Decode(b64), new TextEncoder().encode("sure")); + assert.deepStrictEqual( + base64Decode(b64), + new TextEncoder().encode("sure"), + ); }); } for (const b64 of [ @@ -210,11 +213,15 @@ void suite("base64Decode()", () => { "c3VyZQ== c3VyZQ==", ]) { void test(`allows inner padding in ${b64}`, () => { - assert.deepStrictEqual(base64Decode(b64), new TextEncoder().encode("suresure")); + assert.deepStrictEqual( + base64Decode(b64), + new TextEncoder().encode("suresure"), + ); }); } void test("does not require padding", () => { - assert.deepStrictEqual(base64Decode("c3VyZQ"), + assert.deepStrictEqual( + base64Decode("c3VyZQ"), new TextEncoder().encode("sure"), ); }); @@ -232,7 +239,10 @@ void suite("base64Decode()", () => { "c3VyZQ=\r\n\r\n=", ]) { void test(`ignores whitespace in ${b64}`, () => { - assert.deepStrictEqual(base64Decode(b64), new TextEncoder().encode("sure")); + assert.deepStrictEqual( + base64Decode(b64), + new TextEncoder().encode("sure"), + ); }); } test("understands URL encoding", () => { @@ -245,19 +255,22 @@ void suite("base64Decode()", () => { void suite("base64Encode()", () => { for (const { name, bytes, std } of exampleCases) { void test(`std encodes ${name}`, () => { - const input = bytes instanceof Uint8Array ? bytes : new TextEncoder().encode(bytes); + const input = + bytes instanceof Uint8Array ? bytes : new TextEncoder().encode(bytes); assert.strictEqual(base64Encode(input), std); }); } for (const { name, bytes, std_raw } of exampleCases) { void test(`std_raw encodes ${name}`, () => { - const input = bytes instanceof Uint8Array ? bytes : new TextEncoder().encode(bytes); + const input = + bytes instanceof Uint8Array ? bytes : new TextEncoder().encode(bytes); assert.strictEqual(base64Encode(input, "std_raw"), std_raw); }); } for (const { name, bytes, url } of exampleCases) { void test(`url encodes ${name}`, () => { - const input = bytes instanceof Uint8Array ? bytes : new TextEncoder().encode(bytes); + const input = + bytes instanceof Uint8Array ? bytes : new TextEncoder().encode(bytes); assert.strictEqual(base64Encode(input, "url"), url); }); } diff --git a/packages/protobuf-test/src/wire/binary-encoding.test.ts b/packages/protobuf-test/src/wire/binary-encoding.test.ts index 32fba008d..f76dbbfa5 100644 --- a/packages/protobuf-test/src/wire/binary-encoding.test.ts +++ b/packages/protobuf-test/src/wire/binary-encoding.test.ts @@ -51,7 +51,7 @@ void suite("BinaryWriter", () => { assert.deepStrictEqual(bytesStr, bytes); }); } - for (const {val, err} of [ + for (const { val, err } of [ { val: null, err: "invalid float32: object" }, { val: new Date(), err: "invalid float32: object" }, { val: undefined, err: "invalid float32: undefined" }, @@ -61,12 +61,10 @@ void suite("BinaryWriter", () => { // @ts-expect-error test wrong type assert.throws(() => new BinaryWriter().float(val), { message: err, - }) + }); }); } - for (const val of [ - Number.MAX_VALUE, -Number.MAX_VALUE, - ]) { + for (const val of [Number.MAX_VALUE, -Number.MAX_VALUE]) { void test(`should error for value out of range ${val}`, () => { assert.throws(() => new BinaryWriter().float(val), { message: /^invalid float32: .*/, @@ -79,42 +77,44 @@ void suite("BinaryWriter", () => { } }); // sfixed32, sint32, and int32 are signed 32-bit integers, just with different encoding - for (const type of ["sfixed32", "sint32", "int32"] as const) { - void suite(`${type}()`, () => { - for (const val of [-0x80000000, 1024, 0x7fffffff]) { - void test(`should encode ${val}`, () => { - const bytes = new BinaryWriter()[type](val).finish(); - assert.ok(bytes.length > 0); - // @ts-expect-error test string - const bytesStr = new BinaryWriter()[type](val.toString()).finish(); - assert.ok(bytesStr.length > 0); - assert.deepStrictEqual(bytesStr, bytes); - }); - } - for (const {val, err} of [ - { val: null, err: "invalid int32: object" }, - { val: new Date(), err: "invalid int32: object" }, - { val: undefined, err: "invalid int32: undefined" }, - { val: true, err: "invalid int32: boolean" }, - ]) { - void test(`should error for wrong type ${val}`, () => { - // @ts-expect-error TS2345 - assert.throws(() => new BinaryWriter()[type](val), {message: err}); + for (const type of ["sfixed32", "sint32", "int32"] as const) { + void suite(`${type}()`, () => { + for (const val of [-0x80000000, 1024, 0x7fffffff]) { + void test(`should encode ${val}`, () => { + const bytes = new BinaryWriter()[type](val).finish(); + assert.ok(bytes.length > 0); + // @ts-expect-error test string + const bytesStr = new BinaryWriter()[type](val.toString()).finish(); + assert.ok(bytesStr.length > 0); + assert.deepStrictEqual(bytesStr, bytes); + }); + } + for (const { val, err } of [ + { val: null, err: "invalid int32: object" }, + { val: new Date(), err: "invalid int32: object" }, + { val: undefined, err: "invalid int32: undefined" }, + { val: true, err: "invalid int32: boolean" }, + ]) { + void test(`should error for wrong type ${val}`, () => { + // @ts-expect-error TS2345 + assert.throws(() => new BinaryWriter()[type](val), { message: err }); + }); + } + for (const val of [0x7fffffff + 1, -0x80000000 - 1, 3.14]) { + void test(`should error for value out of range ${val}`, () => { + assert.throws(() => new BinaryWriter()[type](val), { + message: /^invalid int32: .*/, }); - } - for (const val of [ - 0x7fffffff + 1, -0x80000000 - 1, 3.14 - ]) { - void test(`should error for value out of range ${val}`, () => { - assert.throws(() => new BinaryWriter()[type](val), {message: /^invalid int32: .*/,}); - // @ts-expect-error test string - assert.throws(() => new BinaryWriter()[type](val.toString()), {message: /^invalid int32: .*/,}); + // @ts-expect-error test string + assert.throws(() => new BinaryWriter()[type](val.toString()), { + message: /^invalid int32: .*/, }); - } - }); - } + }); + } + }); + } // fixed32 and uint32 are unsigned 32-bit integers, just with different encoding - for (const type of ["fixed32", "uint32"] as const) { + for (const type of ["fixed32", "uint32"] as const) { void suite(`${type}()`, () => { for (const val of [0, 1024, 0xffffffff]) { void test(`should encode ${val}`, () => { @@ -126,7 +126,7 @@ void suite("BinaryWriter", () => { assert.deepStrictEqual(bytesStr, bytes); }); } - for (const {val, err} of [ + for (const { val, err } of [ { val: null, err: `invalid uint32: object` }, { val: new Date(), err: `invalid uint32: object` }, { val: undefined, err: `invalid uint32: undefined` }, @@ -141,13 +141,13 @@ void suite("BinaryWriter", () => { } for (const val of [0xffffffff + 1, -1, 3.14]) { void test(`should error for value out of range ${val}`, () => { - assert.throws(() => new BinaryWriter()[type](val), - {message: /^invalid uint32: .*/} - ); + assert.throws(() => new BinaryWriter()[type](val), { + message: /^invalid uint32: .*/, + }); // @ts-expect-error test string - assert.throws(() => new BinaryWriter()[type](val.toString()), - {message: /^invalid uint32: .*/} - ); + assert.throws(() => new BinaryWriter()[type](val.toString()), { + message: /^invalid uint32: .*/, + }); }); } }); @@ -206,9 +206,12 @@ void suite("BinaryReader", () => { const [fieldNo, wireType] = reader.tag(); assert.strictEqual(fieldNo, 1); assert.strictEqual(wireType, WireType.StartGroup); - assert.throws(() => { - reader.skip(WireType.StartGroup, 1); - }, {message: /^invalid end group tag$/}); + assert.throws( + () => { + reader.skip(WireType.StartGroup, 1); + }, + { message: /^invalid end group tag$/ }, + ); }); void test("should return skipped group data", () => { const reader = new BinaryReader( diff --git a/packages/protobuf-test/src/wire/size-delimited.test.ts b/packages/protobuf-test/src/wire/size-delimited.test.ts index a25b1116b..e5747713d 100644 --- a/packages/protobuf-test/src/wire/size-delimited.test.ts +++ b/packages/protobuf-test/src/wire/size-delimited.test.ts @@ -145,7 +145,7 @@ void suite("sizeDelimitedPeek()", () => { const bytes = complete.slice(0, x); const got = sizeDelimitedPeek(bytes); assert.strictEqual(got.eof, true); - }) + }); } }); void suite("with invalid varint", () => { diff --git a/packages/protobuf-test/src/wire/text-encoding.test.ts b/packages/protobuf-test/src/wire/text-encoding.test.ts index cb7f62aab..4d1a7f486 100644 --- a/packages/protobuf-test/src/wire/text-encoding.test.ts +++ b/packages/protobuf-test/src/wire/text-encoding.test.ts @@ -32,7 +32,8 @@ void suite("getTextEncoding()", () => { void suite("encodeUtf8()", () => { void test("encodes", () => { const bytes = getTextEncoding().encodeUtf8("hello 🌍"); - assert.deepStrictEqual(bytes, + assert.deepStrictEqual( + bytes, new Uint8Array([104, 101, 108, 108, 111, 32, 240, 159, 140, 141]), ); }); @@ -106,7 +107,8 @@ void suite("configureTextEncoding()", () => { return new Uint8Array(10); }, }); - assert.deepStrictEqual(getTextEncoding().encodeUtf8("test"), + assert.deepStrictEqual( + getTextEncoding().encodeUtf8("test"), new Uint8Array(10), ); assert.strictEqual(arg, "test"); diff --git a/packages/protobuf-test/src/wkt/timestamp.test.ts b/packages/protobuf-test/src/wkt/timestamp.test.ts index ce1c85b65..746588afb 100644 --- a/packages/protobuf-test/src/wkt/timestamp.test.ts +++ b/packages/protobuf-test/src/wkt/timestamp.test.ts @@ -30,8 +30,8 @@ void suite("timestampNow()", () => { const wantMs = Date.now(); const gotMs = timestampMs(timestamp); const leewayMs = 50; - assert.ok(gotMs >= (wantMs - leewayMs)); - assert.ok(gotMs <= (wantMs + leewayMs)); + assert.ok(gotMs >= wantMs - leewayMs); + assert.ok(gotMs <= wantMs + leewayMs); }); }); @@ -43,14 +43,18 @@ void suite("timestampMs()", () => { seconds: protoInt64.zero, nanos: 0, }), - ), 0); + ), + 0, + ); assert.strictEqual( timestampMs( create(TimestampSchema, { seconds: protoInt64.parse(818035920), nanos: 123456789, }), - ), 818035920123); + ), + 818035920123, + ); }); }); From 11855e27ff1f55ed322d90b1f7f1ab115e6b9f86 Mon Sep 17 00:00:00 2001 From: Timo Stamm Date: Mon, 18 Aug 2025 19:31:35 +0200 Subject: [PATCH 10/16] Migrate rest of protoplugin-test --- packages/protoplugin-test/src/target.test.ts | 143 +++++++++---------- 1 file changed, 69 insertions(+), 74 deletions(-) diff --git a/packages/protoplugin-test/src/target.test.ts b/packages/protoplugin-test/src/target.test.ts index 590bcf6f1..af1135181 100644 --- a/packages/protoplugin-test/src/target.test.ts +++ b/packages/protoplugin-test/src/target.test.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { suite, test, beforeEach } from "node:test"; +import { suite, test, beforeEach, mock, type Mock } from "node:test"; import * as assert from "node:assert"; import { createTestPluginAndRun } from "./helpers.js"; import type { @@ -22,26 +22,26 @@ import type { } from "@bufbuild/protoplugin"; import type { CodeGeneratorResponse } from "@bufbuild/protobuf/wkt"; -void suite("target", (context) => { +void suite("target", () => { type PluginInit = Parameters< typeof createEcmaScriptPlugin> >[0]; - let generateTs: jest.Mock; - let generateJs: jest.Mock["generateJs"]>; - let generateDts: jest.Mock["generateDts"]>; - let transpile: jest.Mock["transpile"]>; + let generateTs: Mock; + let generateJs: Mock["generateJs"]>; + let generateDts: Mock["generateDts"]>; + let transpile: Mock["transpile"]>; - beforeEach((context) => { - generateTs = jest.fn((schema: Schema) => + beforeEach(() => { + generateTs = mock.fn((schema: Schema) => schema.generateFile("test.ts").print(`const foo = "ts";`), ); - generateJs = jest.fn((schema: Schema) => + generateJs = mock.fn((schema: Schema) => schema.generateFile("test.js").print(`const foo = "js";`), ); - generateDts = jest.fn((schema: Schema) => + generateDts = mock.fn((schema: Schema) => schema.generateFile("test.d.ts").print(`declare const foo = "dts";`), ); - transpile = jest.fn( + transpile = mock.fn( ( files: FileInfo[], transpileJs: boolean, @@ -50,8 +50,8 @@ void suite("target", (context) => { ) => { const out: FileInfo[] = []; for (const f of files) { - expect(f.name.endsWith(".ts")).toBeTruthy(); - expect(f.name.endsWith(".d.ts")).toBeFalsy(); + assert.ok(f.name.endsWith(".ts")); + assert.ok(!f.name.endsWith(".d.ts")); if (transpileJs) { out.push({ name: "test.js", @@ -83,7 +83,7 @@ void suite("target", (context) => { transpile, }); const gotFiles = res.file.map((f) => f.name).sort(); - assert.deepStrictEqual(gotFiles).toStrictEqual(["test.js", "test.d.ts"].sort()); + assert.deepStrictEqual(gotFiles, ["test.js", "test.d.ts"].sort()); }); void test("should call generateJs and generateDts", async () => { await createTestPluginAndRun({ @@ -94,10 +94,10 @@ void suite("target", (context) => { generateDts, transpile, }); - expect(generateTs).toHaveBeenCalledTimes(0); - expect(generateJs).toHaveBeenCalledTimes(1); - expect(generateDts).toHaveBeenCalledTimes(1); - expect(transpile).toHaveBeenCalledTimes(0); + assert.strictEqual(generateTs.mock.callCount(), 0); + assert.strictEqual(generateJs.mock.callCount(), 1); + assert.strictEqual(generateDts.mock.callCount(), 1); + assert.strictEqual(transpile.mock.callCount(), 0); }); }); @@ -110,40 +110,42 @@ void suite("target", (context) => { "js+dts", "ts+dts", ]; - describe.each(targetCases)("targets %s", (targetsJoined) => { - const targets = targetsJoined.split("+"); - void test("should generate expected files", async () => { - const res = await createTestPluginAndRun({ - proto: `syntax="proto3";`, - parameter: `target=${targetsJoined}`, - generateTs, - generateJs, - generateDts, - transpile, + for (const targetsJoined of targetCases) { + void suite(`targets ${targetsJoined}`, () => { + void test("should generate expected files", async () => { + const res = await createTestPluginAndRun({ + proto: `syntax="proto3";`, + parameter: `target=${targetsJoined}`, + generateTs, + generateJs, + generateDts, + transpile, + }); + const gotFiles = res.file.map((f) => f.name).sort(); + const wantFiles = targetsJoined.split("+") + .map((t) => (t == "dts" ? "test.d.ts" : `test.${t}`)) + .sort(); + assert.deepStrictEqual(gotFiles,wantFiles); }); - const gotFiles = res.file.map((f) => f.name).sort(); - const wantFiles = targets - .map((t) => (t == "dts" ? "test.d.ts" : `test.${t}`)) - .sort(); - assert.deepStrictEqual(gotFiles).toStrictEqual(wantFiles); - }); - void test("should call expected generator functions", async () => { - await createTestPluginAndRun({ - proto: `syntax="proto3";`, - parameter: `target=${targetsJoined}`, - generateTs, - generateJs, - generateDts, - transpile, + void test("should call expected generator functions", async () => { + await createTestPluginAndRun({ + proto: `syntax="proto3";`, + parameter: `target=${targetsJoined}`, + generateTs, + generateJs, + generateDts, + transpile, + }); + const targets = targetsJoined.split("+"); + assert.strictEqual(generateTs.mock.callCount(), targets.includes("ts") ? 1 : 0); + assert.strictEqual(generateJs.mock.callCount(), targets.includes("js") ? 1 : 0); + assert.strictEqual(generateDts.mock.callCount(), + targets.includes("dts") ? 1 : 0, + ); + assert.strictEqual(transpile.mock.callCount(), 0); }); - expect(generateTs).toHaveBeenCalledTimes(targets.includes("ts") ? 1 : 0); - expect(generateJs).toHaveBeenCalledTimes(targets.includes("js") ? 1 : 0); - expect(generateDts).toHaveBeenCalledTimes( - targets.includes("dts") ? 1 : 0, - ); - expect(transpile).toHaveBeenCalledTimes(0); }); - }); + } const transpileCases = [ { @@ -187,40 +189,32 @@ void suite("target", (context) => { expectedFiles: ["test.d.ts", "test.js"], }, ]; - describe.each(transpileCases)( - "$name", - ({ - parameter, - definedGenerators, - calledGenerators, - transpileTo, - expectedFiles, - }) => { + for (const transpileCase of transpileCases) { + void suite(`${transpileCase.name}`, () => { let res: CodeGeneratorResponse; beforeEach( async () => // biome-ignore lint/suspicious/noAssignInExpressions: no (res = await createTestPluginAndRun({ proto: `syntax="proto3";`, - parameter, + parameter: transpileCase.parameter, generateTs, - generateJs: definedGenerators.includes("js") ? generateJs : undefined, // biome-ignore format: want this to read well - generateDts: definedGenerators.includes("dts") ? generateDts : undefined, // biome-ignore format: want this to read well + generateJs: transpileCase.definedGenerators.includes("js") ? generateJs : undefined, // biome-ignore format: want this to read well + generateDts: transpileCase.definedGenerators.includes("dts") ? generateDts : undefined, // biome-ignore format: want this to read well transpile, })), ); - void test("should call expected generator functions", () => { - expect(generateTs).toHaveBeenCalledTimes( - calledGenerators.includes("ts") ? 1 : 0, + assert.strictEqual(generateTs.mock.callCount(), + transpileCase.calledGenerators.includes("ts") ? 1 : 0, ); - expect(generateJs).toHaveBeenCalledTimes(calledGenerators.includes("js") ? 1 : 0); // biome-ignore format: want this to read well - expect(generateDts).toHaveBeenCalledTimes(calledGenerators.includes("dts") ? 1 : 0); // biome-ignore format: want this to read well + assert.strictEqual(generateJs.mock.callCount(), transpileCase.calledGenerators.includes("js") ? 1 : 0); // biome-ignore format: want this to read well + assert.strictEqual(generateDts.mock.callCount(), transpileCase.calledGenerators.includes("dts") ? 1 : 0); // biome-ignore format: want this to read well }); void test("should call transpile function", () => { - expect(transpile).toHaveBeenCalledTimes(1); - expect(transpile).toHaveBeenCalledWith( + assert.strictEqual(transpile.mock.callCount(), 1); + assert.deepStrictEqual(transpile.mock.calls[0].arguments, [ [ { name: "test.ts", @@ -228,16 +222,17 @@ void suite("target", (context) => { preamble: undefined, }, ], - transpileTo.includes("js"), // transpileJs - transpileTo.includes("dts"), // transpileDts + transpileCase.transpileTo.includes("js"), // transpileJs + transpileCase.transpileTo.includes("dts"), // transpileDts "module", // jsImportStyle - ); + ]); }); void test("should generate expected files", () => { const gotFiles = res.file.map((f) => f.name).sort(); - assert.deepStrictEqual(gotFiles, expectedFiles); + assert.deepStrictEqual(gotFiles, transpileCase.expectedFiles); }); - }, - ); + }); + } + }); From 73af8d62aa3894e7e724b2d1a840f251faa1529f Mon Sep 17 00:00:00 2001 From: Timo Stamm Date: Mon, 18 Aug 2025 19:32:03 +0200 Subject: [PATCH 11/16] npm run format --- .../src/custom-options.test.ts | 42 ++++++---- .../src/file-import-desc.test.ts | 10 ++- .../src/file-preamble.test.ts | 30 +++---- .../protoplugin-test/src/file-print.test.ts | 14 +++- .../src/import_extension.test.ts | 25 +++--- .../src/js_import_style.test.ts | 16 ++-- .../src/keep_empty_files.test.ts | 4 +- .../protoplugin-test/src/parse-option.test.ts | 84 +++++++++++-------- .../src/plugin-edition-support.test.ts | 81 ++++++++++-------- .../src/source-code-info.test.ts | 24 ++++-- packages/protoplugin-test/src/target.test.ts | 22 +++-- .../protoplugin-test/src/transpile.test.ts | 13 ++- 12 files changed, 213 insertions(+), 152 deletions(-) diff --git a/packages/protoplugin-test/src/custom-options.test.ts b/packages/protoplugin-test/src/custom-options.test.ts index 82d11bafb..9f4047197 100644 --- a/packages/protoplugin-test/src/custom-options.test.ts +++ b/packages/protoplugin-test/src/custom-options.test.ts @@ -122,15 +122,19 @@ void suite("option retention", () => { }); void test("includes expected files", () => { assert.deepStrictEqual(req.fileToGenerate, ["a.proto"]); - assert.deepStrictEqual(req.protoFile.map((f) => f.name), [ - "google/protobuf/descriptor.proto", - "options.proto", - "b.proto", - "a.proto", - ]); - assert.deepStrictEqual(req.sourceFileDescriptors.map((f) => f.name), [ - "a.proto", - ]); + assert.deepStrictEqual( + req.protoFile.map((f) => f.name), + [ + "google/protobuf/descriptor.proto", + "options.proto", + "b.proto", + "a.proto", + ], + ); + assert.deepStrictEqual( + req.sourceFileDescriptors.map((f) => f.name), + ["a.proto"], + ); }); void test("proto_file elides source retention options for file_to_generate", () => { const fileA = req.protoFile.find((f) => f.name == "a.proto"); @@ -172,13 +176,19 @@ void suite("option retention", () => { ).extensions; }); void test("includes expected files", () => { - assert.deepStrictEqual(schema.files.map((f) => f.proto.name), ["a.proto"]); - assert.deepStrictEqual(schema.allFiles.map((f) => f.proto.name), [ - "google/protobuf/descriptor.proto", - "options.proto", - "b.proto", - "a.proto", - ]); + assert.deepStrictEqual( + schema.files.map((f) => f.proto.name), + ["a.proto"], + ); + assert.deepStrictEqual( + schema.allFiles.map((f) => f.proto.name), + [ + "google/protobuf/descriptor.proto", + "options.proto", + "b.proto", + "a.proto", + ], + ); }); void test("files include source retention options", () => { const file = schema.files.find((f) => f.proto.name == "a.proto"); diff --git a/packages/protoplugin-test/src/file-import-desc.test.ts b/packages/protoplugin-test/src/file-import-desc.test.ts index 9948a0821..83e52e4e7 100644 --- a/packages/protoplugin-test/src/file-import-desc.test.ts +++ b/packages/protoplugin-test/src/file-import-desc.test.ts @@ -96,8 +96,14 @@ void suite("GeneratedFile.importSchema", () => { parameter: "target=ts", generateAny(f, schema) { const imp = f.importSchema(schema.files[0]); - assert.strictEqual(imp.name, "file_my_proto_files_23_dir_joe_s_files_x"); - assert.strictEqual(imp.from, "./my-proto-files/23/dir:/joe's files/x_pb.js"); + assert.strictEqual( + imp.name, + "file_my_proto_files_23_dir_joe_s_files_x", + ); + assert.strictEqual( + imp.from, + "./my-proto-files/23/dir:/joe's files/x_pb.js", + ); assert.strictEqual(imp.typeOnly, false); }, }); diff --git a/packages/protoplugin-test/src/file-preamble.test.ts b/packages/protoplugin-test/src/file-preamble.test.ts index 056534f26..5ea8e87e7 100644 --- a/packages/protoplugin-test/src/file-preamble.test.ts +++ b/packages/protoplugin-test/src/file-preamble.test.ts @@ -31,9 +31,9 @@ void suite("GeneratedFile.preamble", () => { proto: `syntax="proto3";`, parameter: "foo=bar,baz", }); - assert.ok(lines.includes( - `// @generated by test v1 with parameter "foo=bar,baz"`, - )); + assert.ok( + lines.includes(`// @generated by test v1 with parameter "foo=bar,baz"`), + ); }); void test("elides rewrite_imports plugin option", async () => { @@ -42,9 +42,9 @@ void suite("GeneratedFile.preamble", () => { parameter: "foo,rewrite_imports=./test/*_pb.js:@buf/test,rewrite_imports=./test/*_web.js:@buf/web,bar", }); - assert.ok(lines.includes( - `// @generated by test v1 with parameter "foo,bar"`, - )); + assert.ok( + lines.includes(`// @generated by test v1 with parameter "foo,bar"`), + ); }); void test("contains eslint-disable annotation", async () => { @@ -75,9 +75,9 @@ void suite("GeneratedFile.preamble", () => { "foo/bar.proto": `syntax="proto3";`, }, }); - assert.ok(lines.includes( - "// @generated from file foo/bar.proto (syntax proto3)", - )); + assert.ok( + lines.includes("// @generated from file foo/bar.proto (syntax proto3)"), + ); }); void test("contains source file info for proto2", async () => { @@ -86,9 +86,9 @@ void suite("GeneratedFile.preamble", () => { "foo/bar.proto": `syntax="proto2";`, }, }); - assert.ok(lines.includes( - "// @generated from file foo/bar.proto (syntax proto2)", - )); + assert.ok( + lines.includes("// @generated from file foo/bar.proto (syntax proto2)"), + ); }); void test("contains source file info for edition 2023", async () => { @@ -97,9 +97,9 @@ void suite("GeneratedFile.preamble", () => { "foo/bar.proto": `edition="2023";`, }, }); - assert.ok(lines.includes( - "// @generated from file foo/bar.proto (edition 2023)", - )); + assert.ok( + lines.includes("// @generated from file foo/bar.proto (edition 2023)"), + ); }); void test("contains edition file features", async () => { diff --git a/packages/protoplugin-test/src/file-print.test.ts b/packages/protoplugin-test/src/file-print.test.ts index e34b0952e..854a69580 100644 --- a/packages/protoplugin-test/src/file-print.test.ts +++ b/packages/protoplugin-test/src/file-print.test.ts @@ -89,7 +89,7 @@ void suite("GeneratedFile.print", () => { assert.deepStrictEqual(lines, [`"ab\\"c"`]); }); - void suite (`should print "es_proto_int64" Printable`, () => { + void suite(`should print "es_proto_int64" Printable`, () => { void test("should honor longAsString", async () => { const lines = await testGenerate((f) => { f.print({ @@ -212,7 +212,11 @@ void suite("GeneratedFile.print", () => { const imp = createImportSymbol("Foo", "bar"); f.print(imp.toTypeOnly()); }); - assert.deepStrictEqual(lines, ['import type { Foo } from "bar";', "", "Foo"]); + assert.deepStrictEqual(lines, [ + 'import type { Foo } from "bar";', + "", + "Foo", + ]); }); void test("should print import symbol used as type and value", async () => { @@ -308,7 +312,11 @@ void suite("GeneratedFile.print", () => { const lines = await testGenerate((f) => { f.print("a", "b", "c", 1, " ", createImportSymbol("Foo", "bar")); }); - assert.deepStrictEqual(lines, [`import { Foo } from "bar";`, "", "abc1 Foo"]); + assert.deepStrictEqual(lines, [ + `import { Foo } from "bar";`, + "", + "abc1 Foo", + ]); }); void test("should print nested printables", async () => { diff --git a/packages/protoplugin-test/src/import_extension.test.ts b/packages/protoplugin-test/src/import_extension.test.ts index d263a6bb4..96f4461ff 100644 --- a/packages/protoplugin-test/src/import_extension.test.ts +++ b/packages/protoplugin-test/src/import_extension.test.ts @@ -29,7 +29,7 @@ void suite("import_extension", () => { "Bar", ]); }); - for (const {option, ext} of [ + for (const { option, ext } of [ { option: "js", ext: ".js" }, { option: ".js", ext: ".js" }, { option: "ts", ext: ".ts" }, @@ -50,7 +50,7 @@ void suite("import_extension", () => { ]); }); } - for (const {option, ext} of [ + for (const { option, ext } of [ { option: "none", ext: "" }, { option: "", ext: "" }, ]) { @@ -70,15 +70,18 @@ void suite("import_extension", () => { }); } void test("throws error for unknown extension", async () => { - await assert.rejects(async () => { - await testGenerate("target=mjs", (f) => { - const Bar = f.import("Bar", "./foo/bar_pb.js"); - f.print(Bar); - }); - }, { - name: "PluginOptionError", - message: `invalid option "target=mjs"`, - }); + await assert.rejects( + async () => { + await testGenerate("target=mjs", (f) => { + const Bar = f.import("Bar", "./foo/bar_pb.js"); + f.print(Bar); + }); + }, + { + name: "PluginOptionError", + message: `invalid option "target=mjs"`, + }, + ); }); void test("should only touch .js import paths", async () => { const lines = await testGenerate("target=ts,import_extension=ts", (f) => { diff --git a/packages/protoplugin-test/src/js_import_style.test.ts b/packages/protoplugin-test/src/js_import_style.test.ts index cf4236827..de1e4bf7a 100644 --- a/packages/protoplugin-test/src/js_import_style.test.ts +++ b/packages/protoplugin-test/src/js_import_style.test.ts @@ -29,20 +29,20 @@ void suite("js_import_style", () => { void suite("unset", () => { for (const target of ["js", "ts", "dts"]) { void test(`uses module with target ${target}`, async () => { - const lines = await testGenerate(`target=${target}`); - assert.deepStrictEqual(lines, linesEsm); - }, - ); + const lines = await testGenerate(`target=${target}`); + assert.deepStrictEqual(lines, linesEsm); + }); } }); void suite("module", () => { for (const target of ["js", "ts", "dts"]) { void test(`uses module with target ${target}`, async () => { - const lines = await testGenerate(`js_import_style=module,target=${target}`); - assert.deepStrictEqual(lines, linesEsm); - }, - ); + const lines = await testGenerate( + `js_import_style=module,target=${target}`, + ); + assert.deepStrictEqual(lines, linesEsm); + }); } }); diff --git a/packages/protoplugin-test/src/keep_empty_files.test.ts b/packages/protoplugin-test/src/keep_empty_files.test.ts index 517892432..a1ca48b6a 100644 --- a/packages/protoplugin-test/src/keep_empty_files.test.ts +++ b/packages/protoplugin-test/src/keep_empty_files.test.ts @@ -58,7 +58,7 @@ void suite("keep_empty_files", () => { }, }); assert.deepStrictEqual(lines, [""]); - }) + }); } }); void suite("set", () => { @@ -73,7 +73,7 @@ void suite("keep_empty_files", () => { }, }); assert.strictEqual(res.file.length, 1); - }) + }); } }); }); diff --git a/packages/protoplugin-test/src/parse-option.test.ts b/packages/protoplugin-test/src/parse-option.test.ts index 19802ecff..f780e5e04 100644 --- a/packages/protoplugin-test/src/parse-option.test.ts +++ b/packages/protoplugin-test/src/parse-option.test.ts @@ -73,7 +73,7 @@ void suite("parse custom plugin option", () => { (options) => { assert.strictEqual(options.foo, 123); assert.strictEqual(options.bar, true); - assert.deepStrictEqual(options.baz,["a", "b"]); + assert.deepStrictEqual(options.baz, ["a", "b"]); }, create(CodeGeneratorRequestSchema, { parameter: "foo=123,bar,baz=a,baz=b", @@ -93,45 +93,55 @@ void suite("parse custom plugin option", () => { ); }); void test("error from parseOption is wrapped", () => { - assert.throws(() => - runPlugin( - () => { - // - }, - { - parameter: "foo=abc", - }, - ), { - name: "PluginOptionError", - message: /^invalid option "foo=abc": please provide an integer for foo$/ - }); + assert.throws( + () => + runPlugin( + () => { + // + }, + { + parameter: "foo=abc", + }, + ), + { + name: "PluginOptionError", + message: + /^invalid option "foo=abc": please provide an integer for foo$/, + }, + ); }); void test("unknown option raises an error", () => { - assert.throws(() => - runPlugin( - () => { - // - }, - { - parameter: "unknown", - }, - ), { - name: "PluginOptionError", - message: /^invalid option "unknown"$/ - }); + assert.throws( + () => + runPlugin( + () => { + // + }, + { + parameter: "unknown", + }, + ), + { + name: "PluginOptionError", + message: /^invalid option "unknown"$/, + }, + ); }); void test("unknown option with value raises an error", () => { - assert.throws(() => - runPlugin( - () => { - // - }, - { - parameter: "unknown=bar", - }, - ), { - name: "PluginOptionError", - message: /^invalid option "unknown=bar"$/ - }); + assert.throws( + () => + runPlugin( + () => { + // + }, + { + parameter: "unknown=bar", + }, + ), + { + name: "PluginOptionError", + message: /^invalid option "unknown=bar"$/, + }, + ); }); }); diff --git a/packages/protoplugin-test/src/plugin-edition-support.test.ts b/packages/protoplugin-test/src/plugin-edition-support.test.ts index fb0216d3a..530543efa 100644 --- a/packages/protoplugin-test/src/plugin-edition-support.test.ts +++ b/packages/protoplugin-test/src/plugin-edition-support.test.ts @@ -88,49 +88,60 @@ void suite("editions support in plugins", () => { assert.strictEqual(res.maximumEdition, Edition.EDITION_PROTO3); }); void test("raises error for minimumEdition > maximumEdition", async () => { - await assert.rejects(async () => - runPlugin( - Edition.EDITION_PROTO3, - Edition.EDITION_PROTO3, - Edition.EDITION_PROTO2, - ), { - message: /^configured minimumEdition PROTO3 > maximumEdition PROTO2 - please contact plugin author$/, - }); + await assert.rejects( + async () => + runPlugin( + Edition.EDITION_PROTO3, + Edition.EDITION_PROTO3, + Edition.EDITION_PROTO2, + ), + { + message: + /^configured minimumEdition PROTO3 > maximumEdition PROTO2 - please contact plugin author$/, + }, + ); }); void test("raises error on unsupported edition from the past with default range", async () => { - await assert.rejects(async () => - runPlugin( - Edition.EDITION_1_TEST_ONLY, - ), { - message: /^test.proto: unsupported edition 1_TEST_ONLY - the earliest supported edition is PROTO2$/, + await assert.rejects(async () => runPlugin(Edition.EDITION_1_TEST_ONLY), { + message: + /^test.proto: unsupported edition 1_TEST_ONLY - the earliest supported edition is PROTO2$/, }); }); void test("raises error on unsupported edition from the future with default range", async () => { - await assert.rejects(async () => - runPlugin( - Edition.EDITION_99999_TEST_ONLY, - ), { - message: /^test.proto: unsupported edition 99999_TEST_ONLY - the latest supported edition is 2023$/, - }); + await assert.rejects( + async () => runPlugin(Edition.EDITION_99999_TEST_ONLY), + { + message: + /^test.proto: unsupported edition 99999_TEST_ONLY - the latest supported edition is 2023$/, + }, + ); }); void test("raises error on unsupported edition from the past with custom range", async () => { - await assert.rejects(async () => - runPlugin( - Edition.EDITION_PROTO2, - Edition.EDITION_PROTO3, - Edition.EDITION_PROTO3, - ), { - message: /^test.proto: unsupported edition PROTO2 - the earliest supported edition is PROTO3$/, - }); + await assert.rejects( + async () => + runPlugin( + Edition.EDITION_PROTO2, + Edition.EDITION_PROTO3, + Edition.EDITION_PROTO3, + ), + { + message: + /^test.proto: unsupported edition PROTO2 - the earliest supported edition is PROTO3$/, + }, + ); }); void test("raises error on unsupported edition from the future with custom range", async () => { - await assert.rejects(async () => - runPlugin( - Edition.EDITION_2023, - Edition.EDITION_PROTO3, - Edition.EDITION_PROTO3, - ), { - message: /^test.proto: unsupported edition 2023 - the latest supported edition is PROTO3$/, - }); + await assert.rejects( + async () => + runPlugin( + Edition.EDITION_2023, + Edition.EDITION_PROTO3, + Edition.EDITION_PROTO3, + ), + { + message: + /^test.proto: unsupported edition 2023 - the latest supported edition is PROTO3$/, + }, + ); }); }); diff --git a/packages/protoplugin-test/src/source-code-info.test.ts b/packages/protoplugin-test/src/source-code-info.test.ts index 45f7ca133..68d6aef9f 100644 --- a/packages/protoplugin-test/src/source-code-info.test.ts +++ b/packages/protoplugin-test/src/source-code-info.test.ts @@ -120,7 +120,8 @@ void suite("getComments()", () => { assert.deepStrictEqual(comments.leadingDetached, [ "\n Comment after start of message,\n with funny indentation,\n and empty lines on start and end.\n\n", ]); - assert.equal(comments.leading, + assert.equal( + comments.leading, " Comment before field with 5 lines:\n line 2, next is empty\n\n line 4, next is empty\n\n", ); assert.equal(comments.trailing, " Comment next to field.\n"); @@ -135,7 +136,8 @@ void suite("getDeclarationString()", () => { string scalar_field = 1 [json_name = "scalarFieldJsonName"]; } `); - assert.equal(getDeclarationString(field), + assert.equal( + getDeclarationString(field), 'string scalar_field = 1 [json_name = "scalarFieldJsonName"]', ); }); @@ -146,7 +148,8 @@ void suite("getDeclarationString()", () => { string scalar_field = 1 [jstype = JS_NORMAL]; } `); - assert.equal(getDeclarationString(field), + assert.equal( + getDeclarationString(field), "string scalar_field = 1 [jstype = JS_NORMAL]", ); }); @@ -157,7 +160,8 @@ void suite("getDeclarationString()", () => { string scalar_field = 1 [features.field_presence = EXPLICIT]; } `); - assert.equal(getDeclarationString(field), + assert.equal( + getDeclarationString(field), "string scalar_field = 1 [features.field_presence = EXPLICIT]", ); }); @@ -168,7 +172,8 @@ void suite("getDeclarationString()", () => { repeated double double_field = 1; } `); - assert.equal(getDeclarationString(field), + assert.equal( + getDeclarationString(field), "repeated double double_field = 1", ); }); @@ -179,7 +184,8 @@ void suite("getDeclarationString()", () => { optional double double_field = 1; } `); - assert.equal(getDeclarationString(field), + assert.equal( + getDeclarationString(field), "optional double double_field = 1", ); }); @@ -190,7 +196,8 @@ void suite("getDeclarationString()", () => { required double double_field = 1; } `); - assert.equal(getDeclarationString(field), + assert.equal( + getDeclarationString(field), "required double double_field = 1", ); }); @@ -202,7 +209,8 @@ void suite("getDeclarationString()", () => { map int32_msg_field = 10; } `); - assert.equal(getDeclarationString(field), + assert.equal( + getDeclarationString(field), "map int32_msg_field = 10", ); }); diff --git a/packages/protoplugin-test/src/target.test.ts b/packages/protoplugin-test/src/target.test.ts index af1135181..8f3a17fcf 100644 --- a/packages/protoplugin-test/src/target.test.ts +++ b/packages/protoplugin-test/src/target.test.ts @@ -122,10 +122,11 @@ void suite("target", () => { transpile, }); const gotFiles = res.file.map((f) => f.name).sort(); - const wantFiles = targetsJoined.split("+") + const wantFiles = targetsJoined + .split("+") .map((t) => (t == "dts" ? "test.d.ts" : `test.${t}`)) .sort(); - assert.deepStrictEqual(gotFiles,wantFiles); + assert.deepStrictEqual(gotFiles, wantFiles); }); void test("should call expected generator functions", async () => { await createTestPluginAndRun({ @@ -137,9 +138,16 @@ void suite("target", () => { transpile, }); const targets = targetsJoined.split("+"); - assert.strictEqual(generateTs.mock.callCount(), targets.includes("ts") ? 1 : 0); - assert.strictEqual(generateJs.mock.callCount(), targets.includes("js") ? 1 : 0); - assert.strictEqual(generateDts.mock.callCount(), + assert.strictEqual( + generateTs.mock.callCount(), + targets.includes("ts") ? 1 : 0, + ); + assert.strictEqual( + generateJs.mock.callCount(), + targets.includes("js") ? 1 : 0, + ); + assert.strictEqual( + generateDts.mock.callCount(), targets.includes("dts") ? 1 : 0, ); assert.strictEqual(transpile.mock.callCount(), 0); @@ -205,7 +213,8 @@ void suite("target", () => { })), ); void test("should call expected generator functions", () => { - assert.strictEqual(generateTs.mock.callCount(), + assert.strictEqual( + generateTs.mock.callCount(), transpileCase.calledGenerators.includes("ts") ? 1 : 0, ); assert.strictEqual(generateJs.mock.callCount(), transpileCase.calledGenerators.includes("js") ? 1 : 0); // biome-ignore format: want this to read well @@ -234,5 +243,4 @@ void suite("target", () => { }); }); } - }); diff --git a/packages/protoplugin-test/src/transpile.test.ts b/packages/protoplugin-test/src/transpile.test.ts index c2c65e8b5..5161e95ce 100644 --- a/packages/protoplugin-test/src/transpile.test.ts +++ b/packages/protoplugin-test/src/transpile.test.ts @@ -58,9 +58,7 @@ void suite("built-in transpile", () => { const linesDts = await testTranspileToDts([ "export const h = new Headers();", ]); - assert.deepStrictEqual(linesDts, [ - "export declare const h: Headers;", - ]); + assert.deepStrictEqual(linesDts, ["export declare const h: Headers;"]); }); }); @@ -86,9 +84,7 @@ void suite("built-in transpile", () => { ]); // The return type is inferred as `any` instead of the expected // `Foo`. This is a limitation of the TypeScript compiler. - assert.deepStrictEqual(linesDts, [ - "export declare function foo(): any;", - ]); + assert.deepStrictEqual(linesDts, ["export declare function foo(): any;"]); }); void test("can be typed explicitly", async () => { const linesDts = await testTranspileToDts([ @@ -116,8 +112,9 @@ void suite("built-in transpile", () => { ]), { name: "Error", - message: /^A problem occurred during transpilation and files were not generated\. {2}Contact the plugin author for support\.\n/, - } + message: + /^A problem occurred during transpilation and files were not generated\. {2}Contact the plugin author for support\.\n/, + }, ); }); void test("raises error with diagnostics", async () => { From 559de7f8282dcac23ca3512c0251872316669858 Mon Sep 17 00:00:00 2001 From: Timo Stamm Date: Mon, 18 Aug 2025 19:33:25 +0200 Subject: [PATCH 12/16] Remove Jest --- .github/dependabot.yaml | 1 - package-lock.json | 6860 +++++++++++---------------------------- package.json | 1 - 3 files changed, 1946 insertions(+), 4916 deletions(-) diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml index b1bde29d8..75cdd191b 100644 --- a/.github/dependabot.yaml +++ b/.github/dependabot.yaml @@ -23,7 +23,6 @@ updates: groups: test: patterns: - - "jest" - "benchmark" - "@types/benchmark" - "long" diff --git a/package-lock.json b/package-lock.json index f95c7dbe9..e2b50af6e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,7 +26,6 @@ "@biomejs/biome": "^1.9.4", "@bufbuild/license-header": "^0.0.4", "@types/node": "^24.1.0", - "jest": "^29.7.0", "turbo": "^2.5.5", "typescript": "^5.9.2" }, @@ -35,19 +34,6 @@ "npm": ">=10" } }, - "node_modules/@ampproject/remapping": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", - "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", - "dev": true, - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.24" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/@andrewbranch/untar.js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@andrewbranch/untar.js/-/untar.js-1.0.3.tgz", @@ -120,3319 +106,1297 @@ "node": ">=14.17" } }, - "node_modules/@babel/code-frame": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz", - "integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==", + "node_modules/@biomejs/biome": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-1.9.4.tgz", + "integrity": "sha512-1rkd7G70+o9KkTn5KLmDYXihGoTaIGO9PIIN2ZB7UJxFrWw04CZHPYiMRjYsaDvVV7hP1dYNRLxSANLaBFGpog==", "dev": true, - "dependencies": { - "@babel/highlight": "^7.24.7", - "picocolors": "^1.0.0" + "hasInstallScript": true, + "license": "MIT OR Apache-2.0", + "bin": { + "biome": "bin/biome" }, "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/compat-data": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.25.0.tgz", - "integrity": "sha512-P4fwKI2mjEb3ZU5cnMJzvRsRKGBUcs8jvxIoRmr6ufAY9Xk2Bz7JubRTTivkw55c7WQJfTECeqYVa+HZ0FzREg==", - "dev": true, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/core": { - "version": "7.24.9", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.24.9.tgz", - "integrity": "sha512-5e3FI4Q3M3Pbr21+5xJwCv6ZT6KmGkI0vw3Tozy5ODAQFTIWe37iT8Cr7Ice2Ntb+M3iSKCEWMB1MBgKrW3whg==", - "dev": true, - "dependencies": { - "@ampproject/remapping": "^2.2.0", - "@babel/code-frame": "^7.24.7", - "@babel/generator": "^7.24.9", - "@babel/helper-compilation-targets": "^7.24.8", - "@babel/helper-module-transforms": "^7.24.9", - "@babel/helpers": "^7.24.8", - "@babel/parser": "^7.24.8", - "@babel/template": "^7.24.7", - "@babel/traverse": "^7.24.8", - "@babel/types": "^7.24.9", - "convert-source-map": "^2.0.0", - "debug": "^4.1.0", - "gensync": "^1.0.0-beta.2", - "json5": "^2.2.3", - "semver": "^6.3.1" - }, - "engines": { - "node": ">=6.9.0" + "node": ">=14.21.3" }, "funding": { "type": "opencollective", - "url": "https://opencollective.com/babel" - } - }, - "node_modules/@babel/core/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/@babel/generator": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.25.0.tgz", - "integrity": "sha512-3LEEcj3PVW8pW2R1SR1M89g/qrYk/m/mB/tLqn7dn4sbBUQyTqnlod+II2U4dqiGtUmkcnAmkMDralTFZttRiw==", - "dev": true, - "dependencies": { - "@babel/types": "^7.25.0", - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.25", - "jsesc": "^2.5.1" + "url": "https://opencollective.com/biome" }, - "engines": { - "node": ">=6.9.0" + "optionalDependencies": { + "@biomejs/cli-darwin-arm64": "1.9.4", + "@biomejs/cli-darwin-x64": "1.9.4", + "@biomejs/cli-linux-arm64": "1.9.4", + "@biomejs/cli-linux-arm64-musl": "1.9.4", + "@biomejs/cli-linux-x64": "1.9.4", + "@biomejs/cli-linux-x64-musl": "1.9.4", + "@biomejs/cli-win32-arm64": "1.9.4", + "@biomejs/cli-win32-x64": "1.9.4" } }, - "node_modules/@babel/helper-compilation-targets": { - "version": "7.24.8", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.24.8.tgz", - "integrity": "sha512-oU+UoqCHdp+nWVDkpldqIQL/i/bvAv53tRqLG/s+cOXxe66zOYLU7ar/Xs3LdmBihrUMEUhwu6dMZwbNOYDwvw==", + "node_modules/@biomejs/cli-darwin-arm64": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.9.4.tgz", + "integrity": "sha512-bFBsPWrNvkdKrNCYeAp+xo2HecOGPAy9WyNyB/jKnnedgzl4W4Hb9ZMzYNbf8dMCGmUdSavlYHiR01QaYR58cw==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "@babel/compat-data": "^7.24.8", - "@babel/helper-validator-option": "^7.24.8", - "browserslist": "^4.23.1", - "lru-cache": "^5.1.1", - "semver": "^6.3.1" - }, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-compilation-targets/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "bin": { - "semver": "bin/semver.js" + "node": ">=14.21.3" } }, - "node_modules/@babel/helper-module-imports": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.24.7.tgz", - "integrity": "sha512-8AyH3C+74cgCVVXow/myrynrAGv+nTVg5vKu2nZph9x7RcRwzmh0VFallJuFTZ9mx6u4eSdXZfcOzSqTUm0HCA==", + "node_modules/@biomejs/cli-darwin-x64": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.9.4.tgz", + "integrity": "sha512-ngYBh/+bEedqkSevPVhLP4QfVPCpb+4BBe2p7Xs32dBgs7rh9nY2AIYUL6BgLw1JVXV8GlpKmb/hNiuIxfPfZg==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "@babel/traverse": "^7.24.7", - "@babel/types": "^7.24.7" - }, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=6.9.0" + "node": ">=14.21.3" } }, - "node_modules/@babel/helper-module-transforms": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.25.0.tgz", - "integrity": "sha512-bIkOa2ZJYn7FHnepzr5iX9Kmz8FjIz4UKzJ9zhX3dnYuVW0xul9RuR3skBfoLu+FPTQw90EHW9rJsSZhyLQ3fQ==", + "node_modules/@biomejs/cli-linux-arm64": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.9.4.tgz", + "integrity": "sha512-fJIW0+LYujdjUgJJuwesP4EjIBl/N/TcOX3IvIHJQNsAqvV2CHIogsmA94BPG6jZATS4Hi+xv4SkBBQSt1N4/g==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "@babel/helper-module-imports": "^7.24.7", - "@babel/helper-simple-access": "^7.24.7", - "@babel/helper-validator-identifier": "^7.24.7", - "@babel/traverse": "^7.25.0" - }, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" + "node": ">=14.21.3" } }, - "node_modules/@babel/helper-plugin-utils": { - "version": "7.24.8", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.8.tgz", - "integrity": "sha512-FFWx5142D8h2Mgr/iPVGH5G7w6jDn4jUSpZTyDnQO0Yn7Ks2Kuz6Pci8H6MPCoUJegd/UZQ3tAvfLCxQSnWWwg==", + "node_modules/@biomejs/cli-linux-arm64-musl": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.9.4.tgz", + "integrity": "sha512-v665Ct9WCRjGa8+kTr0CzApU0+XXtRgwmzIf1SeKSGAv+2scAlW6JR5PMFo6FzqqZ64Po79cKODKf3/AAmECqA==", + "cpu": [ + "arm64" + ], "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=6.9.0" + "node": ">=14.21.3" } }, - "node_modules/@babel/helper-simple-access": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.24.7.tgz", - "integrity": "sha512-zBAIvbCMh5Ts+b86r/CjU+4XGYIs+R1j951gxI3KmmxBMhCg4oQMsv6ZXQ64XOm/cvzfU1FmoCyt6+owc5QMYg==", + "node_modules/@biomejs/cli-linux-x64": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-1.9.4.tgz", + "integrity": "sha512-lRCJv/Vi3Vlwmbd6K+oQ0KhLHMAysN8lXoCI7XeHlxaajk06u7G+UsFSO01NAs5iYuWKmVZjmiOzJ0OJmGsMwg==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "@babel/traverse": "^7.24.7", - "@babel/types": "^7.24.7" - }, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=6.9.0" + "node": ">=14.21.3" } }, - "node_modules/@babel/helper-string-parser": { - "version": "7.24.8", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz", - "integrity": "sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ==", + "node_modules/@biomejs/cli-linux-x64-musl": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-1.9.4.tgz", + "integrity": "sha512-gEhi/jSBhZ2m6wjV530Yy8+fNqG8PAinM3oV7CyO+6c3CEh16Eizm21uHVsyVBEB6RIM8JHIl6AGYCv6Q6Q9Tg==", + "cpu": [ + "x64" + ], "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=6.9.0" + "node": ">=14.21.3" } }, - "node_modules/@babel/helper-validator-identifier": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz", - "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==", + "node_modules/@biomejs/cli-win32-arm64": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.9.4.tgz", + "integrity": "sha512-tlbhLk+WXZmgwoIKwHIHEBZUwxml7bRJgk0X2sPyNR3S93cdRq6XulAZRQJ17FYGGzWne0fgrXBKpl7l4M87Hg==", + "cpu": [ + "arm64" + ], "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "win32" + ], "engines": { - "node": ">=6.9.0" + "node": ">=14.21.3" } }, - "node_modules/@babel/helper-validator-option": { - "version": "7.24.8", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.24.8.tgz", - "integrity": "sha512-xb8t9tD1MHLungh/AIoWYN+gVHaB9kwlu8gffXGSt3FFEIT7RjS+xWbc2vUD1UTZdIpKj/ab3rdqJ7ufngyi2Q==", + "node_modules/@biomejs/cli-win32-x64": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-1.9.4.tgz", + "integrity": "sha512-8Y5wMhVIPaWe6jw2H+KlEm4wP/f7EW3810ZLmDlrEEy5KvBsb9ECEfu/kMWD484ijfQ8+nIi0giMgu9g1UAuuA==", + "cpu": [ + "x64" + ], "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "win32" + ], "engines": { - "node": ">=6.9.0" + "node": ">=14.21.3" } }, - "node_modules/@babel/helpers": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.25.0.tgz", - "integrity": "sha512-MjgLZ42aCm0oGjJj8CtSM3DB8NOOf8h2l7DCTePJs29u+v7yO/RBX9nShlKMgFnRks/Q4tBAe7Hxnov9VkGwLw==", - "dev": true, - "dependencies": { - "@babel/template": "^7.25.0", - "@babel/types": "^7.25.0" - }, - "engines": { - "node": ">=6.9.0" - } + "node_modules/@braidai/lang": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@braidai/lang/-/lang-1.1.1.tgz", + "integrity": "sha512-5uM+no3i3DafVgkoW7ayPhEGHNNBZCSj5TrGDQt0ayEKQda5f3lAXlmQg0MR5E0gKgmTzUUEtSWHsEC3h9jUcg==", + "dev": true }, - "node_modules/@babel/highlight": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz", - "integrity": "sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.24.7", - "chalk": "^2.4.2", - "js-tokens": "^4.0.0", - "picocolors": "^1.0.0" + "node_modules/@bufbuild/buf": { + "version": "1.56.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf/-/buf-1.56.0.tgz", + "integrity": "sha512-1xQWOf3FCDDTi+5B/VScQ73EP6ACwQPCP4ODvCq2L6IVgFtvYX49ur6cQ2qCM8yFitIHESm/Nbff93sh+V/Iog==", + "hasInstallScript": true, + "license": "Apache-2.0", + "bin": { + "buf": "bin/buf", + "protoc-gen-buf-breaking": "bin/protoc-gen-buf-breaking", + "protoc-gen-buf-lint": "bin/protoc-gen-buf-lint" }, "engines": { - "node": ">=6.9.0" + "node": ">=12" + }, + "optionalDependencies": { + "@bufbuild/buf-darwin-arm64": "1.56.0", + "@bufbuild/buf-darwin-x64": "1.56.0", + "@bufbuild/buf-linux-aarch64": "1.56.0", + "@bufbuild/buf-linux-armv7": "1.56.0", + "@bufbuild/buf-linux-x64": "1.56.0", + "@bufbuild/buf-win32-arm64": "1.56.0", + "@bufbuild/buf-win32-x64": "1.56.0" } }, - "node_modules/@babel/highlight/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, + "node_modules/@bufbuild/buf-darwin-arm64": { + "version": "1.56.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-darwin-arm64/-/buf-darwin-arm64-1.56.0.tgz", + "integrity": "sha512-9neaI9gx1sxOGl9xrL7kw6H+0WmVAFlIQTIDc3vt1qRhfgOt/8AWOHSOWppGTRjNiB0qh6Xie1LYHv/jgDVN0g==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=4" + "node": ">=12" } }, - "node_modules/@babel/highlight/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, + "node_modules/@bufbuild/buf-darwin-x64": { + "version": "1.56.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-darwin-x64/-/buf-darwin-x64-1.56.0.tgz", + "integrity": "sha512-nRHPMXV8fr/lqU+u/1GGsUg7OvNcxJuCJoJpfRoRg38b+NPzOz2FkQAs5OEJzzprQB5aftn5//cl8YXjgvTuFA==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=4" + "node": ">=12" } }, - "node_modules/@babel/highlight/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" + "node_modules/@bufbuild/buf-linux-aarch64": { + "version": "1.56.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-linux-aarch64/-/buf-linux-aarch64-1.56.0.tgz", + "integrity": "sha512-+td559RuKNwYDnq49NrIDGJ4F73Ra4QzVVbsC+UeveA0HMnIGRzFbchGjHtNJyaZsI57sXJ7dCHH0iFV3jcYwQ==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" } }, - "node_modules/@babel/highlight/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "node_modules/@babel/highlight/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, + "node_modules/@bufbuild/buf-linux-armv7": { + "version": "1.56.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-linux-armv7/-/buf-linux-armv7-1.56.0.tgz", + "integrity": "sha512-9v3zmos6wRTBc4QeIg4rfDmPzmTgtUTRCbhr87qws/yddIT8cFtHHhy1whnozBNqtmYOdwZNBNx/QXqGGcRuKw==", + "cpu": [ + "arm" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=0.8.0" + "node": ">=12" } }, - "node_modules/@babel/highlight/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, + "node_modules/@bufbuild/buf-linux-x64": { + "version": "1.56.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-linux-x64/-/buf-linux-x64-1.56.0.tgz", + "integrity": "sha512-3jZHHBol1fuichNke7LJtHJUdw314XBj6OuJHY6IufsaaVIj1mtM2DPbGiDhYB453J7FiV/buadctKBxAAHclg==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=4" + "node": ">=12" } }, - "node_modules/@babel/highlight/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, + "node_modules/@bufbuild/buf-win32-arm64": { + "version": "1.56.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-win32-arm64/-/buf-win32-arm64-1.56.0.tgz", + "integrity": "sha512-KMGzSf9rIbT01Jb2685JovwRRYEdL7Zbs6ZrjyhIHBgKK6cBwz1AJvEaDrWMEzCdv+opQwjgM6UdtA4e9BWP1A==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "win32" + ], "engines": { - "node": ">=4" + "node": ">=12" } }, - "node_modules/@babel/parser": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.0.tgz", - "integrity": "sha512-CzdIU9jdP0dg7HdyB+bHvDJGagUv+qtzZt5rYCWwW6tITNqV9odjp6Qu41gkG0ca5UfdDUWrKkiAnHHdGRnOrA==", - "dev": true, - "bin": { - "parser": "bin/babel-parser.js" - }, + "node_modules/@bufbuild/buf-win32-x64": { + "version": "1.56.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-win32-x64/-/buf-win32-x64-1.56.0.tgz", + "integrity": "sha512-19LFOCyFFVTaaqNGtYTpiF67fcpneWZFlm8UNU+Xs87Kh+N5i/LjDjNytnpFT6snwU4/S+UUkq7WgS6UPjqXIg==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "win32" + ], "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@babel/plugin-syntax-async-generators": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", - "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-bigint": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz", - "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "node": ">=12" } }, - "node_modules/@babel/plugin-syntax-class-properties": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", - "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.12.13" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } + "node_modules/@bufbuild/bundle-size": { + "resolved": "packages/bundle-size", + "link": true }, - "node_modules/@babel/plugin-syntax-import-meta": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", - "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", + "node_modules/@bufbuild/license-header": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/@bufbuild/license-header/-/license-header-0.0.4.tgz", + "integrity": "sha512-wOOrMjfLdDAO/BAKzCs/bvMPz61X3+qYC9nUbYxJYLVPFAlXus8aw2jNktyHEvLToCjOhn5EcpyaCpMzPHyHIQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.10.4" + "picomatch": "^2.3.1" }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "bin": { + "license-header": "command.mjs" } }, - "node_modules/@babel/plugin-syntax-json-strings": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", - "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } + "node_modules/@bufbuild/protobuf": { + "resolved": "packages/protobuf", + "link": true }, - "node_modules/@babel/plugin-syntax-jsx": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.24.7.tgz", - "integrity": "sha512-6ddciUPe/mpMnOKv/U+RSd2vvVy+Yw/JfBB0ZHYjEZt9NLHmCUylNYlsbqCCS1Bffjlb0fCwC9Vqz+sBz6PsiQ==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } + "node_modules/@bufbuild/protobuf-conformance": { + "resolved": "packages/protobuf-conformance", + "link": true }, - "node_modules/@babel/plugin-syntax-logical-assignment-operators": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", - "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.10.4" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } + "node_modules/@bufbuild/protobuf-example": { + "resolved": "packages/protobuf-example", + "link": true }, - "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", - "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } + "node_modules/@bufbuild/protobuf-test": { + "resolved": "packages/protobuf-test", + "link": true }, - "node_modules/@babel/plugin-syntax-numeric-separator": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", - "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.10.4" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } + "node_modules/@bufbuild/protoc-gen-es": { + "resolved": "packages/protoc-gen-es", + "link": true }, - "node_modules/@babel/plugin-syntax-object-rest-spread": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", - "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } + "node_modules/@bufbuild/protoplugin": { + "resolved": "packages/protoplugin", + "link": true }, - "node_modules/@babel/plugin-syntax-optional-catch-binding": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", - "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } + "node_modules/@bufbuild/protoplugin-example": { + "resolved": "packages/protoplugin-example", + "link": true }, - "node_modules/@babel/plugin-syntax-optional-chaining": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", - "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } + "node_modules/@bufbuild/protoplugin-test": { + "resolved": "packages/protoplugin-test", + "link": true }, - "node_modules/@babel/plugin-syntax-top-level-await": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", - "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", + "node_modules/@colors/colors": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", + "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" - }, + "license": "MIT", + "optional": true, "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "node": ">=0.1.90" } }, - "node_modules/@babel/plugin-syntax-typescript": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.24.7.tgz", - "integrity": "sha512-c/+fVeJBB0FeKsFvwytYiUD+LBvhHjGSI0g446PRGdSVGZLRNArBUno2PETbAly3tpiNAQR5XaZ+JslxkotsbA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" - }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.8.tgz", + "integrity": "sha512-urAvrUedIqEiFR3FYSLTWQgLu5tb+m0qZw0NBEasUeo6wuqatkMDaRT+1uABiGXEu5vqgPd7FGE1BhsAIy9QVA==", + "cpu": [ + "ppc64" + ], + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "node": ">=18" } }, - "node_modules/@babel/template": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.0.tgz", - "integrity": "sha512-aOOgh1/5XzKvg1jvVz7AVrx2piJ2XBi227DHmbY6y+bM9H2FlN+IfecYu4Xl0cNiiVejlsCri89LUsbj8vJD9Q==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.24.7", - "@babel/parser": "^7.25.0", - "@babel/types": "^7.25.0" - }, + "node_modules/@esbuild/android-arm": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.8.tgz", + "integrity": "sha512-RONsAvGCz5oWyePVnLdZY/HHwA++nxYWIX1atInlaW6SEkwq6XkP3+cb825EUcRs5Vss/lGh/2YxAb5xqc07Uw==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], "engines": { - "node": ">=6.9.0" + "node": ">=18" } }, - "node_modules/@babel/traverse": { - "version": "7.25.1", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.1.tgz", - "integrity": "sha512-LrHHoWq08ZpmmFqBAzN+hUdWwy5zt7FGa/hVwMcOqW6OVtwqaoD5utfuGYU87JYxdZgLUvktAsn37j/sYR9siA==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.24.7", - "@babel/generator": "^7.25.0", - "@babel/parser": "^7.25.0", - "@babel/template": "^7.25.0", - "@babel/types": "^7.25.0", - "debug": "^4.3.1", - "globals": "^11.1.0" - }, + "node_modules/@esbuild/android-arm64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.8.tgz", + "integrity": "sha512-OD3p7LYzWpLhZEyATcTSJ67qB5D+20vbtr6vHlHWSQYhKtzUYrETuWThmzFpZtFsBIxRvhO07+UgVA9m0i/O1w==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], "engines": { - "node": ">=6.9.0" + "node": ">=18" } }, - "node_modules/@babel/traverse/node_modules/globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true, + "node_modules/@esbuild/android-x64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.8.tgz", + "integrity": "sha512-yJAVPklM5+4+9dTeKwHOaA+LQkmrKFX96BM0A/2zQrbS6ENCmxc4OVoBs5dPkCCak2roAD+jKCdnmOqKszPkjA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], "engines": { - "node": ">=4" + "node": ">=18" } }, - "node_modules/@babel/types": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.0.tgz", - "integrity": "sha512-LcnxQSsd9aXOIgmmSpvZ/1yo46ra2ESYyqLcryaBZOghxy5qqOBjvCWP5JfkI8yl9rlxRgdLTTMCQQRcN2hdCg==", - "dev": true, - "dependencies": { - "@babel/helper-string-parser": "^7.24.8", - "@babel/helper-validator-identifier": "^7.24.7", - "to-fast-properties": "^2.0.0" - }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.8.tgz", + "integrity": "sha512-Jw0mxgIaYX6R8ODrdkLLPwBqHTtYHJSmzzd+QeytSugzQ0Vg4c5rDky5VgkoowbZQahCbsv1rT1KW72MPIkevw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=6.9.0" + "node": ">=18" } }, - "node_modules/@bcoe/v8-coverage": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", - "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", - "dev": true - }, - "node_modules/@biomejs/biome": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-1.9.4.tgz", - "integrity": "sha512-1rkd7G70+o9KkTn5KLmDYXihGoTaIGO9PIIN2ZB7UJxFrWw04CZHPYiMRjYsaDvVV7hP1dYNRLxSANLaBFGpog==", - "dev": true, - "hasInstallScript": true, - "license": "MIT OR Apache-2.0", - "bin": { - "biome": "bin/biome" - }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.8.tgz", + "integrity": "sha512-Vh2gLxxHnuoQ+GjPNvDSDRpoBCUzY4Pu0kBqMBDlK4fuWbKgGtmDIeEC081xi26PPjn+1tct+Bh8FjyLlw1Zlg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=14.21.3" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/biome" - }, - "optionalDependencies": { - "@biomejs/cli-darwin-arm64": "1.9.4", - "@biomejs/cli-darwin-x64": "1.9.4", - "@biomejs/cli-linux-arm64": "1.9.4", - "@biomejs/cli-linux-arm64-musl": "1.9.4", - "@biomejs/cli-linux-x64": "1.9.4", - "@biomejs/cli-linux-x64-musl": "1.9.4", - "@biomejs/cli-win32-arm64": "1.9.4", - "@biomejs/cli-win32-x64": "1.9.4" + "node": ">=18" } }, - "node_modules/@biomejs/cli-darwin-arm64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.9.4.tgz", - "integrity": "sha512-bFBsPWrNvkdKrNCYeAp+xo2HecOGPAy9WyNyB/jKnnedgzl4W4Hb9ZMzYNbf8dMCGmUdSavlYHiR01QaYR58cw==", + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.8.tgz", + "integrity": "sha512-YPJ7hDQ9DnNe5vxOm6jaie9QsTwcKedPvizTVlqWG9GBSq+BuyWEDazlGaDTC5NGU4QJd666V0yqCBL2oWKPfA==", "cpu": [ "arm64" ], - "dev": true, - "license": "MIT OR Apache-2.0", + "license": "MIT", "optional": true, "os": [ - "darwin" + "freebsd" ], "engines": { - "node": ">=14.21.3" + "node": ">=18" } }, - "node_modules/@biomejs/cli-darwin-x64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.9.4.tgz", - "integrity": "sha512-ngYBh/+bEedqkSevPVhLP4QfVPCpb+4BBe2p7Xs32dBgs7rh9nY2AIYUL6BgLw1JVXV8GlpKmb/hNiuIxfPfZg==", + "node_modules/@esbuild/freebsd-x64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.8.tgz", + "integrity": "sha512-MmaEXxQRdXNFsRN/KcIimLnSJrk2r5H8v+WVafRWz5xdSVmWLoITZQXcgehI2ZE6gioE6HirAEToM/RvFBeuhw==", "cpu": [ "x64" ], - "dev": true, - "license": "MIT OR Apache-2.0", + "license": "MIT", "optional": true, "os": [ - "darwin" + "freebsd" ], "engines": { - "node": ">=14.21.3" + "node": ">=18" } }, - "node_modules/@biomejs/cli-linux-arm64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.9.4.tgz", - "integrity": "sha512-fJIW0+LYujdjUgJJuwesP4EjIBl/N/TcOX3IvIHJQNsAqvV2CHIogsmA94BPG6jZATS4Hi+xv4SkBBQSt1N4/g==", + "node_modules/@esbuild/linux-arm": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.8.tgz", + "integrity": "sha512-FuzEP9BixzZohl1kLf76KEVOsxtIBFwCaLupVuk4eFVnOZfU+Wsn+x5Ryam7nILV2pkq2TqQM9EZPsOBuMC+kg==", "cpu": [ - "arm64" + "arm" ], - "dev": true, - "license": "MIT OR Apache-2.0", + "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=14.21.3" + "node": ">=18" } }, - "node_modules/@biomejs/cli-linux-arm64-musl": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.9.4.tgz", - "integrity": "sha512-v665Ct9WCRjGa8+kTr0CzApU0+XXtRgwmzIf1SeKSGAv+2scAlW6JR5PMFo6FzqqZ64Po79cKODKf3/AAmECqA==", + "node_modules/@esbuild/linux-arm64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.8.tgz", + "integrity": "sha512-WIgg00ARWv/uYLU7lsuDK00d/hHSfES5BzdWAdAig1ioV5kaFNrtK8EqGcUBJhYqotlUByUKz5Qo6u8tt7iD/w==", "cpu": [ "arm64" ], - "dev": true, - "license": "MIT OR Apache-2.0", + "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=14.21.3" + "node": ">=18" } }, - "node_modules/@biomejs/cli-linux-x64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-1.9.4.tgz", - "integrity": "sha512-lRCJv/Vi3Vlwmbd6K+oQ0KhLHMAysN8lXoCI7XeHlxaajk06u7G+UsFSO01NAs5iYuWKmVZjmiOzJ0OJmGsMwg==", + "node_modules/@esbuild/linux-ia32": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.8.tgz", + "integrity": "sha512-A1D9YzRX1i+1AJZuFFUMP1E9fMaYY+GnSQil9Tlw05utlE86EKTUA7RjwHDkEitmLYiFsRd9HwKBPEftNdBfjg==", "cpu": [ - "x64" + "ia32" ], - "dev": true, - "license": "MIT OR Apache-2.0", + "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=14.21.3" + "node": ">=18" } }, - "node_modules/@biomejs/cli-linux-x64-musl": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-1.9.4.tgz", - "integrity": "sha512-gEhi/jSBhZ2m6wjV530Yy8+fNqG8PAinM3oV7CyO+6c3CEh16Eizm21uHVsyVBEB6RIM8JHIl6AGYCv6Q6Q9Tg==", + "node_modules/@esbuild/linux-loong64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.8.tgz", + "integrity": "sha512-O7k1J/dwHkY1RMVvglFHl1HzutGEFFZ3kNiDMSOyUrB7WcoHGf96Sh+64nTRT26l3GMbCW01Ekh/ThKM5iI7hQ==", "cpu": [ - "x64" + "loong64" ], - "dev": true, - "license": "MIT OR Apache-2.0", + "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=14.21.3" + "node": ">=18" } }, - "node_modules/@biomejs/cli-win32-arm64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.9.4.tgz", - "integrity": "sha512-tlbhLk+WXZmgwoIKwHIHEBZUwxml7bRJgk0X2sPyNR3S93cdRq6XulAZRQJ17FYGGzWne0fgrXBKpl7l4M87Hg==", + "node_modules/@esbuild/linux-mips64el": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.8.tgz", + "integrity": "sha512-uv+dqfRazte3BzfMp8PAQXmdGHQt2oC/y2ovwpTteqrMx2lwaksiFZ/bdkXJC19ttTvNXBuWH53zy/aTj1FgGw==", "cpu": [ - "arm64" + "mips64el" ], - "dev": true, - "license": "MIT OR Apache-2.0", + "license": "MIT", "optional": true, "os": [ - "win32" + "linux" ], "engines": { - "node": ">=14.21.3" + "node": ">=18" } }, - "node_modules/@biomejs/cli-win32-x64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-1.9.4.tgz", - "integrity": "sha512-8Y5wMhVIPaWe6jw2H+KlEm4wP/f7EW3810ZLmDlrEEy5KvBsb9ECEfu/kMWD484ijfQ8+nIi0giMgu9g1UAuuA==", + "node_modules/@esbuild/linux-ppc64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.8.tgz", + "integrity": "sha512-GyG0KcMi1GBavP5JgAkkstMGyMholMDybAf8wF5A70CALlDM2p/f7YFE7H92eDeH/VBtFJA5MT4nRPDGg4JuzQ==", "cpu": [ - "x64" + "ppc64" ], - "dev": true, - "license": "MIT OR Apache-2.0", + "license": "MIT", "optional": true, "os": [ - "win32" + "linux" ], "engines": { - "node": ">=14.21.3" - } - }, - "node_modules/@braidai/lang": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@braidai/lang/-/lang-1.1.1.tgz", - "integrity": "sha512-5uM+no3i3DafVgkoW7ayPhEGHNNBZCSj5TrGDQt0ayEKQda5f3lAXlmQg0MR5E0gKgmTzUUEtSWHsEC3h9jUcg==", - "dev": true - }, - "node_modules/@bufbuild/buf": { - "version": "1.56.0", - "resolved": "https://registry.npmjs.org/@bufbuild/buf/-/buf-1.56.0.tgz", - "integrity": "sha512-1xQWOf3FCDDTi+5B/VScQ73EP6ACwQPCP4ODvCq2L6IVgFtvYX49ur6cQ2qCM8yFitIHESm/Nbff93sh+V/Iog==", - "hasInstallScript": true, - "license": "Apache-2.0", - "bin": { - "buf": "bin/buf", - "protoc-gen-buf-breaking": "bin/protoc-gen-buf-breaking", - "protoc-gen-buf-lint": "bin/protoc-gen-buf-lint" - }, - "engines": { - "node": ">=12" - }, - "optionalDependencies": { - "@bufbuild/buf-darwin-arm64": "1.56.0", - "@bufbuild/buf-darwin-x64": "1.56.0", - "@bufbuild/buf-linux-aarch64": "1.56.0", - "@bufbuild/buf-linux-armv7": "1.56.0", - "@bufbuild/buf-linux-x64": "1.56.0", - "@bufbuild/buf-win32-arm64": "1.56.0", - "@bufbuild/buf-win32-x64": "1.56.0" + "node": ">=18" } }, - "node_modules/@bufbuild/buf-darwin-arm64": { - "version": "1.56.0", - "resolved": "https://registry.npmjs.org/@bufbuild/buf-darwin-arm64/-/buf-darwin-arm64-1.56.0.tgz", - "integrity": "sha512-9neaI9gx1sxOGl9xrL7kw6H+0WmVAFlIQTIDc3vt1qRhfgOt/8AWOHSOWppGTRjNiB0qh6Xie1LYHv/jgDVN0g==", + "node_modules/@esbuild/linux-riscv64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.8.tgz", + "integrity": "sha512-rAqDYFv3yzMrq7GIcen3XP7TUEG/4LK86LUPMIz6RT8A6pRIDn0sDcvjudVZBiiTcZCY9y2SgYX2lgK3AF+1eg==", "cpu": [ - "arm64" + "riscv64" ], - "license": "Apache-2.0", + "license": "MIT", "optional": true, "os": [ - "darwin" + "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, - "node_modules/@bufbuild/buf-darwin-x64": { - "version": "1.56.0", - "resolved": "https://registry.npmjs.org/@bufbuild/buf-darwin-x64/-/buf-darwin-x64-1.56.0.tgz", - "integrity": "sha512-nRHPMXV8fr/lqU+u/1GGsUg7OvNcxJuCJoJpfRoRg38b+NPzOz2FkQAs5OEJzzprQB5aftn5//cl8YXjgvTuFA==", + "node_modules/@esbuild/linux-s390x": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.8.tgz", + "integrity": "sha512-Xutvh6VjlbcHpsIIbwY8GVRbwoviWT19tFhgdA7DlenLGC/mbc3lBoVb7jxj9Z+eyGqvcnSyIltYUrkKzWqSvg==", "cpu": [ - "x64" + "s390x" ], - "license": "Apache-2.0", + "license": "MIT", "optional": true, "os": [ - "darwin" + "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, - "node_modules/@bufbuild/buf-linux-aarch64": { - "version": "1.56.0", - "resolved": "https://registry.npmjs.org/@bufbuild/buf-linux-aarch64/-/buf-linux-aarch64-1.56.0.tgz", - "integrity": "sha512-+td559RuKNwYDnq49NrIDGJ4F73Ra4QzVVbsC+UeveA0HMnIGRzFbchGjHtNJyaZsI57sXJ7dCHH0iFV3jcYwQ==", + "node_modules/@esbuild/linux-x64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.8.tgz", + "integrity": "sha512-ASFQhgY4ElXh3nDcOMTkQero4b1lgubskNlhIfJrsH5OKZXDpUAKBlNS0Kx81jwOBp+HCeZqmoJuihTv57/jvQ==", "cpu": [ - "arm64" + "x64" ], - "license": "Apache-2.0", + "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, - "node_modules/@bufbuild/buf-linux-armv7": { - "version": "1.56.0", - "resolved": "https://registry.npmjs.org/@bufbuild/buf-linux-armv7/-/buf-linux-armv7-1.56.0.tgz", - "integrity": "sha512-9v3zmos6wRTBc4QeIg4rfDmPzmTgtUTRCbhr87qws/yddIT8cFtHHhy1whnozBNqtmYOdwZNBNx/QXqGGcRuKw==", + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.8.tgz", + "integrity": "sha512-d1KfruIeohqAi6SA+gENMuObDbEjn22olAR7egqnkCD9DGBG0wsEARotkLgXDu6c4ncgWTZJtN5vcgxzWRMzcw==", "cpu": [ - "arm" + "arm64" ], - "license": "Apache-2.0", + "license": "MIT", "optional": true, "os": [ - "linux" + "netbsd" ], "engines": { - "node": ">=12" + "node": ">=18" } }, - "node_modules/@bufbuild/buf-linux-x64": { - "version": "1.56.0", - "resolved": "https://registry.npmjs.org/@bufbuild/buf-linux-x64/-/buf-linux-x64-1.56.0.tgz", - "integrity": "sha512-3jZHHBol1fuichNke7LJtHJUdw314XBj6OuJHY6IufsaaVIj1mtM2DPbGiDhYB453J7FiV/buadctKBxAAHclg==", - "cpu": [ - "x64" - ], - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@bufbuild/buf-win32-arm64": { - "version": "1.56.0", - "resolved": "https://registry.npmjs.org/@bufbuild/buf-win32-arm64/-/buf-win32-arm64-1.56.0.tgz", - "integrity": "sha512-KMGzSf9rIbT01Jb2685JovwRRYEdL7Zbs6ZrjyhIHBgKK6cBwz1AJvEaDrWMEzCdv+opQwjgM6UdtA4e9BWP1A==", - "cpu": [ - "arm64" - ], - "license": "Apache-2.0", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@bufbuild/buf-win32-x64": { - "version": "1.56.0", - "resolved": "https://registry.npmjs.org/@bufbuild/buf-win32-x64/-/buf-win32-x64-1.56.0.tgz", - "integrity": "sha512-19LFOCyFFVTaaqNGtYTpiF67fcpneWZFlm8UNU+Xs87Kh+N5i/LjDjNytnpFT6snwU4/S+UUkq7WgS6UPjqXIg==", - "cpu": [ - "x64" - ], - "license": "Apache-2.0", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@bufbuild/bundle-size": { - "resolved": "packages/bundle-size", - "link": true - }, - "node_modules/@bufbuild/license-header": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/@bufbuild/license-header/-/license-header-0.0.4.tgz", - "integrity": "sha512-wOOrMjfLdDAO/BAKzCs/bvMPz61X3+qYC9nUbYxJYLVPFAlXus8aw2jNktyHEvLToCjOhn5EcpyaCpMzPHyHIQ==", - "dev": true, - "dependencies": { - "picomatch": "^2.3.1" - }, - "bin": { - "license-header": "command.mjs" - } - }, - "node_modules/@bufbuild/protobuf": { - "resolved": "packages/protobuf", - "link": true - }, - "node_modules/@bufbuild/protobuf-conformance": { - "resolved": "packages/protobuf-conformance", - "link": true - }, - "node_modules/@bufbuild/protobuf-example": { - "resolved": "packages/protobuf-example", - "link": true - }, - "node_modules/@bufbuild/protobuf-test": { - "resolved": "packages/protobuf-test", - "link": true - }, - "node_modules/@bufbuild/protoc-gen-es": { - "resolved": "packages/protoc-gen-es", - "link": true - }, - "node_modules/@bufbuild/protoplugin": { - "resolved": "packages/protoplugin", - "link": true - }, - "node_modules/@bufbuild/protoplugin-example": { - "resolved": "packages/protoplugin-example", - "link": true - }, - "node_modules/@bufbuild/protoplugin-test": { - "resolved": "packages/protoplugin-test", - "link": true - }, - "node_modules/@colors/colors": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", - "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=0.1.90" - } - }, - "node_modules/@esbuild/aix-ppc64": { - "version": "0.25.8", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.8.tgz", - "integrity": "sha512-urAvrUedIqEiFR3FYSLTWQgLu5tb+m0qZw0NBEasUeo6wuqatkMDaRT+1uABiGXEu5vqgPd7FGE1BhsAIy9QVA==", - "cpu": [ - "ppc64" - ], - "license": "MIT", - "optional": true, - "os": [ - "aix" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-arm": { + "node_modules/@esbuild/netbsd-x64": { "version": "0.25.8", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.8.tgz", - "integrity": "sha512-RONsAvGCz5oWyePVnLdZY/HHwA++nxYWIX1atInlaW6SEkwq6XkP3+cb825EUcRs5Vss/lGh/2YxAb5xqc07Uw==", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.8.tgz", + "integrity": "sha512-nVDCkrvx2ua+XQNyfrujIG38+YGyuy2Ru9kKVNyh5jAys6n+l44tTtToqHjino2My8VAY6Lw9H7RI73XFi66Cg==", "cpu": [ - "arm" + "x64" ], "license": "MIT", "optional": true, "os": [ - "android" + "netbsd" ], "engines": { "node": ">=18" } }, - "node_modules/@esbuild/android-arm64": { + "node_modules/@esbuild/openbsd-arm64": { "version": "0.25.8", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.8.tgz", - "integrity": "sha512-OD3p7LYzWpLhZEyATcTSJ67qB5D+20vbtr6vHlHWSQYhKtzUYrETuWThmzFpZtFsBIxRvhO07+UgVA9m0i/O1w==", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.8.tgz", + "integrity": "sha512-j8HgrDuSJFAujkivSMSfPQSAa5Fxbvk4rgNAS5i3K+r8s1X0p1uOO2Hl2xNsGFppOeHOLAVgYwDVlmxhq5h+SQ==", "cpu": [ "arm64" ], "license": "MIT", "optional": true, "os": [ - "android" + "openbsd" ], "engines": { "node": ">=18" } }, - "node_modules/@esbuild/android-x64": { + "node_modules/@esbuild/openbsd-x64": { "version": "0.25.8", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.8.tgz", - "integrity": "sha512-yJAVPklM5+4+9dTeKwHOaA+LQkmrKFX96BM0A/2zQrbS6ENCmxc4OVoBs5dPkCCak2roAD+jKCdnmOqKszPkjA==", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.8.tgz", + "integrity": "sha512-1h8MUAwa0VhNCDp6Af0HToI2TJFAn1uqT9Al6DJVzdIBAd21m/G0Yfc77KDM3uF3T/YaOgQq3qTJHPbTOInaIQ==", "cpu": [ "x64" ], "license": "MIT", "optional": true, "os": [ - "android" + "openbsd" ], "engines": { "node": ">=18" } }, - "node_modules/@esbuild/darwin-arm64": { + "node_modules/@esbuild/openharmony-arm64": { "version": "0.25.8", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.8.tgz", - "integrity": "sha512-Jw0mxgIaYX6R8ODrdkLLPwBqHTtYHJSmzzd+QeytSugzQ0Vg4c5rDky5VgkoowbZQahCbsv1rT1KW72MPIkevw==", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.8.tgz", + "integrity": "sha512-r2nVa5SIK9tSWd0kJd9HCffnDHKchTGikb//9c7HX+r+wHYCpQrSgxhlY6KWV1nFo1l4KFbsMlHk+L6fekLsUg==", "cpu": [ "arm64" ], "license": "MIT", "optional": true, "os": [ - "darwin" + "openharmony" ], "engines": { "node": ">=18" } }, - "node_modules/@esbuild/darwin-x64": { + "node_modules/@esbuild/sunos-x64": { "version": "0.25.8", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.8.tgz", - "integrity": "sha512-Vh2gLxxHnuoQ+GjPNvDSDRpoBCUzY4Pu0kBqMBDlK4fuWbKgGtmDIeEC081xi26PPjn+1tct+Bh8FjyLlw1Zlg==", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.8.tgz", + "integrity": "sha512-zUlaP2S12YhQ2UzUfcCuMDHQFJyKABkAjvO5YSndMiIkMimPmxA+BYSBikWgsRpvyxuRnow4nS5NPnf9fpv41w==", "cpu": [ "x64" ], "license": "MIT", "optional": true, "os": [ - "darwin" + "sunos" ], "engines": { "node": ">=18" } }, - "node_modules/@esbuild/freebsd-arm64": { + "node_modules/@esbuild/win32-arm64": { "version": "0.25.8", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.8.tgz", - "integrity": "sha512-YPJ7hDQ9DnNe5vxOm6jaie9QsTwcKedPvizTVlqWG9GBSq+BuyWEDazlGaDTC5NGU4QJd666V0yqCBL2oWKPfA==", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.8.tgz", + "integrity": "sha512-YEGFFWESlPva8hGL+zvj2z/SaK+pH0SwOM0Nc/d+rVnW7GSTFlLBGzZkuSU9kFIGIo8q9X3ucpZhu8PDN5A2sQ==", "cpu": [ "arm64" ], "license": "MIT", "optional": true, "os": [ - "freebsd" + "win32" ], "engines": { "node": ">=18" } }, - "node_modules/@esbuild/freebsd-x64": { + "node_modules/@esbuild/win32-ia32": { "version": "0.25.8", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.8.tgz", - "integrity": "sha512-MmaEXxQRdXNFsRN/KcIimLnSJrk2r5H8v+WVafRWz5xdSVmWLoITZQXcgehI2ZE6gioE6HirAEToM/RvFBeuhw==", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.8.tgz", + "integrity": "sha512-hiGgGC6KZ5LZz58OL/+qVVoZiuZlUYlYHNAmczOm7bs2oE1XriPFi5ZHHrS8ACpV5EjySrnoCKmcbQMN+ojnHg==", "cpu": [ - "x64" + "ia32" ], "license": "MIT", "optional": true, "os": [ - "freebsd" + "win32" ], "engines": { "node": ">=18" } }, - "node_modules/@esbuild/linux-arm": { + "node_modules/@esbuild/win32-x64": { "version": "0.25.8", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.8.tgz", - "integrity": "sha512-FuzEP9BixzZohl1kLf76KEVOsxtIBFwCaLupVuk4eFVnOZfU+Wsn+x5Ryam7nILV2pkq2TqQM9EZPsOBuMC+kg==", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.8.tgz", + "integrity": "sha512-cn3Yr7+OaaZq1c+2pe+8yxC8E144SReCQjN6/2ynubzYjvyqZjTXfQJpAcQpsdJq3My7XADANiYGHoFC69pLQw==", "cpu": [ - "arm" + "x64" ], "license": "MIT", "optional": true, "os": [ - "linux" + "win32" ], "engines": { "node": ">=18" } }, - "node_modules/@esbuild/linux-arm64": { - "version": "0.25.8", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.8.tgz", - "integrity": "sha512-WIgg00ARWv/uYLU7lsuDK00d/hHSfES5BzdWAdAig1ioV5kaFNrtK8EqGcUBJhYqotlUByUKz5Qo6u8tt7iD/w==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" + "node_modules/@loaderkit/resolve": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@loaderkit/resolve/-/resolve-1.0.4.tgz", + "integrity": "sha512-rJzYKVcV4dxJv+vW6jlvagF8zvGxHJ2+HTr1e2qOejfmGhAApgJHl8Aog4mMszxceTRiKTTbnpgmTO1bEZHV/A==", + "dev": true, + "license": "ISC", + "dependencies": { + "@braidai/lang": "^1.0.0" } }, - "node_modules/@esbuild/linux-ia32": { - "version": "0.25.8", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.8.tgz", - "integrity": "sha512-A1D9YzRX1i+1AJZuFFUMP1E9fMaYY+GnSQil9Tlw05utlE86EKTUA7RjwHDkEitmLYiFsRd9HwKBPEftNdBfjg==", - "cpu": [ - "ia32" - ], + "node_modules/@sindresorhus/is": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", + "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==", + "dev": true, "license": "MIT", - "optional": true, - "os": [ - "linux" - ], "engines": { - "node": ">=18" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/is?sponsor=1" } }, - "node_modules/@esbuild/linux-loong64": { - "version": "0.25.8", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.8.tgz", - "integrity": "sha512-O7k1J/dwHkY1RMVvglFHl1HzutGEFFZ3kNiDMSOyUrB7WcoHGf96Sh+64nTRT26l3GMbCW01Ekh/ThKM5iI7hQ==", - "cpu": [ - "loong64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" + "node_modules/@types/benchmark": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@types/benchmark/-/benchmark-2.1.5.tgz", + "integrity": "sha512-cKio2eFB3v7qmKcvIHLUMw/dIx/8bhWPuzpzRT4unCPRTD8VdA9Zb0afxpcxOqR4PixRS7yT42FqGS8BYL8g1w==" + }, + "node_modules/@types/brotli": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@types/brotli/-/brotli-1.3.4.tgz", + "integrity": "sha512-cKYjgaS2DMdCKF7R0F5cgx1nfBYObN2ihIuPGQ4/dlIY6RpV7OWNwe9L8V4tTVKL2eZqOkNM9FM/rgTvLf4oXw==", + "dependencies": { + "@types/node": "*" } }, - "node_modules/@esbuild/linux-mips64el": { - "version": "0.25.8", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.8.tgz", - "integrity": "sha512-uv+dqfRazte3BzfMp8PAQXmdGHQt2oC/y2ovwpTteqrMx2lwaksiFZ/bdkXJC19ttTvNXBuWH53zy/aTj1FgGw==", - "cpu": [ - "mips64el" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-ppc64": { - "version": "0.25.8", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.8.tgz", - "integrity": "sha512-GyG0KcMi1GBavP5JgAkkstMGyMholMDybAf8wF5A70CALlDM2p/f7YFE7H92eDeH/VBtFJA5MT4nRPDGg4JuzQ==", - "cpu": [ - "ppc64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-riscv64": { - "version": "0.25.8", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.8.tgz", - "integrity": "sha512-rAqDYFv3yzMrq7GIcen3XP7TUEG/4LK86LUPMIz6RT8A6pRIDn0sDcvjudVZBiiTcZCY9y2SgYX2lgK3AF+1eg==", - "cpu": [ - "riscv64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-s390x": { - "version": "0.25.8", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.8.tgz", - "integrity": "sha512-Xutvh6VjlbcHpsIIbwY8GVRbwoviWT19tFhgdA7DlenLGC/mbc3lBoVb7jxj9Z+eyGqvcnSyIltYUrkKzWqSvg==", - "cpu": [ - "s390x" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-x64": { - "version": "0.25.8", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.8.tgz", - "integrity": "sha512-ASFQhgY4ElXh3nDcOMTkQero4b1lgubskNlhIfJrsH5OKZXDpUAKBlNS0Kx81jwOBp+HCeZqmoJuihTv57/jvQ==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/netbsd-arm64": { - "version": "0.25.8", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.8.tgz", - "integrity": "sha512-d1KfruIeohqAi6SA+gENMuObDbEjn22olAR7egqnkCD9DGBG0wsEARotkLgXDu6c4ncgWTZJtN5vcgxzWRMzcw==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/netbsd-x64": { - "version": "0.25.8", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.8.tgz", - "integrity": "sha512-nVDCkrvx2ua+XQNyfrujIG38+YGyuy2Ru9kKVNyh5jAys6n+l44tTtToqHjino2My8VAY6Lw9H7RI73XFi66Cg==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openbsd-arm64": { - "version": "0.25.8", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.8.tgz", - "integrity": "sha512-j8HgrDuSJFAujkivSMSfPQSAa5Fxbvk4rgNAS5i3K+r8s1X0p1uOO2Hl2xNsGFppOeHOLAVgYwDVlmxhq5h+SQ==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openbsd-x64": { - "version": "0.25.8", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.8.tgz", - "integrity": "sha512-1h8MUAwa0VhNCDp6Af0HToI2TJFAn1uqT9Al6DJVzdIBAd21m/G0Yfc77KDM3uF3T/YaOgQq3qTJHPbTOInaIQ==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openharmony-arm64": { - "version": "0.25.8", - "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.8.tgz", - "integrity": "sha512-r2nVa5SIK9tSWd0kJd9HCffnDHKchTGikb//9c7HX+r+wHYCpQrSgxhlY6KWV1nFo1l4KFbsMlHk+L6fekLsUg==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "openharmony" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/sunos-x64": { - "version": "0.25.8", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.8.tgz", - "integrity": "sha512-zUlaP2S12YhQ2UzUfcCuMDHQFJyKABkAjvO5YSndMiIkMimPmxA+BYSBikWgsRpvyxuRnow4nS5NPnf9fpv41w==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-arm64": { - "version": "0.25.8", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.8.tgz", - "integrity": "sha512-YEGFFWESlPva8hGL+zvj2z/SaK+pH0SwOM0Nc/d+rVnW7GSTFlLBGzZkuSU9kFIGIo8q9X3ucpZhu8PDN5A2sQ==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-ia32": { - "version": "0.25.8", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.8.tgz", - "integrity": "sha512-hiGgGC6KZ5LZz58OL/+qVVoZiuZlUYlYHNAmczOm7bs2oE1XriPFi5ZHHrS8ACpV5EjySrnoCKmcbQMN+ojnHg==", - "cpu": [ - "ia32" - ], - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-x64": { - "version": "0.25.8", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.8.tgz", - "integrity": "sha512-cn3Yr7+OaaZq1c+2pe+8yxC8E144SReCQjN6/2ynubzYjvyqZjTXfQJpAcQpsdJq3My7XADANiYGHoFC69pLQw==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@istanbuljs/load-nyc-config": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", - "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", - "dev": true, - "dependencies": { - "camelcase": "^5.3.1", - "find-up": "^4.1.0", - "get-package-type": "^0.1.0", - "js-yaml": "^3.13.1", - "resolve-from": "^5.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "dependencies": { - "sprintf-js": "~1.0.2" - } - }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dev": true, - "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "dependencies": { - "p-locate": "^4.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "dependencies": { - "p-try": "^2.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "dependencies": { - "p-limit": "^2.2.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/@istanbuljs/schema": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", - "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/@jest/console": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.7.0.tgz", - "integrity": "sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==", - "dev": true, - "dependencies": { - "@jest/types": "^29.6.3", - "@types/node": "*", - "chalk": "^4.0.0", - "jest-message-util": "^29.7.0", - "jest-util": "^29.7.0", - "slash": "^3.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/core": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz", - "integrity": "sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==", - "dev": true, - "dependencies": { - "@jest/console": "^29.7.0", - "@jest/reporters": "^29.7.0", - "@jest/test-result": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/node": "*", - "ansi-escapes": "^4.2.1", - "chalk": "^4.0.0", - "ci-info": "^3.2.0", - "exit": "^0.1.2", - "graceful-fs": "^4.2.9", - "jest-changed-files": "^29.7.0", - "jest-config": "^29.7.0", - "jest-haste-map": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-regex-util": "^29.6.3", - "jest-resolve": "^29.7.0", - "jest-resolve-dependencies": "^29.7.0", - "jest-runner": "^29.7.0", - "jest-runtime": "^29.7.0", - "jest-snapshot": "^29.7.0", - "jest-util": "^29.7.0", - "jest-validate": "^29.7.0", - "jest-watcher": "^29.7.0", - "micromatch": "^4.0.4", - "pretty-format": "^29.7.0", - "slash": "^3.0.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" - }, - "peerDependenciesMeta": { - "node-notifier": { - "optional": true - } - } - }, - "node_modules/@jest/environment": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", - "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==", - "dev": true, - "dependencies": { - "@jest/fake-timers": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/node": "*", - "jest-mock": "^29.7.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/expect": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz", - "integrity": "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==", - "dev": true, - "dependencies": { - "expect": "^29.7.0", - "jest-snapshot": "^29.7.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/expect-utils": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz", - "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", - "dev": true, - "dependencies": { - "jest-get-type": "^29.6.3" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/fake-timers": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz", - "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==", - "dev": true, - "dependencies": { - "@jest/types": "^29.6.3", - "@sinonjs/fake-timers": "^10.0.2", - "@types/node": "*", - "jest-message-util": "^29.7.0", - "jest-mock": "^29.7.0", - "jest-util": "^29.7.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/globals": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz", - "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", - "dev": true, - "dependencies": { - "@jest/environment": "^29.7.0", - "@jest/expect": "^29.7.0", - "@jest/types": "^29.6.3", - "jest-mock": "^29.7.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/reporters": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz", - "integrity": "sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==", - "dev": true, - "dependencies": { - "@bcoe/v8-coverage": "^0.2.3", - "@jest/console": "^29.7.0", - "@jest/test-result": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", - "@jridgewell/trace-mapping": "^0.3.18", - "@types/node": "*", - "chalk": "^4.0.0", - "collect-v8-coverage": "^1.0.0", - "exit": "^0.1.2", - "glob": "^7.1.3", - "graceful-fs": "^4.2.9", - "istanbul-lib-coverage": "^3.0.0", - "istanbul-lib-instrument": "^6.0.0", - "istanbul-lib-report": "^3.0.0", - "istanbul-lib-source-maps": "^4.0.0", - "istanbul-reports": "^3.1.3", - "jest-message-util": "^29.7.0", - "jest-util": "^29.7.0", - "jest-worker": "^29.7.0", - "slash": "^3.0.0", - "string-length": "^4.0.1", - "strip-ansi": "^6.0.0", - "v8-to-istanbul": "^9.0.1" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" - }, - "peerDependenciesMeta": { - "node-notifier": { - "optional": true - } - } - }, - "node_modules/@jest/schemas": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", - "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", - "dev": true, - "dependencies": { - "@sinclair/typebox": "^0.27.8" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/source-map": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz", - "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==", - "dev": true, - "dependencies": { - "@jridgewell/trace-mapping": "^0.3.18", - "callsites": "^3.0.0", - "graceful-fs": "^4.2.9" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/test-result": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz", - "integrity": "sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==", - "dev": true, - "dependencies": { - "@jest/console": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "collect-v8-coverage": "^1.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/test-sequencer": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz", - "integrity": "sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==", - "dev": true, - "dependencies": { - "@jest/test-result": "^29.7.0", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.7.0", - "slash": "^3.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/transform": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", - "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", - "dev": true, - "dependencies": { - "@babel/core": "^7.11.6", - "@jest/types": "^29.6.3", - "@jridgewell/trace-mapping": "^0.3.18", - "babel-plugin-istanbul": "^6.1.1", - "chalk": "^4.0.0", - "convert-source-map": "^2.0.0", - "fast-json-stable-stringify": "^2.1.0", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.7.0", - "jest-regex-util": "^29.6.3", - "jest-util": "^29.7.0", - "micromatch": "^4.0.4", - "pirates": "^4.0.4", - "slash": "^3.0.0", - "write-file-atomic": "^4.0.2" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/types": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", - "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", - "dev": true, - "dependencies": { - "@jest/schemas": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^17.0.8", - "chalk": "^4.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", - "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", - "dev": true, - "dependencies": { - "@jridgewell/set-array": "^1.2.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.24" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", - "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", - "dev": true, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/set-array": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", - "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", - "dev": true, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", - "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", - "dev": true - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.25", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", - "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", - "dev": true, - "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" - } - }, - "node_modules/@loaderkit/resolve": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@loaderkit/resolve/-/resolve-1.0.4.tgz", - "integrity": "sha512-rJzYKVcV4dxJv+vW6jlvagF8zvGxHJ2+HTr1e2qOejfmGhAApgJHl8Aog4mMszxceTRiKTTbnpgmTO1bEZHV/A==", - "dev": true, - "license": "ISC", - "dependencies": { - "@braidai/lang": "^1.0.0" - } - }, - "node_modules/@sinclair/typebox": { - "version": "0.27.8", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", - "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", - "dev": true - }, - "node_modules/@sindresorhus/is": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", - "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sindresorhus/is?sponsor=1" - } - }, - "node_modules/@sinonjs/commons": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", - "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", - "dev": true, - "dependencies": { - "type-detect": "4.0.8" - } - }, - "node_modules/@sinonjs/fake-timers": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", - "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", - "dev": true, - "dependencies": { - "@sinonjs/commons": "^3.0.0" - } - }, - "node_modules/@types/babel__core": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", - "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", - "dev": true, - "dependencies": { - "@babel/parser": "^7.20.7", - "@babel/types": "^7.20.7", - "@types/babel__generator": "*", - "@types/babel__template": "*", - "@types/babel__traverse": "*" - } - }, - "node_modules/@types/babel__generator": { - "version": "7.6.8", - "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.8.tgz", - "integrity": "sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw==", - "dev": true, - "dependencies": { - "@babel/types": "^7.0.0" - } - }, - "node_modules/@types/babel__template": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", - "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", - "dev": true, - "dependencies": { - "@babel/parser": "^7.1.0", - "@babel/types": "^7.0.0" - } - }, - "node_modules/@types/babel__traverse": { - "version": "7.20.6", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.6.tgz", - "integrity": "sha512-r1bzfrm0tomOI8g1SzvCaQHo6Lcv6zu0EA+W2kHrt8dyrHQxGzBBL4kdkzIS+jBMV+EYcMAEAqXqYaLJq5rOZg==", - "dev": true, - "dependencies": { - "@babel/types": "^7.20.7" - } - }, - "node_modules/@types/benchmark": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@types/benchmark/-/benchmark-2.1.5.tgz", - "integrity": "sha512-cKio2eFB3v7qmKcvIHLUMw/dIx/8bhWPuzpzRT4unCPRTD8VdA9Zb0afxpcxOqR4PixRS7yT42FqGS8BYL8g1w==" - }, - "node_modules/@types/brotli": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/@types/brotli/-/brotli-1.3.4.tgz", - "integrity": "sha512-cKYjgaS2DMdCKF7R0F5cgx1nfBYObN2ihIuPGQ4/dlIY6RpV7OWNwe9L8V4tTVKL2eZqOkNM9FM/rgTvLf4oXw==", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/graceful-fs": { - "version": "4.1.9", - "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz", - "integrity": "sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/istanbul-lib-coverage": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", - "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", - "dev": true - }, - "node_modules/@types/istanbul-lib-report": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz", - "integrity": "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==", - "dev": true, - "dependencies": { - "@types/istanbul-lib-coverage": "*" - } - }, - "node_modules/@types/istanbul-reports": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz", - "integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==", - "dev": true, - "dependencies": { - "@types/istanbul-lib-report": "*" - } - }, - "node_modules/@types/node": { - "version": "24.1.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-24.1.0.tgz", - "integrity": "sha512-ut5FthK5moxFKH2T1CUOC6ctR67rQRvvHdFLCD2Ql6KXmMuCrjsSsRI9UsLCm9M18BMwClv4pn327UvB7eeO1w==", - "license": "MIT", - "dependencies": { - "undici-types": "~7.8.0" - } - }, - "node_modules/@types/stack-utils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", - "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==", - "dev": true - }, - "node_modules/@types/yargs": { - "version": "17.0.32", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.32.tgz", - "integrity": "sha512-xQ67Yc/laOG5uMfX/093MRlGGCIBzZMarVa+gfNKJxWAIgykYpVGkBdbqEzGDDfCrVUj6Hiff4mTZ5BA6TmAog==", - "dev": true, - "dependencies": { - "@types/yargs-parser": "*" - } - }, - "node_modules/@types/yargs-parser": { - "version": "21.0.3", - "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", - "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", - "dev": true - }, - "node_modules/@typescript/vfs": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@typescript/vfs/-/vfs-1.0.0.tgz", - "integrity": "sha512-Yyv2Ah7egLxs7TI2YPadkOQEJsREj8AOcXNdHRMAcRKGpD55iiLc7TsOd2WpqEuFF6oZO3U8xEJ9z+0N54sXhQ==", - "dependencies": { - "debug": "^4.1.1" - } - }, - "node_modules/0x": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/0x/-/0x-6.0.0.tgz", - "integrity": "sha512-4JrGHSPTaoEL3MZiKYH5BlNv67X2F48FmR3dKJZOoR/Z1CLVtVOwUb/n4PMf7B+sP9RPz+X50EbIFuwtfYguRQ==", - "license": "MIT", - "dependencies": { - "ajv": "^8.8.2", - "browserify": "^17.0.0", - "concat-stream": "^2.0.0", - "d3-fg": "^6.14.0", - "debounce": "^1.2.0", - "debug": "^4.1.1", - "end-of-stream": "^1.1.0", - "env-string": "^1.0.0", - "escape-string-regexp": "^4.0.0", - "execspawn": "^1.0.1", - "fs-extra": "^10.1.0", - "has-unicode": "^2.0.1", - "hsl-to-rgb-for-reals": "^1.1.0", - "jsonstream2": "^3.0.0", - "make-dir": "^3.1.0", - "minimist": "^1.2.0", - "morphdom": "^2.3.3", - "nanohtml": "^1.4.0", - "on-net-listen": "^1.1.0", - "opn": "^5.4.0", - "pump": "^3.0.0", - "pumpify": "^2.0.1", - "semver": "^7.3.5", - "single-line-log": "^1.0.1", - "split2": "^4.0.0", - "tachyons": "^4.9.1", - "through2": "^4.0.0", - "which": "^2.0.2" - }, - "bin": { - "0x": "cmd.js" - }, - "engines": { - "node": ">=8.5.0" - } - }, - "node_modules/0x/node_modules/ajv": { - "version": "8.17.1", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", - "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", - "dependencies": { - "fast-deep-equal": "^3.1.3", - "fast-uri": "^3.0.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/0x/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" - }, - "node_modules/0x/node_modules/make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "dependencies": { - "semver": "^6.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/0x/node_modules/make-dir/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/acorn-node": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/acorn-node/-/acorn-node-1.8.2.tgz", - "integrity": "sha512-8mt+fslDufLYntIoPAaIMUe/lrbrehIiwmR3t2k9LljIzoigEPF27eLk2hy8zSGzmR/ogr7zbRKINMo1u0yh5A==", - "dependencies": { - "acorn": "^7.0.0", - "acorn-walk": "^7.0.0", - "xtend": "^4.0.2" - } - }, - "node_modules/acorn-node/node_modules/acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-walk": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz", - "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==", - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/ansi-escapes": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", - "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", - "dev": true, - "dependencies": { - "type-fest": "^0.21.3" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/ansi-escapes/node_modules/type-fest": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/any-promise": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", - "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", - "dev": true, - "license": "MIT" - }, - "node_modules/anymatch": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", - "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", - "dev": true, - "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/asn1.js": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", - "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", - "dependencies": { - "bn.js": "^4.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" - } - }, - "node_modules/asn1.js/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" - }, - "node_modules/assert": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.1.tgz", - "integrity": "sha512-zzw1uCAgLbsKwBfFc8CX78DDg+xZeBksSO3vwVIDDN5i94eOrPsSSyiVhmsSABFDM/OcpE2aagCat9dnWQLG1A==", - "dependencies": { - "object.assign": "^4.1.4", - "util": "^0.10.4" - } - }, - "node_modules/assert/node_modules/inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==" - }, - "node_modules/assert/node_modules/util": { - "version": "0.10.4", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz", - "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==", - "dependencies": { - "inherits": "2.0.3" - } - }, - "node_modules/available-typed-arrays": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", - "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", - "dependencies": { - "possible-typed-array-names": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/babel-jest": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", - "integrity": "sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==", - "dev": true, - "dependencies": { - "@jest/transform": "^29.7.0", - "@types/babel__core": "^7.1.14", - "babel-plugin-istanbul": "^6.1.1", - "babel-preset-jest": "^29.6.3", - "chalk": "^4.0.0", - "graceful-fs": "^4.2.9", - "slash": "^3.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "@babel/core": "^7.8.0" - } - }, - "node_modules/babel-plugin-istanbul": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", - "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0", - "@istanbuljs/load-nyc-config": "^1.0.0", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-instrument": "^5.0.4", - "test-exclude": "^6.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", - "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", - "dev": true, - "dependencies": { - "@babel/core": "^7.12.3", - "@babel/parser": "^7.14.7", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-coverage": "^3.2.0", - "semver": "^6.3.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/babel-plugin-istanbul/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/babel-plugin-jest-hoist": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", - "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", - "dev": true, - "dependencies": { - "@babel/template": "^7.3.3", - "@babel/types": "^7.3.3", - "@types/babel__core": "^7.1.14", - "@types/babel__traverse": "^7.0.6" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/babel-preset-current-node-syntax": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz", - "integrity": "sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==", - "dev": true, - "dependencies": { - "@babel/plugin-syntax-async-generators": "^7.8.4", - "@babel/plugin-syntax-bigint": "^7.8.3", - "@babel/plugin-syntax-class-properties": "^7.8.3", - "@babel/plugin-syntax-import-meta": "^7.8.3", - "@babel/plugin-syntax-json-strings": "^7.8.3", - "@babel/plugin-syntax-logical-assignment-operators": "^7.8.3", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", - "@babel/plugin-syntax-numeric-separator": "^7.8.3", - "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", - "@babel/plugin-syntax-optional-chaining": "^7.8.3", - "@babel/plugin-syntax-top-level-await": "^7.8.3" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/babel-preset-jest": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", - "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", - "dev": true, - "dependencies": { - "babel-plugin-jest-hoist": "^29.6.3", - "babel-preset-current-node-syntax": "^1.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" - }, - "node_modules/base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/benchmark": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/benchmark/-/benchmark-2.1.4.tgz", - "integrity": "sha512-l9MlfN4M1K/H2fbhfMy3B7vJd6AGKJVQn2h6Sg/Yx+KckoUA7ewS5Vv6TjSq18ooE1kS9hhAlQRH3AkXIh/aOQ==", - "dependencies": { - "lodash": "^4.17.4", - "platform": "^1.3.3" - } - }, - "node_modules/bn.js": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", - "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" - }, - "node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/braces": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", - "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", - "dependencies": { - "fill-range": "^7.1.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/brorand": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==" - }, - "node_modules/brotli": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/brotli/-/brotli-1.3.3.tgz", - "integrity": "sha512-oTKjJdShmDuGW94SyyaoQvAjf30dZaHnjJ8uAF+u2/vGJkJbJPJAT1gDiOJP5v1Zb6f9KEyW/1HpuaWIXtGHPg==", - "dependencies": { - "base64-js": "^1.1.2" - } - }, - "node_modules/browser-pack": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/browser-pack/-/browser-pack-6.1.0.tgz", - "integrity": "sha512-erYug8XoqzU3IfcU8fUgyHqyOXqIE4tUTTQ+7mqUjQlvnXkOO6OlT9c/ZoJVHYoAaqGxr09CN53G7XIsO4KtWA==", - "dependencies": { - "combine-source-map": "~0.8.0", - "defined": "^1.0.0", - "JSONStream": "^1.0.3", - "safe-buffer": "^5.1.1", - "through2": "^2.0.0", - "umd": "^3.0.0" - }, - "bin": { - "browser-pack": "bin/cmd.js" - } - }, - "node_modules/browser-pack/node_modules/through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dependencies": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, - "node_modules/browser-process-hrtime": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz", - "integrity": "sha512-bRFnI4NnjO6cnyLmOV/7PVoDEMJChlcfN0z4s1YMBY989/SvlfMI1lgCnkFUs53e9gQF+w7qu7XdllSTiSl8Aw==" - }, - "node_modules/browser-resolve": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-2.0.0.tgz", - "integrity": "sha512-7sWsQlYL2rGLy2IWm8WL8DCTJvYLc/qlOnsakDac87SOoCd16WLsaAMdCiAqsTNHIe+SXfaqyxyo6THoWqs8WQ==", - "dependencies": { - "resolve": "^1.17.0" - } - }, - "node_modules/browserify": { - "version": "17.0.0", - "resolved": "https://registry.npmjs.org/browserify/-/browserify-17.0.0.tgz", - "integrity": "sha512-SaHqzhku9v/j6XsQMRxPyBrSP3gnwmE27gLJYZgMT2GeK3J0+0toN+MnuNYDfHwVGQfLiMZ7KSNSIXHemy905w==", - "dependencies": { - "assert": "^1.4.0", - "browser-pack": "^6.0.1", - "browser-resolve": "^2.0.0", - "browserify-zlib": "~0.2.0", - "buffer": "~5.2.1", - "cached-path-relative": "^1.0.0", - "concat-stream": "^1.6.0", - "console-browserify": "^1.1.0", - "constants-browserify": "~1.0.0", - "crypto-browserify": "^3.0.0", - "defined": "^1.0.0", - "deps-sort": "^2.0.1", - "domain-browser": "^1.2.0", - "duplexer2": "~0.1.2", - "events": "^3.0.0", - "glob": "^7.1.0", - "has": "^1.0.0", - "htmlescape": "^1.1.0", - "https-browserify": "^1.0.0", - "inherits": "~2.0.1", - "insert-module-globals": "^7.2.1", - "JSONStream": "^1.0.3", - "labeled-stream-splicer": "^2.0.0", - "mkdirp-classic": "^0.5.2", - "module-deps": "^6.2.3", - "os-browserify": "~0.3.0", - "parents": "^1.0.1", - "path-browserify": "^1.0.0", - "process": "~0.11.0", - "punycode": "^1.3.2", - "querystring-es3": "~0.2.0", - "read-only-stream": "^2.0.0", - "readable-stream": "^2.0.2", - "resolve": "^1.1.4", - "shasum-object": "^1.0.0", - "shell-quote": "^1.6.1", - "stream-browserify": "^3.0.0", - "stream-http": "^3.0.0", - "string_decoder": "^1.1.1", - "subarg": "^1.0.0", - "syntax-error": "^1.1.1", - "through2": "^2.0.0", - "timers-browserify": "^1.0.1", - "tty-browserify": "0.0.1", - "url": "~0.11.0", - "util": "~0.12.0", - "vm-browserify": "^1.0.0", - "xtend": "^4.0.0" - }, - "bin": { - "browserify": "bin/cmd.js" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/browserify-aes": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", - "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", - "dependencies": { - "buffer-xor": "^1.0.3", - "cipher-base": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.3", - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/browserify-cipher": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", - "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", - "dependencies": { - "browserify-aes": "^1.0.4", - "browserify-des": "^1.0.0", - "evp_bytestokey": "^1.0.0" - } - }, - "node_modules/browserify-des": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", - "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", - "dependencies": { - "cipher-base": "^1.0.1", - "des.js": "^1.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "node_modules/browserify-rsa": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.0.tgz", - "integrity": "sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog==", - "dependencies": { - "bn.js": "^5.0.0", - "randombytes": "^2.0.1" - } - }, - "node_modules/browserify-sign": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.3.tgz", - "integrity": "sha512-JWCZW6SKhfhjJxO8Tyiiy+XYB7cqd2S5/+WeYHsKdNKFlCBhKbblba1A/HN/90YwtxKc8tCErjffZl++UNmGiw==", - "dependencies": { - "bn.js": "^5.2.1", - "browserify-rsa": "^4.1.0", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "elliptic": "^6.5.5", - "hash-base": "~3.0", - "inherits": "^2.0.4", - "parse-asn1": "^5.1.7", - "readable-stream": "^2.3.8", - "safe-buffer": "^5.2.1" - }, - "engines": { - "node": ">= 0.12" - } - }, - "node_modules/browserify-zlib": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", - "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", - "dependencies": { - "pako": "~1.0.5" - } - }, - "node_modules/browserify/node_modules/concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "engines": [ - "node >= 0.8" - ], - "dependencies": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" - } - }, - "node_modules/browserify/node_modules/punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==" - }, - "node_modules/browserify/node_modules/through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dependencies": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, - "node_modules/browserslist": { - "version": "4.23.2", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.2.tgz", - "integrity": "sha512-qkqSyistMYdxAcw+CzbZwlBy8AGmS/eEWs+sEV5TnLRGDOL+C5M2EnH6tlZyg0YoAxGJAFKh61En9BR941GnHA==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "dependencies": { - "caniuse-lite": "^1.0.30001640", - "electron-to-chromium": "^1.4.820", - "node-releases": "^2.0.14", - "update-browserslist-db": "^1.1.0" - }, - "bin": { - "browserslist": "cli.js" - }, - "engines": { - "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" - } - }, - "node_modules/bser": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", - "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", - "dev": true, - "dependencies": { - "node-int64": "^0.4.0" - } - }, - "node_modules/buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.2.1.tgz", - "integrity": "sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg==", - "dependencies": { - "base64-js": "^1.0.2", - "ieee754": "^1.1.4" - } - }, - "node_modules/buffer-from": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" - }, - "node_modules/buffer-xor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==" - }, - "node_modules/builtin-status-codes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", - "integrity": "sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ==" - }, - "node_modules/cached-path-relative": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/cached-path-relative/-/cached-path-relative-1.1.0.tgz", - "integrity": "sha512-WF0LihfemtesFcJgO7xfOoOcnWzY/QHR4qeDqV44jPU3HTI54+LnfXK3SA27AVVGCdZFgjjFFaqUA9Jx7dMJZA==" - }, - "node_modules/call-bind": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", - "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", - "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "set-function-length": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/camel-case": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-3.0.0.tgz", - "integrity": "sha512-+MbKztAYHXPr1jNTSKQF52VpcFjwY5RkR7fxksV8Doo4KAYc5Fl4UJRgthBbTmEx8C54DqahhbLJkDwjI3PI/w==", - "dependencies": { - "no-case": "^2.2.0", - "upper-case": "^1.1.1" - } - }, - "node_modules/camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/caniuse-lite": { - "version": "1.0.30001643", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001643.tgz", - "integrity": "sha512-ERgWGNleEilSrHM6iUz/zJNSQTP8Mr21wDWpdgvRwcTXGAq6jMtOUPP4dqFPTdKqZ2wKTdtB+uucZ3MRpAUSmg==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/caniuse-lite" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ] - }, - "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/char-regex": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", - "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/ci-info": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", - "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/sibiraj-s" - } - ], - "engines": { - "node": ">=8" - } - }, - "node_modules/cipher-base": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", - "dependencies": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/cjs-module-lexer": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.3.1.tgz", - "integrity": "sha512-a3KdPAANPbNE4ZUv9h6LckSl9zLsYOP4MBmhIPkRaeyybt+r4UghLvq+xw/YwUcC1gqylCkL4rdVs3Lwupjm4Q==", - "dev": true - }, - "node_modules/cli-highlight": { - "version": "2.1.11", - "resolved": "https://registry.npmjs.org/cli-highlight/-/cli-highlight-2.1.11.tgz", - "integrity": "sha512-9KDcoEVwyUXrjcJNvHD0NFc/hiwe/WPVYIleQh2O1N2Zro5gWJZ/K+3DGn8w8P/F6FxOgzyC5bxDyHIgCSPhGg==", - "dev": true, - "license": "ISC", - "dependencies": { - "chalk": "^4.0.0", - "highlight.js": "^10.7.1", - "mz": "^2.4.0", - "parse5": "^5.1.1", - "parse5-htmlparser2-tree-adapter": "^6.0.0", - "yargs": "^16.0.0" - }, - "bin": { - "highlight": "bin/highlight" - }, - "engines": { - "node": ">=8.0.0", - "npm": ">=5.0.0" - } - }, - "node_modules/cli-highlight/node_modules/cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "dev": true, - "license": "ISC", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, - "node_modules/cli-highlight/node_modules/yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - "dev": true, + "node_modules/@types/node": { + "version": "24.1.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.1.0.tgz", + "integrity": "sha512-ut5FthK5moxFKH2T1CUOC6ctR67rQRvvHdFLCD2Ql6KXmMuCrjsSsRI9UsLCm9M18BMwClv4pn327UvB7eeO1w==", "license": "MIT", "dependencies": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - }, - "engines": { - "node": ">=10" + "undici-types": "~7.8.0" } }, - "node_modules/cli-highlight/node_modules/yargs-parser": { - "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=10" + "node_modules/@typescript/vfs": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@typescript/vfs/-/vfs-1.0.0.tgz", + "integrity": "sha512-Yyv2Ah7egLxs7TI2YPadkOQEJsREj8AOcXNdHRMAcRKGpD55iiLc7TsOd2WpqEuFF6oZO3U8xEJ9z+0N54sXhQ==", + "dependencies": { + "debug": "^4.1.1" } }, - "node_modules/cli-table3": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.5.tgz", - "integrity": "sha512-+W/5efTR7y5HRD7gACw9yQjqMVvEMLBHmboM/kPWam+H+Hmyrgjh6YncVKK122YZkXrLudzTuAukUw9FnMf7IQ==", - "dev": true, + "node_modules/0x": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/0x/-/0x-6.0.0.tgz", + "integrity": "sha512-4JrGHSPTaoEL3MZiKYH5BlNv67X2F48FmR3dKJZOoR/Z1CLVtVOwUb/n4PMf7B+sP9RPz+X50EbIFuwtfYguRQ==", "license": "MIT", "dependencies": { - "string-width": "^4.2.0" - }, - "engines": { - "node": "10.* || >= 12.*" + "ajv": "^8.8.2", + "browserify": "^17.0.0", + "concat-stream": "^2.0.0", + "d3-fg": "^6.14.0", + "debounce": "^1.2.0", + "debug": "^4.1.1", + "end-of-stream": "^1.1.0", + "env-string": "^1.0.0", + "escape-string-regexp": "^4.0.0", + "execspawn": "^1.0.1", + "fs-extra": "^10.1.0", + "has-unicode": "^2.0.1", + "hsl-to-rgb-for-reals": "^1.1.0", + "jsonstream2": "^3.0.0", + "make-dir": "^3.1.0", + "minimist": "^1.2.0", + "morphdom": "^2.3.3", + "nanohtml": "^1.4.0", + "on-net-listen": "^1.1.0", + "opn": "^5.4.0", + "pump": "^3.0.0", + "pumpify": "^2.0.1", + "semver": "^7.3.5", + "single-line-log": "^1.0.1", + "split2": "^4.0.0", + "tachyons": "^4.9.1", + "through2": "^4.0.0", + "which": "^2.0.2" }, - "optionalDependencies": { - "@colors/colors": "1.5.0" - } - }, - "node_modules/cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "dev": true, - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" + "bin": { + "0x": "cmd.js" }, "engines": { - "node": ">=12" - } - }, - "node_modules/co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", - "dev": true, - "engines": { - "iojs": ">= 1.0.0", - "node": ">= 0.12.0" - } - }, - "node_modules/code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA==", - "engines": { - "node": ">=0.10.0" + "node": ">=8.5.0" } }, - "node_modules/collect-v8-coverage": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz", - "integrity": "sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==", - "dev": true - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, + "node_modules/0x/node_modules/ajv": { + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", + "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", "dependencies": { - "color-name": "~1.1.4" + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/combine-source-map": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.8.0.tgz", - "integrity": "sha512-UlxQ9Vw0b/Bt/KYwCFqdEwsQ1eL8d1gibiFb7lxQJFdvTgc2hIZi6ugsg+kyhzhPV+QEpUiEIwInIAIrgoEkrg==", - "dependencies": { - "convert-source-map": "~1.1.0", - "inline-source-map": "~0.6.0", - "lodash.memoize": "~3.0.3", - "source-map": "~0.5.3" - } - }, - "node_modules/combine-source-map/node_modules/convert-source-map": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", - "integrity": "sha512-Y8L5rp6jo+g9VEPgvqNfEopjTR4OTYct8lXlS8iVQdmnjDvbdbzYe9rjtFCB9egC86JoNCU61WRY+ScjkZpnIg==" - }, - "node_modules/combine-source-map/node_modules/source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/commander": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", - "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", - "dev": true, - "engines": { - "node": ">=14" + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" - }, - "node_modules/concat-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", - "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==", - "engines": [ - "node >= 6.0" - ], - "dependencies": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^3.0.2", - "typedarray": "^0.0.6" - } + "node_modules/0x/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" }, - "node_modules/concat-stream/node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "node_modules/0x/node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" + "semver": "^6.0.0" }, "engines": { - "node": ">= 6" - } - }, - "node_modules/console-browserify": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz", - "integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==" - }, - "node_modules/constants-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", - "integrity": "sha512-xFxOwqIzR/e1k1gLiWEophSCMqXcwVHIH7akf7b/vxcUeGunlj3hvZaaqxwHsTgn+IndtkQJgSztIDWeumWJDQ==" - }, - "node_modules/convert-source-map": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", - "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", - "dev": true - }, - "node_modules/core-util-is": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" - }, - "node_modules/create-ecdh": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", - "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", - "dependencies": { - "bn.js": "^4.1.0", - "elliptic": "^6.5.3" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/create-ecdh/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" - }, - "node_modules/create-hash": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", - "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", - "dependencies": { - "cipher-base": "^1.0.1", - "inherits": "^2.0.1", - "md5.js": "^1.3.4", - "ripemd160": "^2.0.1", - "sha.js": "^2.4.0" + "node_modules/0x/node_modules/make-dir/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "bin": { + "semver": "bin/semver.js" } }, - "node_modules/create-hmac": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", - "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "node_modules/acorn-node": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/acorn-node/-/acorn-node-1.8.2.tgz", + "integrity": "sha512-8mt+fslDufLYntIoPAaIMUe/lrbrehIiwmR3t2k9LljIzoigEPF27eLk2hy8zSGzmR/ogr7zbRKINMo1u0yh5A==", "dependencies": { - "cipher-base": "^1.0.3", - "create-hash": "^1.1.0", - "inherits": "^2.0.1", - "ripemd160": "^2.0.0", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" + "acorn": "^7.0.0", + "acorn-walk": "^7.0.0", + "xtend": "^4.0.2" } }, - "node_modules/create-jest": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz", - "integrity": "sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==", - "dev": true, - "dependencies": { - "@jest/types": "^29.6.3", - "chalk": "^4.0.0", - "exit": "^0.1.2", - "graceful-fs": "^4.2.9", - "jest-config": "^29.7.0", - "jest-util": "^29.7.0", - "prompts": "^2.0.1" - }, + "node_modules/acorn-node/node_modules/acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", "bin": { - "create-jest": "bin/create-jest.js" + "acorn": "bin/acorn" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=0.4.0" + } + }, + "node_modules/acorn-walk": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz", + "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==", + "engines": { + "node": ">=0.4.0" } }, - "node_modules/cross-spawn": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", - "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, - "license": "MIT", - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, "engines": { - "node": ">= 8" + "node": ">=8" } }, - "node_modules/crypto-browserify": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", - "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, "dependencies": { - "browserify-cipher": "^1.0.0", - "browserify-sign": "^4.0.0", - "create-ecdh": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.0", - "diffie-hellman": "^5.0.0", - "inherits": "^2.0.1", - "pbkdf2": "^3.0.3", - "public-encrypt": "^4.0.0", - "randombytes": "^2.0.0", - "randomfill": "^1.0.3" + "color-convert": "^2.0.1" }, "engines": { - "node": "*" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/d3-array": { - "version": "2.12.1", - "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-2.12.1.tgz", - "integrity": "sha512-B0ErZK/66mHtEsR1TkPEEkwdy+WDesimkM5gpZr5Dsg54BiTA5RXtYW5qTLIAcekaS9xfZrzBLF/OAkB3Qn1YQ==", + "node_modules/any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", + "dev": true, + "license": "MIT" + }, + "node_modules/asn1.js": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", + "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", "dependencies": { - "internmap": "^1.0.0" + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" } }, - "node_modules/d3-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-2.0.0.tgz", - "integrity": "sha512-SPXi0TSKPD4g9tw0NMZFnR95XVgUZiBH+uUTqQuDu1OsE2zomHU7ho0FISciaPvosimixwHFl3WHLGabv6dDgQ==" - }, - "node_modules/d3-dispatch": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-1.0.6.tgz", - "integrity": "sha512-fVjoElzjhCEy+Hbn8KygnmMS7Or0a9sI2UzGwoB7cCtvI1XpVN9GpoYlnb3xt2YV66oXYb1fLJ8GMvP4hdU1RA==" + "node_modules/asn1.js/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" }, - "node_modules/d3-drag": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/d3-drag/-/d3-drag-1.2.5.tgz", - "integrity": "sha512-rD1ohlkKQwMZYkQlYVCrSFxsWPzI97+W+PaEIBNTMxRuxz9RF0Hi5nJWHGVJ3Om9d2fRTe1yOBINJyy/ahV95w==", + "node_modules/assert": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.1.tgz", + "integrity": "sha512-zzw1uCAgLbsKwBfFc8CX78DDg+xZeBksSO3vwVIDDN5i94eOrPsSSyiVhmsSABFDM/OcpE2aagCat9dnWQLG1A==", "dependencies": { - "d3-dispatch": "1", - "d3-selection": "1" + "object.assign": "^4.1.4", + "util": "^0.10.4" } }, - "node_modules/d3-ease": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-1.0.7.tgz", - "integrity": "sha512-lx14ZPYkhNx0s/2HX5sLFUI3mbasHjSSpwO/KaaNACweVwxUruKyWVcb293wMv1RqTPZyZ8kSZ2NogUZNcLOFQ==" + "node_modules/assert/node_modules/inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==" }, - "node_modules/d3-fg": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/d3-fg/-/d3-fg-6.14.0.tgz", - "integrity": "sha512-M4QpFZOEvAq4ZDzwabJp2inL+KXS85T2SQl00zWwjnolaCJR+gHxUbT7Ha4GxTeW1NXwzbykhv/38I1fxQqbyg==", + "node_modules/assert/node_modules/util": { + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz", + "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==", "dependencies": { - "d3-array": "^2.2.0", - "d3-dispatch": "^1.0.5", - "d3-ease": "^1.0.5", - "d3-hierarchy": "^1.1.8", - "d3-scale": "^3.0.0", - "d3-selection": "^1.4.0", - "d3-zoom": "^1.7.3", - "escape-string-regexp": "^1.0.5", - "hsl-to-rgb-for-reals": "^1.1.0" + "inherits": "2.0.3" } }, - "node_modules/d3-fg/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "node_modules/available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, "engines": { - "node": ">=0.8.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/d3-format": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-2.0.0.tgz", - "integrity": "sha512-Ab3S6XuE/Q+flY96HXT0jOXcM4EAClYFnRGY5zsjRGNy6qCYrQsMffs7cV5Q9xejb35zxW5hf/guKw34kvIKsA==" - }, - "node_modules/d3-hierarchy": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/d3-hierarchy/-/d3-hierarchy-1.1.9.tgz", - "integrity": "sha512-j8tPxlqh1srJHAtxfvOUwKNYJkQuBFdM1+JAUfq6xqH5eAqf93L7oG1NVqDa4CpFZNvnNKtCYEUC8KY9yEn9lQ==" + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, - "node_modules/d3-interpolate": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-2.0.1.tgz", - "integrity": "sha512-c5UhwwTs/yybcmTpAVqwSFl6vrQ8JZJoT5F7xNFK9pymv5C0Ymcc9/LIJHtYIggg/yS9YHw8i8O8tgb9pupjeQ==", - "dependencies": { - "d3-color": "1 - 2" - } + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] }, - "node_modules/d3-scale": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-3.3.0.tgz", - "integrity": "sha512-1JGp44NQCt5d1g+Yy+GeOnZP7xHo0ii8zsQp6PGzd+C1/dl0KGsp9A7Mxwp+1D1o4unbTTxVdU/ZOIEBoeZPbQ==", + "node_modules/benchmark": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/benchmark/-/benchmark-2.1.4.tgz", + "integrity": "sha512-l9MlfN4M1K/H2fbhfMy3B7vJd6AGKJVQn2h6Sg/Yx+KckoUA7ewS5Vv6TjSq18ooE1kS9hhAlQRH3AkXIh/aOQ==", "dependencies": { - "d3-array": "^2.3.0", - "d3-format": "1 - 2", - "d3-interpolate": "1.2.0 - 2", - "d3-time": "^2.1.1", - "d3-time-format": "2 - 3" + "lodash": "^4.17.4", + "platform": "^1.3.3" } }, - "node_modules/d3-selection": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-1.4.2.tgz", - "integrity": "sha512-SJ0BqYihzOjDnnlfyeHT0e30k0K1+5sR3d5fNueCNeuhZTnGw4M4o8mqJchSwgKMXCNFo+e2VTChiSJ0vYtXkg==" - }, - "node_modules/d3-time": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-2.1.1.tgz", - "integrity": "sha512-/eIQe/eR4kCQwq7yxi7z4c6qEXf2IYGcjoWB5OOQy4Tq9Uv39/947qlDcN2TLkiTzQWzvnsuYPB9TrWaNfipKQ==", - "dependencies": { - "d3-array": "2" - } + "node_modules/bn.js": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" }, - "node_modules/d3-time-format": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-3.0.0.tgz", - "integrity": "sha512-UXJh6EKsHBTjopVqZBhFysQcoXSv/5yLONZvkQ5Kk3qbwiUYkdX17Xa1PT6U1ZWXGGfB1ey5L8dKMlFq2DO0Ag==", + "node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "license": "MIT", "dependencies": { - "d3-time": "1 - 2" + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, - "node_modules/d3-timer": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-1.0.10.tgz", - "integrity": "sha512-B1JDm0XDaQC+uvo4DT79H0XmBskgS3l6Ve+1SBCfxgmtIb1AVrPIoqd+nPSv+loMX8szQ0sVUhGngL7D5QPiXw==" - }, - "node_modules/d3-transition": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/d3-transition/-/d3-transition-1.3.2.tgz", - "integrity": "sha512-sc0gRU4PFqZ47lPVHloMn9tlPcv8jxgOQg+0zjhfZXMQuvppjG6YuwdMBE0TuqCZjeJkLecku/l9R0JPcRhaDA==", + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dependencies": { - "d3-color": "1", - "d3-dispatch": "1", - "d3-ease": "1", - "d3-interpolate": "1", - "d3-selection": "^1.1.0", - "d3-timer": "1" + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" } }, - "node_modules/d3-transition/node_modules/d3-color": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-1.4.1.tgz", - "integrity": "sha512-p2sTHSLCJI2QKunbGb7ocOh7DgTAn8IrLx21QRc/BSnodXM4sv6aLQlnfpvehFMLZEfBc6g9pH9SWQccFYfJ9Q==" + "node_modules/brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==" }, - "node_modules/d3-transition/node_modules/d3-interpolate": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-1.4.0.tgz", - "integrity": "sha512-V9znK0zc3jOPV4VD2zZn0sDhZU3WAE2bmlxdIwwQPPzPjvyLkd8B3JUVdS1IDUFDkWZ72c9qnv1GK2ZagTZ8EA==", + "node_modules/brotli": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/brotli/-/brotli-1.3.3.tgz", + "integrity": "sha512-oTKjJdShmDuGW94SyyaoQvAjf30dZaHnjJ8uAF+u2/vGJkJbJPJAT1gDiOJP5v1Zb6f9KEyW/1HpuaWIXtGHPg==", "dependencies": { - "d3-color": "1" + "base64-js": "^1.1.2" } }, - "node_modules/d3-zoom": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/d3-zoom/-/d3-zoom-1.8.3.tgz", - "integrity": "sha512-VoLXTK4wvy1a0JpH2Il+F2CiOhVu7VRXWF5M/LroMIh3/zBAC3WAt7QoIvPibOavVo20hN6/37vwAsdBejLyKQ==", + "node_modules/browser-pack": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/browser-pack/-/browser-pack-6.1.0.tgz", + "integrity": "sha512-erYug8XoqzU3IfcU8fUgyHqyOXqIE4tUTTQ+7mqUjQlvnXkOO6OlT9c/ZoJVHYoAaqGxr09CN53G7XIsO4KtWA==", "dependencies": { - "d3-dispatch": "1", - "d3-drag": "1", - "d3-interpolate": "1", - "d3-selection": "1", - "d3-transition": "1" + "combine-source-map": "~0.8.0", + "defined": "^1.0.0", + "JSONStream": "^1.0.3", + "safe-buffer": "^5.1.1", + "through2": "^2.0.0", + "umd": "^3.0.0" + }, + "bin": { + "browser-pack": "bin/cmd.js" } }, - "node_modules/d3-zoom/node_modules/d3-color": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-1.4.1.tgz", - "integrity": "sha512-p2sTHSLCJI2QKunbGb7ocOh7DgTAn8IrLx21QRc/BSnodXM4sv6aLQlnfpvehFMLZEfBc6g9pH9SWQccFYfJ9Q==" - }, - "node_modules/d3-zoom/node_modules/d3-interpolate": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-1.4.0.tgz", - "integrity": "sha512-V9znK0zc3jOPV4VD2zZn0sDhZU3WAE2bmlxdIwwQPPzPjvyLkd8B3JUVdS1IDUFDkWZ72c9qnv1GK2ZagTZ8EA==", + "node_modules/browser-pack/node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", "dependencies": { - "d3-color": "1" + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" } }, - "node_modules/dash-ast": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/dash-ast/-/dash-ast-1.0.0.tgz", - "integrity": "sha512-Vy4dx7gquTeMcQR/hDkYLGUnwVil6vk4FOOct+djUnHOUWt+zJPJAaRIXaAFkPXtJjvlY7o3rfRu0/3hpnwoUA==" + "node_modules/browser-process-hrtime": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz", + "integrity": "sha512-bRFnI4NnjO6cnyLmOV/7PVoDEMJChlcfN0z4s1YMBY989/SvlfMI1lgCnkFUs53e9gQF+w7qu7XdllSTiSl8Aw==" }, - "node_modules/debounce": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/debounce/-/debounce-1.2.1.tgz", - "integrity": "sha512-XRRe6Glud4rd/ZGQfiV1ruXSfbvfJedlV9Y6zOlP+2K04vBYiJEte6stfFkCP03aMnY5tsipamumUjL14fofug==" + "node_modules/browser-resolve": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-2.0.0.tgz", + "integrity": "sha512-7sWsQlYL2rGLy2IWm8WL8DCTJvYLc/qlOnsakDac87SOoCd16WLsaAMdCiAqsTNHIe+SXfaqyxyo6THoWqs8WQ==", + "dependencies": { + "resolve": "^1.17.0" + } }, - "node_modules/debug": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", - "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", - "license": "MIT", + "node_modules/browserify": { + "version": "17.0.0", + "resolved": "https://registry.npmjs.org/browserify/-/browserify-17.0.0.tgz", + "integrity": "sha512-SaHqzhku9v/j6XsQMRxPyBrSP3gnwmE27gLJYZgMT2GeK3J0+0toN+MnuNYDfHwVGQfLiMZ7KSNSIXHemy905w==", "dependencies": { - "ms": "^2.1.3" + "assert": "^1.4.0", + "browser-pack": "^6.0.1", + "browser-resolve": "^2.0.0", + "browserify-zlib": "~0.2.0", + "buffer": "~5.2.1", + "cached-path-relative": "^1.0.0", + "concat-stream": "^1.6.0", + "console-browserify": "^1.1.0", + "constants-browserify": "~1.0.0", + "crypto-browserify": "^3.0.0", + "defined": "^1.0.0", + "deps-sort": "^2.0.1", + "domain-browser": "^1.2.0", + "duplexer2": "~0.1.2", + "events": "^3.0.0", + "glob": "^7.1.0", + "has": "^1.0.0", + "htmlescape": "^1.1.0", + "https-browserify": "^1.0.0", + "inherits": "~2.0.1", + "insert-module-globals": "^7.2.1", + "JSONStream": "^1.0.3", + "labeled-stream-splicer": "^2.0.0", + "mkdirp-classic": "^0.5.2", + "module-deps": "^6.2.3", + "os-browserify": "~0.3.0", + "parents": "^1.0.1", + "path-browserify": "^1.0.0", + "process": "~0.11.0", + "punycode": "^1.3.2", + "querystring-es3": "~0.2.0", + "read-only-stream": "^2.0.0", + "readable-stream": "^2.0.2", + "resolve": "^1.1.4", + "shasum-object": "^1.0.0", + "shell-quote": "^1.6.1", + "stream-browserify": "^3.0.0", + "stream-http": "^3.0.0", + "string_decoder": "^1.1.1", + "subarg": "^1.0.0", + "syntax-error": "^1.1.1", + "through2": "^2.0.0", + "timers-browserify": "^1.0.1", + "tty-browserify": "0.0.1", + "url": "~0.11.0", + "util": "~0.12.0", + "vm-browserify": "^1.0.0", + "xtend": "^4.0.0" }, - "engines": { - "node": ">=6.0" + "bin": { + "browserify": "bin/cmd.js" }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "engines": { + "node": ">= 0.8" } }, - "node_modules/dedent": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.5.3.tgz", - "integrity": "sha512-NHQtfOOW68WD8lgypbLA5oT+Bt0xXJhiYvoR6SmmNXZfpzOGXwdKWmcwG8N7PwVVWV3eF/68nmD9BaJSsTBhyQ==", - "dev": true, - "peerDependencies": { - "babel-plugin-macros": "^3.1.0" - }, - "peerDependenciesMeta": { - "babel-plugin-macros": { - "optional": true - } + "node_modules/browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "dependencies": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" } }, - "node_modules/deepmerge": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", - "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", - "dev": true, - "engines": { - "node": ">=0.10.0" + "node_modules/browserify-cipher": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", + "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", + "dependencies": { + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" } }, - "node_modules/define-data-property": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", - "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "node_modules/browserify-des": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", + "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "gopd": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" } }, - "node_modules/define-properties": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", - "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "node_modules/browserify-rsa": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.0.tgz", + "integrity": "sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog==", "dependencies": { - "define-data-property": "^1.0.1", - "has-property-descriptors": "^1.0.0", - "object-keys": "^1.1.1" + "bn.js": "^5.0.0", + "randombytes": "^2.0.1" + } + }, + "node_modules/browserify-sign": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.3.tgz", + "integrity": "sha512-JWCZW6SKhfhjJxO8Tyiiy+XYB7cqd2S5/+WeYHsKdNKFlCBhKbblba1A/HN/90YwtxKc8tCErjffZl++UNmGiw==", + "dependencies": { + "bn.js": "^5.2.1", + "browserify-rsa": "^4.1.0", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "elliptic": "^6.5.5", + "hash-base": "~3.0", + "inherits": "^2.0.4", + "parse-asn1": "^5.1.7", + "readable-stream": "^2.3.8", + "safe-buffer": "^5.2.1" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">= 0.12" } }, - "node_modules/defined": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.1.tgz", - "integrity": "sha512-hsBd2qSVCRE+5PmNdHt1uzyrFu5d3RwmFDKzyNZMFq/EwDNJF7Ee5+D5oEKF0hU6LhtoUF1macFvOe4AskQC1Q==", - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node_modules/browserify-zlib": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", + "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", + "dependencies": { + "pako": "~1.0.5" } }, - "node_modules/deps-sort": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/deps-sort/-/deps-sort-2.0.1.tgz", - "integrity": "sha512-1orqXQr5po+3KI6kQb9A4jnXT1PBwggGl2d7Sq2xsnOeI9GPcE/tGcF9UiSZtZBM7MukY4cAh7MemS6tZYipfw==", + "node_modules/browserify/node_modules/concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "engines": [ + "node >= 0.8" + ], "dependencies": { - "JSONStream": "^1.0.3", - "shasum-object": "^1.0.0", - "subarg": "^1.0.0", - "through2": "^2.0.0" - }, - "bin": { - "deps-sort": "bin/cmd.js" + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" } }, - "node_modules/deps-sort/node_modules/through2": { + "node_modules/browserify/node_modules/punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==" + }, + "node_modules/browserify/node_modules/through2": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", @@ -3441,1698 +1405,1414 @@ "xtend": "~4.0.1" } }, - "node_modules/des.js": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.1.0.tgz", - "integrity": "sha512-r17GxjhUCjSRy8aiJpr8/UadFIzMzJGexI3Nmz4ADi9LYSFx4gTBp80+NaX/YsXWWLhpZ7v/v/ubEc/bCNfKwg==", + "node_modules/buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.2.1.tgz", + "integrity": "sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg==", "dependencies": { - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" + "base64-js": "^1.0.2", + "ieee754": "^1.1.4" } }, - "node_modules/detect-newline": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", - "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", - "dev": true, - "engines": { - "node": ">=8" - } + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" }, - "node_modules/detective": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/detective/-/detective-5.2.1.tgz", - "integrity": "sha512-v9XE1zRnz1wRtgurGu0Bs8uHKFSTdteYZNbIPFVhUZ39L/S79ppMpdmVOZAnoz1jfEFodc48n6MX483Xo3t1yw==", + "node_modules/buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==" + }, + "node_modules/builtin-status-codes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", + "integrity": "sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ==" + }, + "node_modules/cached-path-relative": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/cached-path-relative/-/cached-path-relative-1.1.0.tgz", + "integrity": "sha512-WF0LihfemtesFcJgO7xfOoOcnWzY/QHR4qeDqV44jPU3HTI54+LnfXK3SA27AVVGCdZFgjjFFaqUA9Jx7dMJZA==" + }, + "node_modules/call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", "dependencies": { - "acorn-node": "^1.8.2", - "defined": "^1.0.0", - "minimist": "^1.2.6" - }, - "bin": { - "detective": "bin/detective.js" + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" }, "engines": { - "node": ">=0.8.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/dexnode": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/dexnode/-/dexnode-1.2.2.tgz", - "integrity": "sha512-L+rnDz6kO/taBvaRfkKei8X66wEAtfbqNp6l8VOWH67CYQbds3Oq+Z0xdBckkwREis1qcBp9cKA6JrHNeJ3DZQ==", + "node_modules/camel-case": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-3.0.0.tgz", + "integrity": "sha512-+MbKztAYHXPr1jNTSKQF52VpcFjwY5RkR7fxksV8Doo4KAYc5Fl4UJRgthBbTmEx8C54DqahhbLJkDwjI3PI/w==", "dependencies": { - "semver": "^7.3.8", - "winreg": "^1.2.4" - }, - "bin": { - "dexnode": "bin/dexnode.js" + "no-case": "^2.2.0", + "upper-case": "^1.1.1" } }, - "node_modules/diff-sequences": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", - "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/diffie-hellman": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", - "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", "dependencies": { - "bn.js": "^4.1.0", - "miller-rabin": "^4.0.0", - "randombytes": "^2.0.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/diffie-hellman/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" - }, - "node_modules/domain-browser": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", - "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", + "node_modules/char-regex": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", + "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", + "dev": true, "engines": { - "node": ">=0.4", - "npm": ">=1.2" + "node": ">=10" } }, - "node_modules/duplexer2": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", - "integrity": "sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA==", + "node_modules/cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", "dependencies": { - "readable-stream": "^2.0.2" + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" } }, - "node_modules/duplexify": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-4.1.3.tgz", - "integrity": "sha512-M3BmBhwJRZsSx38lZyhE53Csddgzl5R7xGJNk7CVddZD6CcmwMCH8J+7AprIrQKH7TonKxaCjcv27Qmf+sQ+oA==", - "dependencies": { - "end-of-stream": "^1.4.1", - "inherits": "^2.0.3", - "readable-stream": "^3.1.1", - "stream-shift": "^1.0.2" - } + "node_modules/cjs-module-lexer": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.3.1.tgz", + "integrity": "sha512-a3KdPAANPbNE4ZUv9h6LckSl9zLsYOP4MBmhIPkRaeyybt+r4UghLvq+xw/YwUcC1gqylCkL4rdVs3Lwupjm4Q==", + "dev": true }, - "node_modules/duplexify/node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "node_modules/cli-highlight": { + "version": "2.1.11", + "resolved": "https://registry.npmjs.org/cli-highlight/-/cli-highlight-2.1.11.tgz", + "integrity": "sha512-9KDcoEVwyUXrjcJNvHD0NFc/hiwe/WPVYIleQh2O1N2Zro5gWJZ/K+3DGn8w8P/F6FxOgzyC5bxDyHIgCSPhGg==", + "dev": true, + "license": "ISC", "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" + "chalk": "^4.0.0", + "highlight.js": "^10.7.1", + "mz": "^2.4.0", + "parse5": "^5.1.1", + "parse5-htmlparser2-tree-adapter": "^6.0.0", + "yargs": "^16.0.0" + }, + "bin": { + "highlight": "bin/highlight" }, "engines": { - "node": ">= 6" + "node": ">=8.0.0", + "npm": ">=5.0.0" } }, - "node_modules/electron-to-chromium": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.2.tgz", - "integrity": "sha512-kc4r3U3V3WLaaZqThjYz/Y6z8tJe+7K0bbjUVo3i+LWIypVdMx5nXCkwRe6SWbY6ILqLdc1rKcKmr3HoH7wjSQ==", - "dev": true - }, - "node_modules/elliptic": { - "version": "6.6.1", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.6.1.tgz", - "integrity": "sha512-RaddvvMatK2LJHqFJ+YA4WysVN5Ita9E35botqIYspQ4TkRAlCicdzKOjlyv/1Za5RyTNn7di//eEV0uTAfe3g==", - "license": "MIT", + "node_modules/cli-highlight/node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "license": "ISC", "dependencies": { - "bn.js": "^4.11.9", - "brorand": "^1.1.0", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.1", - "inherits": "^2.0.4", - "minimalistic-assert": "^1.0.1", - "minimalistic-crypto-utils": "^1.0.1" + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" } }, - "node_modules/elliptic/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" - }, - "node_modules/emittery": { - "version": "0.13.1", - "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz", - "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", + "node_modules/cli-highlight/node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", "dev": true, - "engines": { - "node": ">=12" + "license": "MIT", + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" }, - "funding": { - "url": "https://github.com/sindresorhus/emittery?sponsor=1" + "engines": { + "node": ">=10" } }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "node_modules/emojilib": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/emojilib/-/emojilib-2.4.0.tgz", - "integrity": "sha512-5U0rVMU5Y2n2+ykNLQqMoqklN9ICBT/KsvC1Gz6vqHbz2AXXGkG+Pm5rMWk/8Vjrr/mY9985Hi8DYzn1F09Nyw==", + "node_modules/cli-highlight/node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", "dev": true, - "license": "MIT" - }, - "node_modules/end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "dependencies": { - "once": "^1.4.0" + "license": "ISC", + "engines": { + "node": ">=10" } }, - "node_modules/env-string": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/env-string/-/env-string-1.0.1.tgz", - "integrity": "sha512-/DhCJDf5DSFK32joQiWRpWrT0h7p3hVQfMKxiBb7Nt8C8IF8BYyPtclDnuGGLOoj16d/8udKeiE7JbkotDmorQ==" - }, - "node_modules/environment": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/environment/-/environment-1.1.0.tgz", - "integrity": "sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==", + "node_modules/cli-table3": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.5.tgz", + "integrity": "sha512-+W/5efTR7y5HRD7gACw9yQjqMVvEMLBHmboM/kPWam+H+Hmyrgjh6YncVKK122YZkXrLudzTuAukUw9FnMf7IQ==", "dev": true, "license": "MIT", + "dependencies": { + "string-width": "^4.2.0" + }, "engines": { - "node": ">=18" + "node": "10.* || >= 12.*" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "optionalDependencies": { + "@colors/colors": "1.5.0" } }, - "node_modules/error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, - "dependencies": { - "is-arrayish": "^0.2.1" + "node_modules/code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA==", + "engines": { + "node": ">=0.10.0" } }, - "node_modules/es-define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", - "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, "dependencies": { - "get-intrinsic": "^1.2.4" + "color-name": "~1.1.4" }, "engines": { - "node": ">= 0.4" + "node": ">=7.0.0" } }, - "node_modules/es-errors": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "engines": { - "node": ">= 0.4" + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/combine-source-map": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.8.0.tgz", + "integrity": "sha512-UlxQ9Vw0b/Bt/KYwCFqdEwsQ1eL8d1gibiFb7lxQJFdvTgc2hIZi6ugsg+kyhzhPV+QEpUiEIwInIAIrgoEkrg==", + "dependencies": { + "convert-source-map": "~1.1.0", + "inline-source-map": "~0.6.0", + "lodash.memoize": "~3.0.3", + "source-map": "~0.5.3" } }, - "node_modules/esbuild": { - "version": "0.25.8", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.8.tgz", - "integrity": "sha512-vVC0USHGtMi8+R4Kz8rt6JhEWLxsv9Rnu/lGYbPR8u47B+DCBksq9JarW0zOO7bs37hyOK1l2/oqtbciutL5+Q==", - "hasInstallScript": true, - "license": "MIT", - "bin": { - "esbuild": "bin/esbuild" - }, + "node_modules/combine-source-map/node_modules/convert-source-map": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", + "integrity": "sha512-Y8L5rp6jo+g9VEPgvqNfEopjTR4OTYct8lXlS8iVQdmnjDvbdbzYe9rjtFCB9egC86JoNCU61WRY+ScjkZpnIg==" + }, + "node_modules/combine-source-map/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", "engines": { - "node": ">=18" - }, - "optionalDependencies": { - "@esbuild/aix-ppc64": "0.25.8", - "@esbuild/android-arm": "0.25.8", - "@esbuild/android-arm64": "0.25.8", - "@esbuild/android-x64": "0.25.8", - "@esbuild/darwin-arm64": "0.25.8", - "@esbuild/darwin-x64": "0.25.8", - "@esbuild/freebsd-arm64": "0.25.8", - "@esbuild/freebsd-x64": "0.25.8", - "@esbuild/linux-arm": "0.25.8", - "@esbuild/linux-arm64": "0.25.8", - "@esbuild/linux-ia32": "0.25.8", - "@esbuild/linux-loong64": "0.25.8", - "@esbuild/linux-mips64el": "0.25.8", - "@esbuild/linux-ppc64": "0.25.8", - "@esbuild/linux-riscv64": "0.25.8", - "@esbuild/linux-s390x": "0.25.8", - "@esbuild/linux-x64": "0.25.8", - "@esbuild/netbsd-arm64": "0.25.8", - "@esbuild/netbsd-x64": "0.25.8", - "@esbuild/openbsd-arm64": "0.25.8", - "@esbuild/openbsd-x64": "0.25.8", - "@esbuild/openharmony-arm64": "0.25.8", - "@esbuild/sunos-x64": "0.25.8", - "@esbuild/win32-arm64": "0.25.8", - "@esbuild/win32-ia32": "0.25.8", - "@esbuild/win32-x64": "0.25.8" + "node": ">=0.10.0" } }, - "node_modules/escalade": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", - "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", + "node_modules/commander": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", + "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", "dev": true, "engines": { - "node": ">=6" + "node": ">=14" } }, - "node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "node_modules/concat-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", + "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==", + "engines": [ + "node >= 6.0" + ], + "dependencies": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.0.2", + "typedarray": "^0.0.6" } }, - "node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true, - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" + "node_modules/concat-stream/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" }, "engines": { - "node": ">=4" + "node": ">= 6" } }, - "node_modules/estree-is-member-expression": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/estree-is-member-expression/-/estree-is-member-expression-1.0.0.tgz", - "integrity": "sha512-Ec+X44CapIGExvSZN+pGkmr5p7HwUVQoPQSd458Lqwvaf4/61k/invHSh4BYK8OXnCkfEhWuIoG5hayKLQStIg==" + "node_modules/console-browserify": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz", + "integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==" }, - "node_modules/events": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", - "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", - "engines": { - "node": ">=0.8.x" - } + "node_modules/constants-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", + "integrity": "sha512-xFxOwqIzR/e1k1gLiWEophSCMqXcwVHIH7akf7b/vxcUeGunlj3hvZaaqxwHsTgn+IndtkQJgSztIDWeumWJDQ==" }, - "node_modules/evp_bytestokey": { + "node_modules/core-util-is": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", - "dependencies": { - "md5.js": "^1.3.4", - "safe-buffer": "^5.1.1" - } + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" }, - "node_modules/execa": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", - "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", - "dev": true, + "node_modules/create-ecdh": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", + "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.0", - "human-signals": "^2.1.0", - "is-stream": "^2.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.1", - "onetime": "^5.1.2", - "signal-exit": "^3.0.3", - "strip-final-newline": "^2.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" + "bn.js": "^4.1.0", + "elliptic": "^6.5.3" } }, - "node_modules/execspawn": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/execspawn/-/execspawn-1.0.1.tgz", - "integrity": "sha512-s2k06Jy9i8CUkYe0+DxRlvtkZoOkwwfhB+Xxo5HGUtrISVW2m98jO2tr67DGRFxZwkjQqloA3v/tNtjhBRBieg==", + "node_modules/create-ecdh/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, + "node_modules/create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", "dependencies": { - "util-extend": "^1.0.1" + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" } }, - "node_modules/exit": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", - "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==", - "dev": true, - "engines": { - "node": ">= 0.8.0" + "node_modules/create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dependencies": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" } }, - "node_modules/expect": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", - "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", - "dev": true, + "node_modules/crypto-browserify": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", "dependencies": { - "@jest/expect-utils": "^29.7.0", - "jest-get-type": "^29.6.3", - "jest-matcher-utils": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-util": "^29.7.0" + "browserify-cipher": "^1.0.0", + "browserify-sign": "^4.0.0", + "create-ecdh": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.0", + "diffie-hellman": "^5.0.0", + "inherits": "^2.0.1", + "pbkdf2": "^3.0.3", + "public-encrypt": "^4.0.0", + "randombytes": "^2.0.0", + "randomfill": "^1.0.3" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "*" } }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true + "node_modules/d3-array": { + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-2.12.1.tgz", + "integrity": "sha512-B0ErZK/66mHtEsR1TkPEEkwdy+WDesimkM5gpZr5Dsg54BiTA5RXtYW5qTLIAcekaS9xfZrzBLF/OAkB3Qn1YQ==", + "dependencies": { + "internmap": "^1.0.0" + } }, - "node_modules/fast-safe-stringify": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", - "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==" + "node_modules/d3-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-2.0.0.tgz", + "integrity": "sha512-SPXi0TSKPD4g9tw0NMZFnR95XVgUZiBH+uUTqQuDu1OsE2zomHU7ho0FISciaPvosimixwHFl3WHLGabv6dDgQ==" }, - "node_modules/fast-uri": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.1.tgz", - "integrity": "sha512-MWipKbbYiYI0UC7cl8m/i/IWTqfC8YXsqjzybjddLsFjStroQzsHXkc73JutMvBiXmOvapk+axIl79ig5t55Bw==" + "node_modules/d3-dispatch": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-1.0.6.tgz", + "integrity": "sha512-fVjoElzjhCEy+Hbn8KygnmMS7Or0a9sI2UzGwoB7cCtvI1XpVN9GpoYlnb3xt2YV66oXYb1fLJ8GMvP4hdU1RA==" }, - "node_modules/fb-watchman": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", - "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", - "dev": true, + "node_modules/d3-drag": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/d3-drag/-/d3-drag-1.2.5.tgz", + "integrity": "sha512-rD1ohlkKQwMZYkQlYVCrSFxsWPzI97+W+PaEIBNTMxRuxz9RF0Hi5nJWHGVJ3Om9d2fRTe1yOBINJyy/ahV95w==", "dependencies": { - "bser": "2.1.1" + "d3-dispatch": "1", + "d3-selection": "1" } }, - "node_modules/fflate": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.2.tgz", - "integrity": "sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==" + "node_modules/d3-ease": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-1.0.7.tgz", + "integrity": "sha512-lx14ZPYkhNx0s/2HX5sLFUI3mbasHjSSpwO/KaaNACweVwxUruKyWVcb293wMv1RqTPZyZ8kSZ2NogUZNcLOFQ==" }, - "node_modules/fill-range": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "node_modules/d3-fg": { + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/d3-fg/-/d3-fg-6.14.0.tgz", + "integrity": "sha512-M4QpFZOEvAq4ZDzwabJp2inL+KXS85T2SQl00zWwjnolaCJR+gHxUbT7Ha4GxTeW1NXwzbykhv/38I1fxQqbyg==", "dependencies": { - "to-regex-range": "^5.0.1" - }, + "d3-array": "^2.2.0", + "d3-dispatch": "^1.0.5", + "d3-ease": "^1.0.5", + "d3-hierarchy": "^1.1.8", + "d3-scale": "^3.0.0", + "d3-selection": "^1.4.0", + "d3-zoom": "^1.7.3", + "escape-string-regexp": "^1.0.5", + "hsl-to-rgb-for-reals": "^1.1.0" + } + }, + "node_modules/d3-fg/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "engines": { - "node": ">=8" + "node": ">=0.8.0" } }, - "node_modules/for-each": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", - "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "node_modules/d3-format": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-2.0.0.tgz", + "integrity": "sha512-Ab3S6XuE/Q+flY96HXT0jOXcM4EAClYFnRGY5zsjRGNy6qCYrQsMffs7cV5Q9xejb35zxW5hf/guKw34kvIKsA==" + }, + "node_modules/d3-hierarchy": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/d3-hierarchy/-/d3-hierarchy-1.1.9.tgz", + "integrity": "sha512-j8tPxlqh1srJHAtxfvOUwKNYJkQuBFdM1+JAUfq6xqH5eAqf93L7oG1NVqDa4CpFZNvnNKtCYEUC8KY9yEn9lQ==" + }, + "node_modules/d3-interpolate": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-2.0.1.tgz", + "integrity": "sha512-c5UhwwTs/yybcmTpAVqwSFl6vrQ8JZJoT5F7xNFK9pymv5C0Ymcc9/LIJHtYIggg/yS9YHw8i8O8tgb9pupjeQ==", "dependencies": { - "is-callable": "^1.1.3" + "d3-color": "1 - 2" } }, - "node_modules/fs-extra": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", - "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "node_modules/d3-scale": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-3.3.0.tgz", + "integrity": "sha512-1JGp44NQCt5d1g+Yy+GeOnZP7xHo0ii8zsQp6PGzd+C1/dl0KGsp9A7Mxwp+1D1o4unbTTxVdU/ZOIEBoeZPbQ==", "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=12" + "d3-array": "^2.3.0", + "d3-format": "1 - 2", + "d3-interpolate": "1.2.0 - 2", + "d3-time": "^2.1.1", + "d3-time-format": "2 - 3" } }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + "node_modules/d3-selection": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-1.4.2.tgz", + "integrity": "sha512-SJ0BqYihzOjDnnlfyeHT0e30k0K1+5sR3d5fNueCNeuhZTnGw4M4o8mqJchSwgKMXCNFo+e2VTChiSJ0vYtXkg==" }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + "node_modules/d3-time": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-2.1.1.tgz", + "integrity": "sha512-/eIQe/eR4kCQwq7yxi7z4c6qEXf2IYGcjoWB5OOQy4Tq9Uv39/947qlDcN2TLkiTzQWzvnsuYPB9TrWaNfipKQ==", + "dependencies": { + "d3-array": "2" } }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node_modules/d3-time-format": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-3.0.0.tgz", + "integrity": "sha512-UXJh6EKsHBTjopVqZBhFysQcoXSv/5yLONZvkQ5Kk3qbwiUYkdX17Xa1PT6U1ZWXGGfB1ey5L8dKMlFq2DO0Ag==", + "dependencies": { + "d3-time": "1 - 2" } }, - "node_modules/gensync": { - "version": "1.0.0-beta.2", - "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", - "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", - "dev": true, - "engines": { - "node": ">=6.9.0" + "node_modules/d3-timer": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-1.0.10.tgz", + "integrity": "sha512-B1JDm0XDaQC+uvo4DT79H0XmBskgS3l6Ve+1SBCfxgmtIb1AVrPIoqd+nPSv+loMX8szQ0sVUhGngL7D5QPiXw==" + }, + "node_modules/d3-transition": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/d3-transition/-/d3-transition-1.3.2.tgz", + "integrity": "sha512-sc0gRU4PFqZ47lPVHloMn9tlPcv8jxgOQg+0zjhfZXMQuvppjG6YuwdMBE0TuqCZjeJkLecku/l9R0JPcRhaDA==", + "dependencies": { + "d3-color": "1", + "d3-dispatch": "1", + "d3-ease": "1", + "d3-interpolate": "1", + "d3-selection": "^1.1.0", + "d3-timer": "1" } }, - "node_modules/get-assigned-identifiers": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/get-assigned-identifiers/-/get-assigned-identifiers-1.2.0.tgz", - "integrity": "sha512-mBBwmeGTrxEMO4pMaaf/uUEFHnYtwr8FTe8Y/mer4rcV/bye0qGm6pw1bGZFGStxC5O76c5ZAVBGnqHmOaJpdQ==" + "node_modules/d3-transition/node_modules/d3-color": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-1.4.1.tgz", + "integrity": "sha512-p2sTHSLCJI2QKunbGb7ocOh7DgTAn8IrLx21QRc/BSnodXM4sv6aLQlnfpvehFMLZEfBc6g9pH9SWQccFYfJ9Q==" }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true, - "engines": { - "node": "6.* || 8.* || >= 10.*" + "node_modules/d3-transition/node_modules/d3-interpolate": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-1.4.0.tgz", + "integrity": "sha512-V9znK0zc3jOPV4VD2zZn0sDhZU3WAE2bmlxdIwwQPPzPjvyLkd8B3JUVdS1IDUFDkWZ72c9qnv1GK2ZagTZ8EA==", + "dependencies": { + "d3-color": "1" } }, - "node_modules/get-intrinsic": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", - "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "node_modules/d3-zoom": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/d3-zoom/-/d3-zoom-1.8.3.tgz", + "integrity": "sha512-VoLXTK4wvy1a0JpH2Il+F2CiOhVu7VRXWF5M/LroMIh3/zBAC3WAt7QoIvPibOavVo20hN6/37vwAsdBejLyKQ==", "dependencies": { - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "d3-dispatch": "1", + "d3-drag": "1", + "d3-interpolate": "1", + "d3-selection": "1", + "d3-transition": "1" } }, - "node_modules/get-package-type": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", - "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", - "dev": true, - "engines": { - "node": ">=8.0.0" - } + "node_modules/d3-zoom/node_modules/d3-color": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-1.4.1.tgz", + "integrity": "sha512-p2sTHSLCJI2QKunbGb7ocOh7DgTAn8IrLx21QRc/BSnodXM4sv6aLQlnfpvehFMLZEfBc6g9pH9SWQccFYfJ9Q==" }, - "node_modules/get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node_modules/d3-zoom/node_modules/d3-interpolate": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-1.4.0.tgz", + "integrity": "sha512-V9znK0zc3jOPV4VD2zZn0sDhZU3WAE2bmlxdIwwQPPzPjvyLkd8B3JUVdS1IDUFDkWZ72c9qnv1GK2ZagTZ8EA==", + "dependencies": { + "d3-color": "1" } }, - "node_modules/get-tsconfig": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.10.0.tgz", - "integrity": "sha512-kGzZ3LWWQcGIAmg6iWvXn0ei6WDtV26wzHRMwDSzmAbcXrTEXxHy6IehI6/4eT6VRKyMP1eF1VqwrVUmE/LR7A==", + "node_modules/dash-ast": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/dash-ast/-/dash-ast-1.0.0.tgz", + "integrity": "sha512-Vy4dx7gquTeMcQR/hDkYLGUnwVil6vk4FOOct+djUnHOUWt+zJPJAaRIXaAFkPXtJjvlY7o3rfRu0/3hpnwoUA==" + }, + "node_modules/debounce": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/debounce/-/debounce-1.2.1.tgz", + "integrity": "sha512-XRRe6Glud4rd/ZGQfiV1ruXSfbvfJedlV9Y6zOlP+2K04vBYiJEte6stfFkCP03aMnY5tsipamumUjL14fofug==" + }, + "node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "license": "MIT", "dependencies": { - "resolve-pkg-maps": "^1.0.0" + "ms": "^2.1.3" }, - "funding": { - "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, - "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "deprecated": "Glob versions prior to v9 are no longer supported", + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" }, "engines": { - "node": "*" + "node": ">= 0.4" }, "funding": { - "url": "https://github.com/sponsors/isaacs" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/glob/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", "dependencies": { - "brace-expansion": "^1.1.7" + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" }, "engines": { - "node": "*" - } - }, - "node_modules/google-protobuf": { - "version": "3.21.4", - "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.21.4.tgz", - "integrity": "sha512-MnG7N936zcKTco4Jd2PX2U96Kf9PxygAPKBug+74LHzmHXmceN16MmRcdgZv+DGef/S9YvQAfRsNCn4cjf9yyQ==", - "license": "(BSD-3-Clause AND Apache-2.0)" - }, - "node_modules/gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "dependencies": { - "get-intrinsic": "^1.1.3" + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" - }, - "node_modules/has": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.4.tgz", - "integrity": "sha512-qdSAmqLF6209RFj4VVItywPMbm3vWylknmB3nvNiUIs72xAimcM8nVYxYr7ncvZq5qzk9MKIZR8ijqD/1QuYjQ==", - "engines": { - "node": ">= 0.4.0" + "node_modules/defined": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.1.tgz", + "integrity": "sha512-hsBd2qSVCRE+5PmNdHt1uzyrFu5d3RwmFDKzyNZMFq/EwDNJF7Ee5+D5oEKF0hU6LhtoUF1macFvOe4AskQC1Q==", + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==", + "node_modules/deps-sort": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/deps-sort/-/deps-sort-2.0.1.tgz", + "integrity": "sha512-1orqXQr5po+3KI6kQb9A4jnXT1PBwggGl2d7Sq2xsnOeI9GPcE/tGcF9UiSZtZBM7MukY4cAh7MemS6tZYipfw==", "dependencies": { - "ansi-regex": "^2.0.0" + "JSONStream": "^1.0.3", + "shasum-object": "^1.0.0", + "subarg": "^1.0.0", + "through2": "^2.0.0" }, - "engines": { - "node": ">=0.10.0" + "bin": { + "deps-sort": "bin/cmd.js" } }, - "node_modules/has-ansi/node_modules/ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", - "engines": { - "node": ">=0.10.0" + "node_modules/deps-sort/node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dependencies": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" } }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" + "node_modules/des.js": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.1.0.tgz", + "integrity": "sha512-r17GxjhUCjSRy8aiJpr8/UadFIzMzJGexI3Nmz4ADi9LYSFx4gTBp80+NaX/YsXWWLhpZ7v/v/ubEc/bCNfKwg==", + "dependencies": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" } }, - "node_modules/has-property-descriptors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", - "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "node_modules/detective": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/detective/-/detective-5.2.1.tgz", + "integrity": "sha512-v9XE1zRnz1wRtgurGu0Bs8uHKFSTdteYZNbIPFVhUZ39L/S79ppMpdmVOZAnoz1jfEFodc48n6MX483Xo3t1yw==", "dependencies": { - "es-define-property": "^1.0.0" + "acorn-node": "^1.8.2", + "defined": "^1.0.0", + "minimist": "^1.2.6" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-proto": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", - "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", - "engines": { - "node": ">= 0.4" + "bin": { + "detective": "bin/detective.js" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": ">=0.8.0" } }, - "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "engines": { - "node": ">= 0.4" + "node_modules/dexnode": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/dexnode/-/dexnode-1.2.2.tgz", + "integrity": "sha512-L+rnDz6kO/taBvaRfkKei8X66wEAtfbqNp6l8VOWH67CYQbds3Oq+Z0xdBckkwREis1qcBp9cKA6JrHNeJ3DZQ==", + "dependencies": { + "semver": "^7.3.8", + "winreg": "^1.2.4" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "bin": { + "dexnode": "bin/dexnode.js" } }, - "node_modules/has-tostringtag": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", - "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "node_modules/diffie-hellman": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", "dependencies": { - "has-symbols": "^1.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" } }, - "node_modules/has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==" + "node_modules/diffie-hellman/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" }, - "node_modules/hash-base": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", - "integrity": "sha512-EeeoJKjTyt868liAlVmcv2ZsUfGHlE3Q+BICOXcZiwN3osr5Q/zFGYmTJpoIzuaSTAwndFy+GqhEwlU4L3j4Ow==", - "dependencies": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - }, + "node_modules/domain-browser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", + "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", "engines": { - "node": ">=4" + "node": ">=0.4", + "npm": ">=1.2" } }, - "node_modules/hash.js": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", - "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "node_modules/duplexer2": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", + "integrity": "sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA==", "dependencies": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" + "readable-stream": "^2.0.2" } }, - "node_modules/hasown": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", - "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "node_modules/duplexify": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-4.1.3.tgz", + "integrity": "sha512-M3BmBhwJRZsSx38lZyhE53Csddgzl5R7xGJNk7CVddZD6CcmwMCH8J+7AprIrQKH7TonKxaCjcv27Qmf+sQ+oA==", "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" + "end-of-stream": "^1.4.1", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1", + "stream-shift": "^1.0.2" } }, - "node_modules/highlight.js": { - "version": "10.7.3", - "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz", - "integrity": "sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==", - "dev": true, - "license": "BSD-3-Clause", + "node_modules/duplexify/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, "engines": { - "node": "*" + "node": ">= 6" } }, - "node_modules/hmac-drbg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", + "node_modules/elliptic": { + "version": "6.6.1", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.6.1.tgz", + "integrity": "sha512-RaddvvMatK2LJHqFJ+YA4WysVN5Ita9E35botqIYspQ4TkRAlCicdzKOjlyv/1Za5RyTNn7di//eEV0uTAfe3g==", + "license": "MIT", "dependencies": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", "minimalistic-crypto-utils": "^1.0.1" } }, - "node_modules/hsl-to-rgb-for-reals": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/hsl-to-rgb-for-reals/-/hsl-to-rgb-for-reals-1.1.1.tgz", - "integrity": "sha512-LgOWAkrN0rFaQpfdWBQlv/VhkOxb5AsBjk6NQVx4yEzWS923T07X0M1Y0VNko2H52HeSpZrZNNMJ0aFqsdVzQg==" - }, - "node_modules/html-escaper": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", - "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", - "dev": true - }, - "node_modules/htmlescape": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz", - "integrity": "sha512-eVcrzgbR4tim7c7soKQKtxa/kQM4TzjnlU83rcZ9bHU6t31ehfV7SktN6McWgwPWg+JYMA/O3qpGxBvFq1z2Jg==", - "engines": { - "node": ">=0.10" - } + "node_modules/elliptic/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" }, - "node_modules/https-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", - "integrity": "sha512-J+FkSdyD+0mA0N+81tMotaRMfSL9SGi+xpD3T6YApKsc3bGSXJlfXri3VyFOeYkfLRQisDk1W+jIFFKBeUBbBg==" + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true }, - "node_modules/human-signals": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", - "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "node_modules/emojilib": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/emojilib/-/emojilib-2.4.0.tgz", + "integrity": "sha512-5U0rVMU5Y2n2+ykNLQqMoqklN9ICBT/KsvC1Gz6vqHbz2AXXGkG+Pm5rMWk/8Vjrr/mY9985Hi8DYzn1F09Nyw==", "dev": true, - "engines": { - "node": ">=10.17.0" - } - }, - "node_modules/hyperscript-attribute-to-property": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/hyperscript-attribute-to-property/-/hyperscript-attribute-to-property-1.0.2.tgz", - "integrity": "sha512-oerMul16jZCmrbNsUw8QgrtDzF8lKgFri1bKQjReLw1IhiiNkI59CWuzZjJDGT79UQ1YiWqXhJMv/tRMVqgtkA==" + "license": "MIT" }, - "node_modules/hyperx": { - "version": "2.5.4", - "resolved": "https://registry.npmjs.org/hyperx/-/hyperx-2.5.4.tgz", - "integrity": "sha512-iOkSh7Yse7lsN/B9y7OsevLWjeXPqGuHQ5SbwaiJM5xAhWFqhoN6erpK1dQsS12OFU36lyai1pnx1mmzWLQqcA==", + "node_modules/end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", "dependencies": { - "hyperscript-attribute-to-property": "^1.0.0" + "once": "^1.4.0" } }, - "node_modules/ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] + "node_modules/env-string": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/env-string/-/env-string-1.0.1.tgz", + "integrity": "sha512-/DhCJDf5DSFK32joQiWRpWrT0h7p3hVQfMKxiBb7Nt8C8IF8BYyPtclDnuGGLOoj16d/8udKeiE7JbkotDmorQ==" }, - "node_modules/import-local": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.2.0.tgz", - "integrity": "sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA==", + "node_modules/environment": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/environment/-/environment-1.1.0.tgz", + "integrity": "sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==", "dev": true, - "dependencies": { - "pkg-dir": "^4.2.0", - "resolve-cwd": "^3.0.0" - }, - "bin": { - "import-local-fixture": "fixtures/cli.js" - }, + "license": "MIT", "engines": { - "node": ">=8" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "dev": true, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dependencies": { + "get-intrinsic": "^1.2.4" + }, "engines": { - "node": ">=0.8.19" + "node": ">= 0.4" } }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "engines": { + "node": ">= 0.4" } }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "node_modules/inline-source-map": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.6.3.tgz", - "integrity": "sha512-1aVsPEsJWMJq/pdMU61CDlm1URcW702MTB4w9/zUjMus6H/Py8o7g68Pr9D4I6QluWGt/KdmswuRhaA05xVR1w==", - "dependencies": { - "source-map": "~0.5.3" + "node_modules/esbuild": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.8.tgz", + "integrity": "sha512-vVC0USHGtMi8+R4Kz8rt6JhEWLxsv9Rnu/lGYbPR8u47B+DCBksq9JarW0zOO7bs37hyOK1l2/oqtbciutL5+Q==", + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.25.8", + "@esbuild/android-arm": "0.25.8", + "@esbuild/android-arm64": "0.25.8", + "@esbuild/android-x64": "0.25.8", + "@esbuild/darwin-arm64": "0.25.8", + "@esbuild/darwin-x64": "0.25.8", + "@esbuild/freebsd-arm64": "0.25.8", + "@esbuild/freebsd-x64": "0.25.8", + "@esbuild/linux-arm": "0.25.8", + "@esbuild/linux-arm64": "0.25.8", + "@esbuild/linux-ia32": "0.25.8", + "@esbuild/linux-loong64": "0.25.8", + "@esbuild/linux-mips64el": "0.25.8", + "@esbuild/linux-ppc64": "0.25.8", + "@esbuild/linux-riscv64": "0.25.8", + "@esbuild/linux-s390x": "0.25.8", + "@esbuild/linux-x64": "0.25.8", + "@esbuild/netbsd-arm64": "0.25.8", + "@esbuild/netbsd-x64": "0.25.8", + "@esbuild/openbsd-arm64": "0.25.8", + "@esbuild/openbsd-x64": "0.25.8", + "@esbuild/openharmony-arm64": "0.25.8", + "@esbuild/sunos-x64": "0.25.8", + "@esbuild/win32-arm64": "0.25.8", + "@esbuild/win32-ia32": "0.25.8", + "@esbuild/win32-x64": "0.25.8" } }, - "node_modules/inline-source-map/node_modules/source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "node_modules/escalade": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", + "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=6" } }, - "node_modules/insert-module-globals": { - "version": "7.2.1", - "resolved": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-7.2.1.tgz", - "integrity": "sha512-ufS5Qq9RZN+Bu899eA9QCAYThY+gGW7oRkmb0vC93Vlyu/CFGcH0OYPEjVkDXA5FEbTt1+VWzdoOD3Ny9N+8tg==", - "dependencies": { - "acorn-node": "^1.5.2", - "combine-source-map": "^0.8.0", - "concat-stream": "^1.6.1", - "is-buffer": "^1.1.0", - "JSONStream": "^1.0.3", - "path-is-absolute": "^1.0.1", - "process": "~0.11.0", - "through2": "^2.0.0", - "undeclared-identifiers": "^1.1.2", - "xtend": "^4.0.0" + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "engines": { + "node": ">=10" }, - "bin": { - "insert-module-globals": "bin/cmd.js" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/insert-module-globals/node_modules/concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "engines": [ - "node >= 0.8" - ], - "dependencies": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" + "node_modules/estree-is-member-expression": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/estree-is-member-expression/-/estree-is-member-expression-1.0.0.tgz", + "integrity": "sha512-Ec+X44CapIGExvSZN+pGkmr5p7HwUVQoPQSd458Lqwvaf4/61k/invHSh4BYK8OXnCkfEhWuIoG5hayKLQStIg==" + }, + "node_modules/events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "engines": { + "node": ">=0.8.x" } }, - "node_modules/insert-module-globals/node_modules/through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "node_modules/evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", "dependencies": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" } }, - "node_modules/internmap": { + "node_modules/execspawn": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/internmap/-/internmap-1.0.1.tgz", - "integrity": "sha512-lDB5YccMydFBtasVtxnZ3MRBHuaoE8GKsppq+EchKL2U4nK/DmEpPHNH8MZe5HkMtpSiTSOZwfN0tzYjO/lJEw==" - }, - "node_modules/is-arguments": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", - "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", + "resolved": "https://registry.npmjs.org/execspawn/-/execspawn-1.0.1.tgz", + "integrity": "sha512-s2k06Jy9i8CUkYe0+DxRlvtkZoOkwwfhB+Xxo5HGUtrISVW2m98jO2tr67DGRFxZwkjQqloA3v/tNtjhBRBieg==", "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "util-extend": "^1.0.1" } }, - "node_modules/is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", - "dev": true + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" }, - "node_modules/is-boolean-attribute": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/is-boolean-attribute/-/is-boolean-attribute-0.0.1.tgz", - "integrity": "sha512-0kXT52Scokg2Miscvsn5UVqg6y1691vcLJcagie1YHJB4zOEuAhMERLX992jtvaStGy2xQTqOtJhvmG/MK1T5w==" + "node_modules/fast-safe-stringify": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", + "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==" }, - "node_modules/is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + "node_modules/fast-uri": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.1.tgz", + "integrity": "sha512-MWipKbbYiYI0UC7cl8m/i/IWTqfC8YXsqjzybjddLsFjStroQzsHXkc73JutMvBiXmOvapk+axIl79ig5t55Bw==" }, - "node_modules/is-callable": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", - "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } + "node_modules/fflate": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.2.tgz", + "integrity": "sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==" }, - "node_modules/is-core-module": { - "version": "2.15.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz", - "integrity": "sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==", - "license": "MIT", + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dependencies": { - "hasown": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" + "to-regex-range": "^5.0.1" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, "engines": { "node": ">=8" } }, - "node_modules/is-generator-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", - "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", - "dev": true, - "engines": { - "node": ">=6" + "node_modules/for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dependencies": { + "is-callable": "^1.1.3" } }, - "node_modules/is-generator-function": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", - "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", + "node_modules/fs-extra": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", "dependencies": { - "has-tostringtag": "^1.0.0" + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=12" } }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "engines": { - "node": ">=0.12.0" - } + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, - "node_modules/is-stream": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", - "dev": true, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, - "node_modules/is-typed-array": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", - "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", - "dependencies": { - "which-typed-array": "^1.1.14" - }, - "engines": { - "node": ">= 0.4" - }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", "funding": { "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-wsl": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", - "integrity": "sha512-gfygJYZ2gLTDlmbWMI0CE2MwnFzSN/2SZfkMlItC4K/JBlsWVDB0bO6XhqcY13YXE7iMcAJnzTCJjPiTeJJ0Mw==", - "engines": { - "node": ">=4" - } - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + "node_modules/get-assigned-identifiers": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/get-assigned-identifiers/-/get-assigned-identifiers-1.2.0.tgz", + "integrity": "sha512-mBBwmeGTrxEMO4pMaaf/uUEFHnYtwr8FTe8Y/mer4rcV/bye0qGm6pw1bGZFGStxC5O76c5ZAVBGnqHmOaJpdQ==" }, - "node_modules/istanbul-lib-coverage": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", - "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true, "engines": { - "node": ">=8" + "node": "6.* || 8.* || >= 10.*" } }, - "node_modules/istanbul-lib-instrument": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz", - "integrity": "sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==", - "dev": true, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", "dependencies": { - "@babel/core": "^7.23.9", - "@babel/parser": "^7.23.9", - "@istanbuljs/schema": "^0.1.3", - "istanbul-lib-coverage": "^3.2.0", - "semver": "^7.5.4" + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" }, "engines": { - "node": ">=10" - } - }, - "node_modules/istanbul-lib-report": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", - "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", - "dev": true, - "dependencies": { - "istanbul-lib-coverage": "^3.0.0", - "make-dir": "^4.0.0", - "supports-color": "^7.1.0" + "node": ">= 0.4" }, - "engines": { - "node": ">=10" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/istanbul-lib-source-maps": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", - "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", - "dev": true, + "node_modules/get-tsconfig": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.10.0.tgz", + "integrity": "sha512-kGzZ3LWWQcGIAmg6iWvXn0ei6WDtV26wzHRMwDSzmAbcXrTEXxHy6IehI6/4eT6VRKyMP1eF1VqwrVUmE/LR7A==", + "license": "MIT", "dependencies": { - "debug": "^4.1.1", - "istanbul-lib-coverage": "^3.0.0", - "source-map": "^0.6.1" + "resolve-pkg-maps": "^1.0.0" }, - "engines": { - "node": ">=10" + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" } }, - "node_modules/istanbul-reports": { - "version": "3.1.7", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", - "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", - "dev": true, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", "dependencies": { - "html-escaper": "^2.0.0", - "istanbul-lib-report": "^3.0.0" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" }, "engines": { - "node": ">=8" + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/jest": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", - "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", - "dev": true, + "node_modules/glob/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dependencies": { - "@jest/core": "^29.7.0", - "@jest/types": "^29.6.3", - "import-local": "^3.0.2", - "jest-cli": "^29.7.0" - }, - "bin": { - "jest": "bin/jest.js" + "brace-expansion": "^1.1.7" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" - }, - "peerDependenciesMeta": { - "node-notifier": { - "optional": true - } + "node": "*" } }, - "node_modules/jest-changed-files": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz", - "integrity": "sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==", - "dev": true, + "node_modules/google-protobuf": { + "version": "3.21.4", + "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.21.4.tgz", + "integrity": "sha512-MnG7N936zcKTco4Jd2PX2U96Kf9PxygAPKBug+74LHzmHXmceN16MmRcdgZv+DGef/S9YvQAfRsNCn4cjf9yyQ==", + "license": "(BSD-3-Clause AND Apache-2.0)" + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", "dependencies": { - "execa": "^5.0.0", - "jest-util": "^29.7.0", - "p-limit": "^3.1.0" + "get-intrinsic": "^1.1.3" }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/jest-circus": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz", - "integrity": "sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==", - "dev": true, - "dependencies": { - "@jest/environment": "^29.7.0", - "@jest/expect": "^29.7.0", - "@jest/test-result": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/node": "*", - "chalk": "^4.0.0", - "co": "^4.6.0", - "dedent": "^1.0.0", - "is-generator-fn": "^2.0.0", - "jest-each": "^29.7.0", - "jest-matcher-utils": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-runtime": "^29.7.0", - "jest-snapshot": "^29.7.0", - "jest-util": "^29.7.0", - "p-limit": "^3.1.0", - "pretty-format": "^29.7.0", - "pure-rand": "^6.0.0", - "slash": "^3.0.0", - "stack-utils": "^2.0.3" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-cli": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz", - "integrity": "sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==", - "dev": true, - "dependencies": { - "@jest/core": "^29.7.0", - "@jest/test-result": "^29.7.0", - "@jest/types": "^29.6.3", - "chalk": "^4.0.0", - "create-jest": "^29.7.0", - "exit": "^0.1.2", - "import-local": "^3.0.2", - "jest-config": "^29.7.0", - "jest-util": "^29.7.0", - "jest-validate": "^29.7.0", - "yargs": "^17.3.1" - }, - "bin": { - "jest": "bin/jest.js" - }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" + }, + "node_modules/has": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.4.tgz", + "integrity": "sha512-qdSAmqLF6209RFj4VVItywPMbm3vWylknmB3nvNiUIs72xAimcM8nVYxYr7ncvZq5qzk9MKIZR8ijqD/1QuYjQ==", "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" - }, - "peerDependenciesMeta": { - "node-notifier": { - "optional": true - } + "node": ">= 0.4.0" } }, - "node_modules/jest-config": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz", - "integrity": "sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==", - "dev": true, + "node_modules/has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==", "dependencies": { - "@babel/core": "^7.11.6", - "@jest/test-sequencer": "^29.7.0", - "@jest/types": "^29.6.3", - "babel-jest": "^29.7.0", - "chalk": "^4.0.0", - "ci-info": "^3.2.0", - "deepmerge": "^4.2.2", - "glob": "^7.1.3", - "graceful-fs": "^4.2.9", - "jest-circus": "^29.7.0", - "jest-environment-node": "^29.7.0", - "jest-get-type": "^29.6.3", - "jest-regex-util": "^29.6.3", - "jest-resolve": "^29.7.0", - "jest-runner": "^29.7.0", - "jest-util": "^29.7.0", - "jest-validate": "^29.7.0", - "micromatch": "^4.0.4", - "parse-json": "^5.2.0", - "pretty-format": "^29.7.0", - "slash": "^3.0.0", - "strip-json-comments": "^3.1.1" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "@types/node": "*", - "ts-node": ">=9.0.0" + "ansi-regex": "^2.0.0" }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - }, - "ts-node": { - "optional": true - } + "engines": { + "node": ">=0.10.0" } }, - "node_modules/jest-diff": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", - "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", - "dev": true, - "dependencies": { - "chalk": "^4.0.0", - "diff-sequences": "^29.6.3", - "jest-get-type": "^29.6.3", - "pretty-format": "^29.7.0" - }, + "node_modules/has-ansi/node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=0.10.0" } }, - "node_modules/jest-docblock": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz", - "integrity": "sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==", + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, - "dependencies": { - "detect-newline": "^3.0.0" - }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=8" } }, - "node_modules/jest-each": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz", - "integrity": "sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==", - "dev": true, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", "dependencies": { - "@jest/types": "^29.6.3", - "chalk": "^4.0.0", - "jest-get-type": "^29.6.3", - "jest-util": "^29.7.0", - "pretty-format": "^29.7.0" + "es-define-property": "^1.0.0" }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/jest-environment-node": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz", - "integrity": "sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==", - "dev": true, - "dependencies": { - "@jest/environment": "^29.7.0", - "@jest/fake-timers": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/node": "*", - "jest-mock": "^29.7.0", - "jest-util": "^29.7.0" - }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/jest-get-type": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", - "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", - "dev": true, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/jest-haste-map": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", - "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", - "dev": true, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", "dependencies": { - "@jest/types": "^29.6.3", - "@types/graceful-fs": "^4.1.3", - "@types/node": "*", - "anymatch": "^3.0.3", - "fb-watchman": "^2.0.0", - "graceful-fs": "^4.2.9", - "jest-regex-util": "^29.6.3", - "jest-util": "^29.7.0", - "jest-worker": "^29.7.0", - "micromatch": "^4.0.4", - "walker": "^1.0.8" + "has-symbols": "^1.0.3" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">= 0.4" }, - "optionalDependencies": { - "fsevents": "^2.3.2" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/jest-leak-detector": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", - "integrity": "sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==", - "dev": true, + "node_modules/has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==" + }, + "node_modules/hash-base": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", + "integrity": "sha512-EeeoJKjTyt868liAlVmcv2ZsUfGHlE3Q+BICOXcZiwN3osr5Q/zFGYmTJpoIzuaSTAwndFy+GqhEwlU4L3j4Ow==", "dependencies": { - "jest-get-type": "^29.6.3", - "pretty-format": "^29.7.0" + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=4" } }, - "node_modules/jest-matcher-utils": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", - "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", - "dev": true, + "node_modules/hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", "dependencies": { - "chalk": "^4.0.0", - "jest-diff": "^29.7.0", - "jest-get-type": "^29.6.3", - "pretty-format": "^29.7.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" } }, - "node_modules/jest-message-util": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", - "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", - "dev": true, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", "dependencies": { - "@babel/code-frame": "^7.12.13", - "@jest/types": "^29.6.3", - "@types/stack-utils": "^2.0.0", - "chalk": "^4.0.0", - "graceful-fs": "^4.2.9", - "micromatch": "^4.0.4", - "pretty-format": "^29.7.0", - "slash": "^3.0.0", - "stack-utils": "^2.0.3" + "function-bind": "^1.1.2" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">= 0.4" } }, - "node_modules/jest-mock": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", - "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", + "node_modules/highlight.js": { + "version": "10.7.3", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz", + "integrity": "sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==", "dev": true, - "dependencies": { - "@jest/types": "^29.6.3", - "@types/node": "*", - "jest-util": "^29.7.0" - }, + "license": "BSD-3-Clause", "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "*" } }, - "node_modules/jest-pnp-resolver": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", - "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", - "dev": true, - "engines": { - "node": ">=6" - }, - "peerDependencies": { - "jest-resolve": "*" - }, - "peerDependenciesMeta": { - "jest-resolve": { - "optional": true - } + "node_modules/hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", + "dependencies": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" } }, - "node_modules/jest-regex-util": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", - "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", - "dev": true, + "node_modules/hsl-to-rgb-for-reals": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/hsl-to-rgb-for-reals/-/hsl-to-rgb-for-reals-1.1.1.tgz", + "integrity": "sha512-LgOWAkrN0rFaQpfdWBQlv/VhkOxb5AsBjk6NQVx4yEzWS923T07X0M1Y0VNko2H52HeSpZrZNNMJ0aFqsdVzQg==" + }, + "node_modules/htmlescape": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz", + "integrity": "sha512-eVcrzgbR4tim7c7soKQKtxa/kQM4TzjnlU83rcZ9bHU6t31ehfV7SktN6McWgwPWg+JYMA/O3qpGxBvFq1z2Jg==", "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=0.10" } }, - "node_modules/jest-resolve": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz", - "integrity": "sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==", - "dev": true, + "node_modules/https-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", + "integrity": "sha512-J+FkSdyD+0mA0N+81tMotaRMfSL9SGi+xpD3T6YApKsc3bGSXJlfXri3VyFOeYkfLRQisDk1W+jIFFKBeUBbBg==" + }, + "node_modules/hyperscript-attribute-to-property": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/hyperscript-attribute-to-property/-/hyperscript-attribute-to-property-1.0.2.tgz", + "integrity": "sha512-oerMul16jZCmrbNsUw8QgrtDzF8lKgFri1bKQjReLw1IhiiNkI59CWuzZjJDGT79UQ1YiWqXhJMv/tRMVqgtkA==" + }, + "node_modules/hyperx": { + "version": "2.5.4", + "resolved": "https://registry.npmjs.org/hyperx/-/hyperx-2.5.4.tgz", + "integrity": "sha512-iOkSh7Yse7lsN/B9y7OsevLWjeXPqGuHQ5SbwaiJM5xAhWFqhoN6erpK1dQsS12OFU36lyai1pnx1mmzWLQqcA==", "dependencies": { - "chalk": "^4.0.0", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.7.0", - "jest-pnp-resolver": "^1.2.2", - "jest-util": "^29.7.0", - "jest-validate": "^29.7.0", - "resolve": "^1.20.0", - "resolve.exports": "^2.0.0", - "slash": "^3.0.0" - }, + "hyperscript-attribute-to-property": "^1.0.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/inline-source-map": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.6.3.tgz", + "integrity": "sha512-1aVsPEsJWMJq/pdMU61CDlm1URcW702MTB4w9/zUjMus6H/Py8o7g68Pr9D4I6QluWGt/KdmswuRhaA05xVR1w==", + "dependencies": { + "source-map": "~0.5.3" + } + }, + "node_modules/inline-source-map/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=0.10.0" } }, - "node_modules/jest-resolve-dependencies": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz", - "integrity": "sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==", - "dev": true, + "node_modules/insert-module-globals": { + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-7.2.1.tgz", + "integrity": "sha512-ufS5Qq9RZN+Bu899eA9QCAYThY+gGW7oRkmb0vC93Vlyu/CFGcH0OYPEjVkDXA5FEbTt1+VWzdoOD3Ny9N+8tg==", "dependencies": { - "jest-regex-util": "^29.6.3", - "jest-snapshot": "^29.7.0" + "acorn-node": "^1.5.2", + "combine-source-map": "^0.8.0", + "concat-stream": "^1.6.1", + "is-buffer": "^1.1.0", + "JSONStream": "^1.0.3", + "path-is-absolute": "^1.0.1", + "process": "~0.11.0", + "through2": "^2.0.0", + "undeclared-identifiers": "^1.1.2", + "xtend": "^4.0.0" }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "bin": { + "insert-module-globals": "bin/cmd.js" } }, - "node_modules/jest-runner": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz", - "integrity": "sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==", - "dev": true, + "node_modules/insert-module-globals/node_modules/concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "engines": [ + "node >= 0.8" + ], "dependencies": { - "@jest/console": "^29.7.0", - "@jest/environment": "^29.7.0", - "@jest/test-result": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/node": "*", - "chalk": "^4.0.0", - "emittery": "^0.13.1", - "graceful-fs": "^4.2.9", - "jest-docblock": "^29.7.0", - "jest-environment-node": "^29.7.0", - "jest-haste-map": "^29.7.0", - "jest-leak-detector": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-resolve": "^29.7.0", - "jest-runtime": "^29.7.0", - "jest-util": "^29.7.0", - "jest-watcher": "^29.7.0", - "jest-worker": "^29.7.0", - "p-limit": "^3.1.0", - "source-map-support": "0.5.13" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-runtime": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz", - "integrity": "sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==", - "dev": true, + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "node_modules/insert-module-globals/node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", "dependencies": { - "@jest/environment": "^29.7.0", - "@jest/fake-timers": "^29.7.0", - "@jest/globals": "^29.7.0", - "@jest/source-map": "^29.6.3", - "@jest/test-result": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/node": "*", - "chalk": "^4.0.0", - "cjs-module-lexer": "^1.0.0", - "collect-v8-coverage": "^1.0.0", - "glob": "^7.1.3", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-mock": "^29.7.0", - "jest-regex-util": "^29.6.3", - "jest-resolve": "^29.7.0", - "jest-snapshot": "^29.7.0", - "jest-util": "^29.7.0", - "slash": "^3.0.0", - "strip-bom": "^4.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-snapshot": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", - "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", - "dev": true, + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "node_modules/internmap": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/internmap/-/internmap-1.0.1.tgz", + "integrity": "sha512-lDB5YccMydFBtasVtxnZ3MRBHuaoE8GKsppq+EchKL2U4nK/DmEpPHNH8MZe5HkMtpSiTSOZwfN0tzYjO/lJEw==" + }, + "node_modules/is-arguments": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", + "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", "dependencies": { - "@babel/core": "^7.11.6", - "@babel/generator": "^7.7.2", - "@babel/plugin-syntax-jsx": "^7.7.2", - "@babel/plugin-syntax-typescript": "^7.7.2", - "@babel/types": "^7.3.3", - "@jest/expect-utils": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", - "babel-preset-current-node-syntax": "^1.0.0", - "chalk": "^4.0.0", - "expect": "^29.7.0", - "graceful-fs": "^4.2.9", - "jest-diff": "^29.7.0", - "jest-get-type": "^29.6.3", - "jest-matcher-utils": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-util": "^29.7.0", - "natural-compare": "^1.4.0", - "pretty-format": "^29.7.0", - "semver": "^7.5.3" + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/jest-util": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", - "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", - "dev": true, - "dependencies": { - "@jest/types": "^29.6.3", - "@types/node": "*", - "chalk": "^4.0.0", - "ci-info": "^3.2.0", - "graceful-fs": "^4.2.9", - "picomatch": "^2.2.3" - }, + "node_modules/is-boolean-attribute": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/is-boolean-attribute/-/is-boolean-attribute-0.0.1.tgz", + "integrity": "sha512-0kXT52Scokg2Miscvsn5UVqg6y1691vcLJcagie1YHJB4zOEuAhMERLX992jtvaStGy2xQTqOtJhvmG/MK1T5w==" + }, + "node_modules/is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/jest-validate": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz", - "integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==", - "dev": true, + "node_modules/is-core-module": { + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz", + "integrity": "sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==", + "license": "MIT", "dependencies": { - "@jest/types": "^29.6.3", - "camelcase": "^6.2.0", - "chalk": "^4.0.0", - "jest-get-type": "^29.6.3", - "leven": "^3.1.0", - "pretty-format": "^29.7.0" + "hasown": "^2.0.2" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/jest-validate/node_modules/camelcase": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", - "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8" } }, - "node_modules/jest-watcher": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz", - "integrity": "sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==", - "dev": true, + "node_modules/is-generator-function": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", + "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", "dependencies": { - "@jest/test-result": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/node": "*", - "ansi-escapes": "^4.2.1", - "chalk": "^4.0.0", - "emittery": "^0.13.1", - "jest-util": "^29.7.0", - "string-length": "^4.0.1" + "has-tostringtag": "^1.0.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/jest-worker": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", - "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", - "dev": true, - "dependencies": { - "@types/node": "*", - "jest-util": "^29.7.0", - "merge-stream": "^2.0.0", - "supports-color": "^8.0.0" - }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=0.12.0" } }, - "node_modules/jest-worker/node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, + "node_modules/is-typed-array": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", + "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", "dependencies": { - "has-flag": "^4.0.0" + "which-typed-array": "^1.1.14" }, "engines": { - "node": ">=10" + "node": ">= 0.4" }, "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, - "node_modules/jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", - "dev": true, - "bin": { - "jsesc": "bin/jsesc" - }, + "node_modules/is-wsl": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", + "integrity": "sha512-gfygJYZ2gLTDlmbWMI0CE2MwnFzSN/2SZfkMlItC4K/JBlsWVDB0bO6XhqcY13YXE7iMcAJnzTCJjPiTeJJ0Mw==", "engines": { "node": ">=4" } }, - "node_modules/json-parse-even-better-errors": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", - "dev": true - }, - "node_modules/json5": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", - "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", - "dev": true, - "bin": { - "json5": "lib/cli.js" - }, - "engines": { - "node": ">=6" - } + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" }, "node_modules/jsonfile": { "version": "6.1.0", @@ -5193,15 +2873,6 @@ "readable-stream": "2 || 3" } }, - "node_modules/kleur": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", - "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/labeled-stream-splicer": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/labeled-stream-splicer/-/labeled-stream-splicer-2.0.2.tgz", @@ -5211,21 +2882,6 @@ "stream-splicer": "^2.0.0" } }, - "node_modules/leven": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", - "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/lines-and-columns": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", - "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", - "dev": true - }, "node_modules/lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", @@ -5247,15 +2903,6 @@ "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-1.1.4.tgz", "integrity": "sha512-2Fgx1Ycm599x+WGpIYwJOvsjmXFzTSc34IwDWALRA/8AopUKAVPwfJ+h5+f85BCp0PWmmJcWzEpxOpoXycMpdA==" }, - "node_modules/lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dev": true, - "dependencies": { - "yallist": "^3.0.2" - } - }, "node_modules/magic-string": { "version": "0.23.2", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.23.2.tgz", @@ -5264,30 +2911,6 @@ "sourcemap-codec": "^1.4.1" } }, - "node_modules/make-dir": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", - "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", - "dev": true, - "dependencies": { - "semver": "^7.5.3" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/makeerror": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", - "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", - "dev": true, - "dependencies": { - "tmpl": "1.0.5" - } - }, "node_modules/marked": { "version": "9.1.6", "resolved": "https://registry.npmjs.org/marked/-/marked-9.1.6.tgz", @@ -5391,12 +3014,6 @@ "node": ">=0.10.0" } }, - "node_modules/merge-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true - }, "node_modules/micromatch": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", @@ -5426,15 +3043,6 @@ "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" }, - "node_modules/mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", @@ -5650,12 +3258,6 @@ "xtend": "~4.0.1" } }, - "node_modules/natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true - }, "node_modules/no-case": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/no-case/-/no-case-2.3.2.tgz", @@ -5680,18 +3282,6 @@ "node": ">=18" } }, - "node_modules/node-int64": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", - "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", - "dev": true - }, - "node_modules/node-releases": { - "version": "2.0.18", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz", - "integrity": "sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==", - "dev": true - }, "node_modules/normalize-html-whitespace": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/normalize-html-whitespace/-/normalize-html-whitespace-0.2.0.tgz", @@ -5700,27 +3290,6 @@ "node": ">= 0.10" } }, - "node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/npm-run-path": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", - "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", - "dev": true, - "dependencies": { - "path-key": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/number-is-nan": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", @@ -5791,21 +3360,6 @@ "wrappy": "1" } }, - "node_modules/onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "dev": true, - "dependencies": { - "mimic-fn": "^2.1.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/opn": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/opn/-/opn-5.5.0.tgz", @@ -5822,30 +3376,6 @@ "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", "integrity": "sha512-gjcpUc3clBf9+210TRaDWbf+rZZZEshZ+DlXMRCeAjp0xhTrnQsKHypIy1J3d5hKdUzj69t708EHtU8P6bUn0A==" }, - "node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/pako": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", @@ -5875,24 +3405,6 @@ "node": ">= 0.10" } }, - "node_modules/parse-json": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", - "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-even-better-errors": "^2.3.0", - "lines-and-columns": "^1.1.6" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/parse5": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", @@ -5922,15 +3434,6 @@ "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==" }, - "node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", @@ -5939,15 +3442,6 @@ "node": ">=0.10.0" } }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", @@ -5958,112 +3452,33 @@ "resolved": "https://registry.npmjs.org/path-platform/-/path-platform-0.11.15.tgz", "integrity": "sha512-Y30dB6rab1A/nfEKsZxmr01nUotHX0c/ZiIAsCTatEe1CmS5Pm5He7fZ195bPT7RdquoaL8lLxFCMQi/bS7IJg==", "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/pbkdf2": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", - "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", - "dependencies": { - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4", - "ripemd160": "^2.0.1", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - }, - "engines": { - "node": ">=0.12" - } - }, - "node_modules/picocolors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", - "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==", - "dev": true - }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/pirates": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", - "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==", - "dev": true, - "engines": { - "node": ">= 6" - } - }, - "node_modules/pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "dev": true, - "dependencies": { - "find-up": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/pkg-dir/node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/pkg-dir/node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "dependencies": { - "p-locate": "^4.1.0" - }, - "engines": { - "node": ">=8" + "node": ">= 0.8.0" } }, - "node_modules/pkg-dir/node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, + "node_modules/pbkdf2": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", + "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", "dependencies": { - "p-try": "^2.0.0" + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" }, "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=0.12" } }, - "node_modules/pkg-dir/node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "dependencies": { - "p-limit": "^2.2.0" - }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "engines": { - "node": ">=8" + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" } }, "node_modules/platform": { @@ -6079,32 +3494,6 @@ "node": ">= 0.4" } }, - "node_modules/pretty-format": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", - "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", - "dev": true, - "dependencies": { - "@jest/schemas": "^29.6.3", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/pretty-format/node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, "node_modules/pretty-hrtime": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", @@ -6126,19 +3515,6 @@ "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" }, - "node_modules/prompts": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", - "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", - "dev": true, - "dependencies": { - "kleur": "^3.0.3", - "sisteransi": "^1.0.5" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/public-encrypt": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", @@ -6176,22 +3552,6 @@ "pump": "^3.0.0" } }, - "node_modules/pure-rand": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.1.0.tgz", - "integrity": "sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/dubzzz" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/fast-check" - } - ] - }, "node_modules/qs": { "version": "6.12.3", "resolved": "https://registry.npmjs.org/qs/-/qs-6.12.3.tgz", @@ -6236,12 +3596,6 @@ "safe-buffer": "^5.1.0" } }, - "node_modules/react-is": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", - "dev": true - }, "node_modules/read-only-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/read-only-stream/-/read-only-stream-2.0.0.tgz", @@ -6315,27 +3669,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/resolve-cwd": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", - "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", - "dev": true, - "dependencies": { - "resolve-from": "^5.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/resolve-cwd/node_modules/resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/resolve-pkg-maps": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", @@ -6344,15 +3677,6 @@ "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" } }, - "node_modules/resolve.exports": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", - "integrity": "sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==", - "dev": true, - "engines": { - "node": ">=10" - } - }, "node_modules/ripemd160": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", @@ -6429,27 +3753,6 @@ "fast-safe-stringify": "^2.0.7" } }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/shell-quote": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz", @@ -6475,12 +3778,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true - }, "node_modules/simple-concat": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", @@ -6551,12 +3848,6 @@ "node": ">=0.10.0" } }, - "node_modules/sisteransi": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", - "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", - "dev": true - }, "node_modules/skin-tone": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/skin-tone/-/skin-tone-2.0.0.tgz", @@ -6570,34 +3861,6 @@ "node": ">=8" } }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/source-map-support": { - "version": "0.5.13", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", - "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", - "dev": true, - "dependencies": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, "node_modules/sourcemap-codec": { "version": "1.4.8", "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", @@ -6612,33 +3875,6 @@ "node": ">= 10.x" } }, - "node_modules/sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", - "dev": true - }, - "node_modules/stack-utils": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", - "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==", - "dev": true, - "dependencies": { - "escape-string-regexp": "^2.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/stack-utils/node_modules/escape-string-regexp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", - "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/stream-browserify": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-3.0.0.tgz", @@ -6716,19 +3952,6 @@ "safe-buffer": "~5.2.0" } }, - "node_modules/string-length": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", - "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", - "dev": true, - "dependencies": { - "char-regex": "^1.0.2", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -6755,36 +3978,6 @@ "node": ">=8" } }, - "node_modules/strip-bom": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", - "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-final-newline": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", - "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/subarg": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/subarg/-/subarg-1.0.0.tgz", @@ -6846,32 +4039,6 @@ "resolved": "https://registry.npmjs.org/tachyons/-/tachyons-4.12.0.tgz", "integrity": "sha512-2nA2IrYFy3raCM9fxJ2KODRGHVSZNTW3BR0YnlGsLUf1DA3pk3YfWZ/DdfbnZK6zLZS+jUenlUGJsKcA5fUiZg==" }, - "node_modules/test-exclude": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", - "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", - "dev": true, - "dependencies": { - "@istanbuljs/schema": "^0.1.2", - "glob": "^7.1.4", - "minimatch": "^3.0.4" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/test-exclude/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/thenify": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", @@ -6932,21 +4099,6 @@ "node": ">=0.6.0" } }, - "node_modules/tmpl": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", - "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", - "dev": true - }, - "node_modules/to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -7170,15 +4322,6 @@ "resolved": "https://registry.npmjs.org/type-component/-/type-component-0.0.1.tgz", "integrity": "sha512-mDZRBQS2yZkwRQKfjJvQ8UIYJeBNNWCq+HBNstl9N5s9jZ4dkVYXEGkVPsSCEh5Ld4JM1kmrZTzjnrqSAIQ7dw==" }, - "node_modules/type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", @@ -7244,36 +4387,6 @@ "node": ">= 10.0.0" } }, - "node_modules/update-browserslist-db": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.0.tgz", - "integrity": "sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "dependencies": { - "escalade": "^3.1.2", - "picocolors": "^1.0.1" - }, - "bin": { - "update-browserslist-db": "cli.js" - }, - "peerDependencies": { - "browserslist": ">= 4.21.0" - } - }, "node_modules/upper-case": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/upper-case/-/upper-case-1.1.3.tgz", @@ -7322,20 +4435,6 @@ "resolved": "https://registry.npmjs.org/util-extend/-/util-extend-1.0.3.tgz", "integrity": "sha512-mLs5zAK+ctllYBj+iAQvlDCwoxU/WDOUaJkcFudeiAX6OajC6BKXJUa9a+tbtkC11dz2Ufb7h0lyvIOVn4LADA==" }, - "node_modules/v8-to-istanbul": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz", - "integrity": "sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==", - "dev": true, - "dependencies": { - "@jridgewell/trace-mapping": "^0.3.12", - "@types/istanbul-lib-coverage": "^2.0.1", - "convert-source-map": "^2.0.0" - }, - "engines": { - "node": ">=10.12.0" - } - }, "node_modules/validate-npm-package-name": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-5.0.1.tgz", @@ -7351,15 +4450,6 @@ "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==" }, - "node_modules/walker": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", - "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", - "dev": true, - "dependencies": { - "makeerror": "1.0.12" - } - }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -7419,19 +4509,6 @@ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, - "node_modules/write-file-atomic": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", - "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", - "dev": true, - "dependencies": { - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.7" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, "node_modules/xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", @@ -7449,51 +4526,6 @@ "node": ">=10" } }, - "node_modules/yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true - }, - "node_modules/yargs": { - "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", - "dev": true, - "dependencies": { - "cliui": "^8.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "dev": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "packages/bundle-size": { "name": "@bufbuild/bundle-size", "dependencies": { diff --git a/package.json b/package.json index 5ad43a943..a8b5698f3 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,6 @@ "@biomejs/biome": "^1.9.4", "@bufbuild/license-header": "^0.0.4", "@types/node": "^24.1.0", - "jest": "^29.7.0", "turbo": "^2.5.5", "typescript": "^5.9.2" }, From 17d61737e359a98cfc1c9a9088a22bd9a9f0d2d1 Mon Sep 17 00:00:00 2001 From: Timo Stamm Date: Mon, 18 Aug 2025 19:36:49 +0200 Subject: [PATCH 13/16] Fix assert() calls --- packages/protobuf-test/src/registry.test.ts | 22 ++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/protobuf-test/src/registry.test.ts b/packages/protobuf-test/src/registry.test.ts index 04da3c197..9040612fd 100644 --- a/packages/protobuf-test/src/registry.test.ts +++ b/packages/protobuf-test/src/registry.test.ts @@ -1559,7 +1559,7 @@ void suite("DescField", () => { const oneof: DescOneof | undefined = field.oneof; - assert([def, oneof].length > 0); + assert.ok([def, oneof].length > 0); break; } case "scalar": { @@ -1577,7 +1577,7 @@ void suite("DescField", () => { switch (field.scalar) { case ScalarType.BOOL: { const defBool: boolean | undefined = field.getDefaultValue(); - assert([defBool].length > 0); + assert.ok([defBool].length > 0); break; } default: @@ -1615,7 +1615,7 @@ void suite("DescField", () => { const oneof: DescOneof | undefined = field.oneof; - assert([def, oneof].length > 0); + assert.ok([def, oneof].length > 0); break; } case "list": { @@ -1632,7 +1632,7 @@ void suite("DescField", () => { const scalar: ScalarType = field.scalar; const message: undefined = field.message; const enumeration: undefined = field.enum; - assert([scalar, message, enumeration].length > 0); + assert.ok([scalar, message, enumeration].length > 0); break; } case "enum": { @@ -1641,7 +1641,7 @@ void suite("DescField", () => { const scalar: undefined = field.scalar; const message: undefined = field.message; const enumeration: DescEnum = field.enum; - assert([scalar, message, enumeration].length > 0); + assert.ok([scalar, message, enumeration].length > 0); break; } case "message": { @@ -1650,7 +1650,7 @@ void suite("DescField", () => { const scalar: undefined = field.scalar; const message: DescMessage = field.message; const enumeration: undefined = field.enum; - assert([scalar, message, enumeration].length > 0); + assert.ok([scalar, message, enumeration].length > 0); break; } } @@ -1669,7 +1669,7 @@ void suite("DescField", () => { const oneof: undefined = field.oneof; - assert([oneof].length > 0); + assert.ok([oneof].length > 0); break; } case "map": { @@ -1702,28 +1702,28 @@ void suite("DescField", () => { const scalar: ScalarType = field.scalar; const message: undefined = field.message; const enumeration: undefined = field.enum; - assert([scalar, message, enumeration].length > 0); + assert.ok([scalar, message, enumeration].length > 0); break; } case "enum": { const scalar: undefined = field.scalar; const message: undefined = field.message; const enumeration: DescEnum = field.enum; - assert([scalar, message, enumeration].length > 0); + assert.ok([scalar, message, enumeration].length > 0); break; } case "message": { const scalar: undefined = field.scalar; const message: DescMessage = field.message; const enumeration: undefined = field.enum; - assert([scalar, message, enumeration].length > 0); + assert.ok([scalar, message, enumeration].length > 0); break; } } const oneof: undefined = field.oneof; - assert( + assert.ok( [mapKeyFloat, mapKeyDouble, mapKeyBytes, mapKeyOk, oneof].length > 0, ); break; From d112927e8d6b4782c1831330fd7b8026f81bfe5d Mon Sep 17 00:00:00 2001 From: Timo Stamm Date: Mon, 18 Aug 2025 19:37:03 +0200 Subject: [PATCH 14/16] Remove Jest from prose --- packages/protobuf-test/README.md | 3 ++- packages/protobuf-test/src/generate-code.test.ts | 2 +- packages/protoplugin-test/README.md | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/protobuf-test/README.md b/packages/protobuf-test/README.md index fb6d56c3a..2b0c9bb45 100644 --- a/packages/protobuf-test/README.md +++ b/packages/protobuf-test/README.md @@ -1,6 +1,7 @@ # Tests for @bufbuild/protobuf -This package provides test coverage for `@bufbuild/protobuf` with Jest. +This package provides test coverage for `@bufbuild/protobuf` with the Node.js +built-in test runner. We also generate code for many of the unit test Protobuf files that are part of `github.com/protocolbuffers/protobuf`. They cover many edge cases for both code diff --git a/packages/protobuf-test/src/generate-code.test.ts b/packages/protobuf-test/src/generate-code.test.ts index 201827321..d20ea15cd 100644 --- a/packages/protobuf-test/src/generate-code.test.ts +++ b/packages/protobuf-test/src/generate-code.test.ts @@ -288,7 +288,7 @@ void suite("ts generated code is equal to js generated code", () => { }); /** - * Convert to plain object for comparison with Jest. + * Convert to plain object for comparison. * Replaces cyclic references. */ function toPlain(obj: unknown): unknown { diff --git a/packages/protoplugin-test/README.md b/packages/protoplugin-test/README.md index 08985a988..1f9a5694b 100644 --- a/packages/protoplugin-test/README.md +++ b/packages/protoplugin-test/README.md @@ -1,3 +1,3 @@ # Tests for @bufbuild/protoplugin -This package provides test coverage for `@bufbuild/protoplugin` with Jest. +This package provides test coverage for `@bufbuild/protoplugin` with the Node.js built-in test runner. From 94f78cf682d3c33937b9a22d5f0458022c185049 Mon Sep 17 00:00:00 2001 From: Timo Stamm Date: Mon, 18 Aug 2025 19:52:11 +0200 Subject: [PATCH 15/16] Fix test scripts for Node.js v20 --- packages/protobuf-test/package.json | 2 +- packages/protoplugin-test/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/protobuf-test/package.json b/packages/protobuf-test/package.json index 3854e9337..94d070e3a 100644 --- a/packages/protobuf-test/package.json +++ b/packages/protobuf-test/package.json @@ -17,7 +17,7 @@ "perf": "tsx src/perf.ts benchmark '.*'", "profile": "dexnode dist/esm/perf.js run 'fromBinary perf-payload.bin' 10000", "flamegraph": "npx 0x -- node dist/esm/perf.js run 'fromBinary perf-payload.bin' 10000", - "test": "tsx --test src/**/*.test.ts", + "test": "tsx --test $(find src -type f -path '*.test.ts')", "format": "biome format --write", "license-header": "license-header", "lint": "biome lint --error-on-warnings" diff --git a/packages/protoplugin-test/package.json b/packages/protoplugin-test/package.json index 8b6d2af89..8f8d3fbb5 100644 --- a/packages/protoplugin-test/package.json +++ b/packages/protoplugin-test/package.json @@ -4,7 +4,7 @@ "scripts": { "prebuild": "rm -rf ./dist/*", "build": "../../node_modules/typescript/bin/tsc --project tsconfig.json --outDir ./dist", - "test": "tsx --test src/**/*.test.ts", + "test": "tsx --test $(find src -type f -path '*.test.ts')", "format": "biome format --write", "license-header": "license-header", "lint": "biome lint --error-on-warnings" From d2fba30a49281f0472eb3df66902c56624daa3be Mon Sep 17 00:00:00 2001 From: Timo Stamm Date: Mon, 18 Aug 2025 20:02:37 +0200 Subject: [PATCH 16/16] Use "before" as a replacement for "beforeAll" --- packages/protobuf-test/src/reflect/names.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/protobuf-test/src/reflect/names.test.ts b/packages/protobuf-test/src/reflect/names.test.ts index 382b77663..2f4466a19 100644 --- a/packages/protobuf-test/src/reflect/names.test.ts +++ b/packages/protobuf-test/src/reflect/names.test.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { suite, test, beforeEach } from "node:test"; +import { suite, test, before } from "node:test"; import * as assert from "node:assert"; import { safeObjectProperty, @@ -24,7 +24,7 @@ import { compileField, compileFile } from "../helpers.js"; void suite("qualifiedName", () => { let testFile: DescFile; - beforeEach(async () => { + before(async () => { testFile = await compileFile(` syntax = "proto3"; // Fully-qualified name //----------------------