From d1d48a2b5919adc5afdbe3dd999ff0dd6311099d Mon Sep 17 00:00:00 2001 From: Greg Brimble Date: Wed, 4 Jan 2023 14:09:15 +0000 Subject: [PATCH 01/10] Convert all fixtures but local-mode-tests to vitest --- .../external-durable-objects-app/package.json | 20 +- .../tests/index.test.ts | 1 + .../tests/tsconfig.json | 2 +- fixtures/node-app-pages/package.json | 18 +- fixtures/node-app-pages/tests/index.test.ts | 1 + fixtures/node-app-pages/tests/tsconfig.json | 2 +- fixtures/pages-d1-shim/package.json | 20 +- fixtures/pages-d1-shim/tests/index.test.ts | 1 + fixtures/pages-d1-shim/tests/tsconfig.json | 2 +- fixtures/pages-functions-app/package.json | 20 +- .../pages-functions-app/tests/index.test.ts | 79 +- .../pages-functions-app/tests/tsconfig.json | 2 +- .../package.json | 20 +- .../tests/index.test.ts | 1 + .../tests/tsconfig.json | 2 +- .../package.json | 20 +- .../tests/index.test.ts | 1 + .../tests/tsconfig.json | 2 +- fixtures/pages-workerjs-app/package.json | 20 +- .../pages-workerjs-app/tests/index.test.ts | 1 + .../package.json | 20 +- .../tests/index.test.ts | 1 + .../tsconfig.json | 2 +- fixtures/pages-ws-app/package.json | 20 +- fixtures/pages-ws-app/tests/index.test.ts | 1 + fixtures/pages-ws-app/tests/tsconfig.json | 2 +- fixtures/remix-pages-app/package.json | 20 +- fixtures/remix-pages-app/tests/index.test.ts | 1 + fixtures/remix-pages-app/tests/tsconfig.json | 2 +- fixtures/service-bindings-app/package.json | 20 +- .../service-bindings-app/tests/index.test.ts | 1 + .../service-bindings-app/tests/tsconfig.json | 2 +- fixtures/worker-app/package.json | 20 +- fixtures/worker-app/tests/index.test.ts | 1 + fixtures/worker-app/tsconfig.json | 2 +- package-lock.json | 1493 +++++++++++++++-- package.json | 10 +- vitest.config.ts | 16 + 38 files changed, 1451 insertions(+), 418 deletions(-) create mode 100644 vitest.config.ts diff --git a/fixtures/external-durable-objects-app/package.json b/fixtures/external-durable-objects-app/package.json index 771bdc2a5c7b..7ebad974b089 100644 --- a/fixtures/external-durable-objects-app/package.json +++ b/fixtures/external-durable-objects-app/package.json @@ -5,24 +5,8 @@ "scripts": { "check:type": "tsc && tsc -p tests/tsconfig.json", "dev": "npx concurrently -s first -k \"wrangler dev a/index.ts --local --port 8400\" \"wrangler dev b/index.ts --local --port 8401\" \"npx wrangler dev c/index.ts --local --port 8402\" \"cd d && npx wrangler pages dev public --port 8403 --do PAGES_REFERENCED_DO=MyDurableObject@a\"", - "test": "npx jest --forceExit", - "test:ci": "npx jest --forceExit" - }, - "jest": { - "restoreMocks": true, - "testRegex": ".*.(test|spec)\\.[jt]sx?$", - "testTimeout": 30000, - "transform": { - "^.+\\.c?(t|j)sx?$": [ - "esbuild-jest", - { - "sourcemap": true - } - ] - }, - "transformIgnorePatterns": [ - "node_modules/(?!find-up|locate-path|p-locate|p-limit|yocto-queue|path-exists|execa|strip-final-newline|npm-run-path|path-key|onetime|mimic-fn|human-signals|is-stream)" - ] + "test": "npx vitest", + "test:ci": "npx vitest" }, "devDependencies": { "@cloudflare/workers-types": "^4.20221111.1" diff --git a/fixtures/external-durable-objects-app/tests/index.test.ts b/fixtures/external-durable-objects-app/tests/index.test.ts index 00e23d3a4d23..d0e7f114cfa9 100644 --- a/fixtures/external-durable-objects-app/tests/index.test.ts +++ b/fixtures/external-durable-objects-app/tests/index.test.ts @@ -1,6 +1,7 @@ import { fork } from "child_process"; import * as path from "path"; import { fetch } from "undici"; +import { describe, expect, it, beforeAll, afterAll } from "vitest"; import type { ChildProcess } from "child_process"; describe.skip("Pages Functions", () => { diff --git a/fixtures/external-durable-objects-app/tests/tsconfig.json b/fixtures/external-durable-objects-app/tests/tsconfig.json index 8301a6878d9c..5f4cfc8c969f 100644 --- a/fixtures/external-durable-objects-app/tests/tsconfig.json +++ b/fixtures/external-durable-objects-app/tests/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../tsconfig.json", "compilerOptions": { - "types": ["node", "jest"] + "types": ["node", "vitest"] }, "include": ["**/*.ts"] } diff --git a/fixtures/node-app-pages/package.json b/fixtures/node-app-pages/package.json index aa13d3864794..58e5b9d078f3 100644 --- a/fixtures/node-app-pages/package.json +++ b/fixtures/node-app-pages/package.json @@ -7,22 +7,8 @@ "scripts": { "check:type": "tsc && tsc -p tests/tsconfig.json", "dev": "npx wrangler pages dev public --port 12345 --node-compat", - "test": "npx jest --forceExit", - "test:ci": "npx jest --forceExit" - }, - "jest": { - "testRegex": ".*.(test|spec)\\.[jt]sx?$", - "transform": { - "^.+\\.c?(t|j)sx?$": [ - "esbuild-jest", - { - "sourcemap": true - } - ] - }, - "transformIgnorePatterns": [ - "node_modules/(?!find-up|locate-path|p-locate|p-limit|yocto-queue|path-exists|execa|strip-final-newline|npm-run-path|path-key|onetime|mimic-fn|human-signals|is-stream)" - ] + "test": "npx vitest", + "test:ci": "npx vitest" }, "dependencies": { "stripe": "^9.1.0" diff --git a/fixtures/node-app-pages/tests/index.test.ts b/fixtures/node-app-pages/tests/index.test.ts index e675e79664d5..e33f7e489102 100644 --- a/fixtures/node-app-pages/tests/index.test.ts +++ b/fixtures/node-app-pages/tests/index.test.ts @@ -1,6 +1,7 @@ import { fork } from "child_process"; import path from "path"; import { fetch } from "undici"; +import { describe, expect, it, beforeAll, afterAll } from "vitest"; import type { ChildProcess } from "child_process"; describe("Pages Dev", () => { diff --git a/fixtures/node-app-pages/tests/tsconfig.json b/fixtures/node-app-pages/tests/tsconfig.json index 8301a6878d9c..5f4cfc8c969f 100644 --- a/fixtures/node-app-pages/tests/tsconfig.json +++ b/fixtures/node-app-pages/tests/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../tsconfig.json", "compilerOptions": { - "types": ["node", "jest"] + "types": ["node", "vitest"] }, "include": ["**/*.ts"] } diff --git a/fixtures/pages-d1-shim/package.json b/fixtures/pages-d1-shim/package.json index afa5ff6d46c7..eee2718477c3 100644 --- a/fixtures/pages-d1-shim/package.json +++ b/fixtures/pages-d1-shim/package.json @@ -6,24 +6,8 @@ "scripts": { "check:type": "tsc && tsc -p tests/tsconfig.json", "dev": "npx wrangler pages dev ./public --d1 foobar --port 8777", - "test": "npx jest --forceExit --verbose", - "test:ci": "npx jest --forceExit" - }, - "jest": { - "restoreMocks": true, - "testRegex": ".*.(test|spec)\\.[jt]sx?$", - "testTimeout": 30000, - "transform": { - "^.+\\.c?(t|j)sx?$": [ - "esbuild-jest", - { - "sourcemap": true - } - ] - }, - "transformIgnorePatterns": [ - "node_modules/(?!find-up|locate-path|p-locate|p-limit|yocto-queue|path-exists|execa|strip-final-newline|npm-run-path|path-key|onetime|mimic-fn|human-signals|is-stream)" - ] + "test": "npx vitest", + "test:ci": "npx vitest" }, "devDependencies": { "undici": "^5.9.1" diff --git a/fixtures/pages-d1-shim/tests/index.test.ts b/fixtures/pages-d1-shim/tests/index.test.ts index 98b934676158..dd470b3e2b01 100644 --- a/fixtures/pages-d1-shim/tests/index.test.ts +++ b/fixtures/pages-d1-shim/tests/index.test.ts @@ -3,6 +3,7 @@ import { readFileSync } from "fs"; import { tmpdir } from "os"; import * as path from "path"; import { join } from "path"; +import { describe, expect, it, beforeAll, afterAll } from "vitest"; describe("Pages Functions", () => { it.concurrent("applies the d1 shim", async () => { diff --git a/fixtures/pages-d1-shim/tests/tsconfig.json b/fixtures/pages-d1-shim/tests/tsconfig.json index 6b3fa746b54b..47fdad1c84a7 100644 --- a/fixtures/pages-d1-shim/tests/tsconfig.json +++ b/fixtures/pages-d1-shim/tests/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../tsconfig.json", "compilerOptions": { - "types": ["node", "jest"] + "types": ["node", "vitest"] }, "include": ["**/*.ts"], "exclude": [] diff --git a/fixtures/pages-functions-app/package.json b/fixtures/pages-functions-app/package.json index 4e5e4fd39b83..c1b4ee2d3c2e 100644 --- a/fixtures/pages-functions-app/package.json +++ b/fixtures/pages-functions-app/package.json @@ -7,24 +7,8 @@ "scripts": { "check:type": "tsc && tsc -p tests/tsconfig.json", "dev": "npx wrangler pages dev public --binding=NAME=VALUE --binding=OTHER_NAME=THING=WITH=EQUALS --r2=BUCKET --port 8789", - "test": "npx jest --forceExit", - "test:ci": "npx jest --forceExit" - }, - "jest": { - "restoreMocks": true, - "testRegex": ".*.(test|spec)\\.[jt]sx?$", - "testTimeout": 30000, - "transform": { - "^.+\\.c?(t|j)sx?$": [ - "esbuild-jest", - { - "sourcemap": true - } - ] - }, - "transformIgnorePatterns": [ - "node_modules/(?!find-up|locate-path|p-locate|p-limit|yocto-queue|path-exists|execa|strip-final-newline|npm-run-path|path-key|onetime|mimic-fn|human-signals|is-stream)" - ] + "test": "npx vitest", + "test:ci": "npx vitest" }, "devDependencies": { "@cloudflare/workers-types": "^4.20221111.1", diff --git a/fixtures/pages-functions-app/tests/index.test.ts b/fixtures/pages-functions-app/tests/index.test.ts index d58e60501edd..fde91e7e1aea 100644 --- a/fixtures/pages-functions-app/tests/index.test.ts +++ b/fixtures/pages-functions-app/tests/index.test.ts @@ -1,6 +1,7 @@ import { fork } from "child_process"; import * as path from "path"; import { fetch } from "undici"; +import { describe, it, beforeAll, afterAll } from "vitest"; import type { ChildProcess } from "child_process"; describe("Pages Functions", () => { @@ -50,7 +51,7 @@ describe("Pages Functions", () => { }); }); - it.concurrent("renders static pages", async () => { + it.concurrent("renders static pages", async ({ expect }) => { await readyPromise; const response = await fetch(`http://${ip}:${port}/`); expect(response.headers.get("x-custom")).toBe("header value"); @@ -58,7 +59,7 @@ describe("Pages Functions", () => { expect(text).toContain("Hello, world!"); }); - it.concurrent("renders pages with . characters", async () => { + it.concurrent("renders pages with . characters", async ({ expect }) => { await readyPromise; const response = await fetch(`http://${ip}:${port}/a.b`); expect(response.headers.get("x-custom")).toBe("header value"); @@ -66,21 +67,21 @@ describe("Pages Functions", () => { expect(text).toContain("Hello, a.b!"); }); - it.concurrent("parses URL encoded requests", async () => { + it.concurrent("parses URL encoded requests", async ({ expect }) => { await readyPromise; const response = await fetch(`http://${ip}:${port}/[id].js`); const text = await response.text(); expect(text).toContain("// test script"); }); - it.concurrent("parses URLs with regex chars", async () => { + it.concurrent("parses URLs with regex chars", async ({ expect }) => { await readyPromise; const response = await fetch(`http://${ip}:${port}/regex_chars/my-file`); const text = await response.text(); expect(text).toEqual("My file with regex chars"); }); - it.concurrent("passes environment variables", async () => { + it.concurrent("passes environment variables", async ({ expect }) => { await readyPromise; const response = await fetch(`http://${ip}:${port}/variables`); const env = await response.json(); @@ -98,22 +99,25 @@ describe("Pages Functions", () => { }); }); - it.concurrent("intercepts static requests with next()", async () => { - await readyPromise; - const response = await fetch(`http://${ip}:${port}/intercept`); - const text = await response.text(); - expect(text).toContain("Hello, world!"); - expect(response.headers.get("x-set-from-functions")).toBe("true"); - }); + it.concurrent( + "intercepts static requests with next()", + async ({ expect }) => { + await readyPromise; + const response = await fetch(`http://${ip}:${port}/intercept`); + const text = await response.text(); + expect(text).toContain("Hello, world!"); + expect(response.headers.get("x-set-from-functions")).toBe("true"); + } + ); - it.concurrent("can make SSR responses", async () => { + it.concurrent("can make SSR responses", async ({ expect }) => { await readyPromise; const response = await fetch(`http://${ip}:${port}/date`); const text = await response.text(); expect(text).toMatch(/\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d/); }); - it.concurrent("can use parameters", async () => { + it.concurrent("can use parameters", async ({ expect }) => { await readyPromise; const response = await fetch(`http://${ip}:${port}/blog/hello-world`); const text = await response.text(); @@ -122,7 +126,7 @@ describe("Pages Functions", () => { it.concurrent( "can override the incoming request with next() parameters", - async () => { + async ({ expect }) => { await readyPromise; const response = await fetch(`http://${ip}:${port}/next`); const text = await response.text(); @@ -131,7 +135,7 @@ describe("Pages Functions", () => { ); describe("can mount a plugin", () => { - it.concurrent("should mount Middleware", async () => { + it.concurrent("should mount Middleware", async ({ expect }) => { await readyPromise; const response = await fetch( `http://${ip}:${port}/mounted-plugin/some-page` @@ -140,7 +144,7 @@ describe("Pages Functions", () => { expect(text).toContain(""); }); - it.concurrent("should mount Fixed page", async () => { + it.concurrent("should mount Fixed page", async ({ expect }) => { await readyPromise; const response = await fetch(`http://${ip}:${port}/mounted-plugin/fixed`); const text = await response.text(); @@ -149,14 +153,14 @@ describe("Pages Functions", () => { }); describe("can import static assets", () => { - it.concurrent("should render a static asset", async () => { + it.concurrent("should render a static asset", async ({ expect }) => { await readyPromise; const response = await fetch(`http://${ip}:${port}/static`); const text = await response.text(); expect(text).toContain("

Hello from an imported static asset!

"); }); - it.concurrent("should render from a Plugin", async () => { + it.concurrent("should render from a Plugin", async ({ expect }) => { await readyPromise; const response = await fetch( `http://${ip}:${port}/mounted-plugin/static` @@ -167,7 +171,7 @@ describe("Pages Functions", () => { ); }); - it.concurrent("should render static/foo", async () => { + it.concurrent("should render static/foo", async ({ expect }) => { await readyPromise; const response = await fetch( `http://${ip}:${port}/mounted-plugin/static/foo` @@ -176,7 +180,7 @@ describe("Pages Functions", () => { expect(text).toContain("

foo

"); }); - it.concurrent("should render static/dir/bar", async () => { + it.concurrent("should render static/dir/bar", async ({ expect }) => { await readyPromise; const response = await fetch( `http://${ip}:${port}/mounted-plugin/static/dir/bar` @@ -185,17 +189,20 @@ describe("Pages Functions", () => { expect(text).toContain("

bar

"); }); - it.concurrent("supports importing .html from a function", async () => { - await readyPromise; - const response = await fetch(`http://${ip}:${port}/import-html`); - expect(response.headers.get("x-custom")).toBe("header value"); - const text = await response.text(); - expect(text).toContain("

Hello from an imported static asset!

"); - }); + it.concurrent( + "supports importing .html from a function", + async ({ expect }) => { + await readyPromise; + const response = await fetch(`http://${ip}:${port}/import-html`); + expect(response.headers.get("x-custom")).toBe("header value"); + const text = await response.text(); + expect(text).toContain("

Hello from an imported static asset!

"); + } + ); }); describe("it supports R2", () => { - it.concurrent("should allow creates", async () => { + it.concurrent("should allow creates", async ({ expect }) => { await readyPromise; const response = await fetch(`http://${ip}:${port}/r2/create`, { method: "PUT", @@ -217,7 +224,7 @@ describe("Pages Functions", () => { }); describe("redirects", () => { - it.concurrent("still attaches redirects correctly", async () => { + it.concurrent("still attaches redirects correctly", async ({ expect }) => { await readyPromise; const response = await fetch(`http://${ip}:${port}/redirect`, { redirect: "manual", @@ -228,14 +235,14 @@ describe("Pages Functions", () => { }); describe("headers", () => { - it.concurrent("still attaches headers correctly", async () => { + it.concurrent("still attaches headers correctly", async ({ expect }) => { await readyPromise; const response = await fetch(`http://${ip}:${port}/`); expect(response.headers.get("A-Header")).toEqual("Some-Value"); }); - it.concurrent("can unset and set together", async () => { + it.concurrent("can unset and set together", async ({ expect }) => { await readyPromise; const response = await fetch(`http://${ip}:${port}/header-test`); @@ -244,7 +251,7 @@ describe("Pages Functions", () => { }); describe("passThroughOnException", () => { - it.concurrent("works on a single handler", async () => { + it.concurrent("works on a single handler", async ({ expect }) => { await readyPromise; const response = await fetch( `http://${ip}:${port}/passThroughOnExceptionOpen` @@ -254,7 +261,7 @@ describe("Pages Functions", () => { expect(await response.text()).toContain("Hello, world!"); }); - it.concurrent("defaults closed", async () => { + it.concurrent("defaults closed", async ({ expect }) => { await readyPromise; const response = await fetch( `http://${ip}:${port}/passThroughOnExceptionClosed` @@ -264,7 +271,7 @@ describe("Pages Functions", () => { expect(await response.text()).not.toContain("Hello, world!"); }); - it.concurrent("works for nested handlers", async () => { + it.concurrent("works for nested handlers", async ({ expect }) => { await readyPromise; const response = await fetch( `http://${ip}:${port}/passThroughOnException/nested` @@ -276,7 +283,7 @@ describe("Pages Functions", () => { it.concurrent( "allows errors to still be manually caught in middleware", - async () => { + async ({ expect }) => { await readyPromise; let response = await fetch( `http://${ip}:${port}/passThroughOnExceptionWithCapture/nested` diff --git a/fixtures/pages-functions-app/tests/tsconfig.json b/fixtures/pages-functions-app/tests/tsconfig.json index 6b3fa746b54b..47fdad1c84a7 100644 --- a/fixtures/pages-functions-app/tests/tsconfig.json +++ b/fixtures/pages-functions-app/tests/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../tsconfig.json", "compilerOptions": { - "types": ["node", "jest"] + "types": ["node", "vitest"] }, "include": ["**/*.ts"], "exclude": [] diff --git a/fixtures/pages-functions-with-routes-app/package.json b/fixtures/pages-functions-with-routes-app/package.json index c995278b5927..7748e3dd771e 100644 --- a/fixtures/pages-functions-with-routes-app/package.json +++ b/fixtures/pages-functions-with-routes-app/package.json @@ -6,24 +6,8 @@ "scripts": { "check:type": "tsc && tsc -p tests/tsconfig.json", "dev": "npx wrangler pages dev public --port 8776", - "test": "npx jest --forceExit", - "test:ci": "npx jest --forceExit" - }, - "jest": { - "restoreMocks": true, - "testRegex": ".*.(test|spec)\\.[jt]sx?$", - "testTimeout": 30000, - "transform": { - "^.+\\.c?(t|j)sx?$": [ - "esbuild-jest", - { - "sourcemap": true - } - ] - }, - "transformIgnorePatterns": [ - "node_modules/(?!find-up|locate-path|p-locate|p-limit|yocto-queue|path-exists|execa|strip-final-newline|npm-run-path|path-key|onetime|mimic-fn|human-signals|is-stream)" - ] + "test": "npx vitest", + "test:ci": "npx vitest" }, "devDependencies": { "@cloudflare/workers-types": "^4.20221111.1", diff --git a/fixtures/pages-functions-with-routes-app/tests/index.test.ts b/fixtures/pages-functions-with-routes-app/tests/index.test.ts index da21aae1f778..04703b69c981 100644 --- a/fixtures/pages-functions-with-routes-app/tests/index.test.ts +++ b/fixtures/pages-functions-with-routes-app/tests/index.test.ts @@ -1,6 +1,7 @@ import { fork } from "child_process"; import * as path from "path"; import { fetch } from "undici"; +import { describe, expect, it, beforeAll, afterAll } from "vitest"; import type { ChildProcess } from "child_process"; describe("Pages Functions with custom _routes.json", () => { diff --git a/fixtures/pages-functions-with-routes-app/tests/tsconfig.json b/fixtures/pages-functions-with-routes-app/tests/tsconfig.json index 8301a6878d9c..5f4cfc8c969f 100644 --- a/fixtures/pages-functions-with-routes-app/tests/tsconfig.json +++ b/fixtures/pages-functions-with-routes-app/tests/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../tsconfig.json", "compilerOptions": { - "types": ["node", "jest"] + "types": ["node", "vitest"] }, "include": ["**/*.ts"] } diff --git a/fixtures/pages-workerjs-and-functions-app/package.json b/fixtures/pages-workerjs-and-functions-app/package.json index eafc6fc20496..0f6ef15b966f 100644 --- a/fixtures/pages-workerjs-and-functions-app/package.json +++ b/fixtures/pages-workerjs-and-functions-app/package.json @@ -6,24 +6,8 @@ "scripts": { "check:type": "tsc && tsc -p tests/tsconfig.json", "dev": "npx wrangler pages dev public --port 8955", - "test": "npx jest --forceExit --verbose", - "test:ci": "npx jest --forceExit" - }, - "jest": { - "restoreMocks": true, - "testRegex": ".*.(test|spec)\\.[jt]sx?$", - "testTimeout": 30000, - "transform": { - "^.+\\.c?(t|j)sx?$": [ - "esbuild-jest", - { - "sourcemap": true - } - ] - }, - "transformIgnorePatterns": [ - "node_modules/(?!find-up|locate-path|p-locate|p-limit|yocto-queue|path-exists|execa|strip-final-newline|npm-run-path|path-key|onetime|mimic-fn|human-signals|is-stream)" - ] + "test": "npx vitest", + "test:ci": "npx vitest" }, "devDependencies": { "undici": "^5.9.1" diff --git a/fixtures/pages-workerjs-and-functions-app/tests/index.test.ts b/fixtures/pages-workerjs-and-functions-app/tests/index.test.ts index a4e3752f4284..d6c58510cc9d 100644 --- a/fixtures/pages-workerjs-and-functions-app/tests/index.test.ts +++ b/fixtures/pages-workerjs-and-functions-app/tests/index.test.ts @@ -2,6 +2,7 @@ import { fork } from "child_process"; import * as path from "path"; import { fetch } from "undici"; import type { ChildProcess } from "child_process"; +import { describe, expect, it, beforeAll, afterAll } from "vitest"; describe("Pages project with `_worker.js` and `/functions` directory", () => { let wranglerProcess: ChildProcess; diff --git a/fixtures/pages-workerjs-and-functions-app/tests/tsconfig.json b/fixtures/pages-workerjs-and-functions-app/tests/tsconfig.json index 8301a6878d9c..5f4cfc8c969f 100644 --- a/fixtures/pages-workerjs-and-functions-app/tests/tsconfig.json +++ b/fixtures/pages-workerjs-and-functions-app/tests/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../tsconfig.json", "compilerOptions": { - "types": ["node", "jest"] + "types": ["node", "vitest"] }, "include": ["**/*.ts"] } diff --git a/fixtures/pages-workerjs-app/package.json b/fixtures/pages-workerjs-app/package.json index 9502f04da8a0..ba1df5830c99 100644 --- a/fixtures/pages-workerjs-app/package.json +++ b/fixtures/pages-workerjs-app/package.json @@ -6,24 +6,8 @@ "scripts": { "check:type": "tsc", "dev": "npx wrangler pages dev ./workerjs-test --port 8792", - "test": "npx jest --forceExit --verbose", - "test:ci": "npx jest --forceExit" - }, - "jest": { - "restoreMocks": true, - "testRegex": ".*.(test|spec)\\.[jt]sx?$", - "testTimeout": 30000, - "transform": { - "^.+\\.c?(t|j)sx?$": [ - "esbuild-jest", - { - "sourcemap": true - } - ] - }, - "transformIgnorePatterns": [ - "node_modules/(?!find-up|locate-path|p-locate|p-limit|yocto-queue|path-exists|execa|strip-final-newline|npm-run-path|path-key|onetime|mimic-fn|human-signals|is-stream)" - ] + "test": "npx vitest", + "test:ci": "npx vitest" }, "devDependencies": { "undici": "^5.9.1" diff --git a/fixtures/pages-workerjs-app/tests/index.test.ts b/fixtures/pages-workerjs-app/tests/index.test.ts index df3be978bae8..a09ce47b450e 100644 --- a/fixtures/pages-workerjs-app/tests/index.test.ts +++ b/fixtures/pages-workerjs-app/tests/index.test.ts @@ -1,5 +1,6 @@ import { execSync } from "child_process"; import path from "path"; +import { describe, expect, it } from "vitest"; describe("Pages _worker.js", () => { it.concurrent( diff --git a/fixtures/pages-workerjs-with-routes-app/package.json b/fixtures/pages-workerjs-with-routes-app/package.json index d90073be3e2e..eff2b57d5cda 100644 --- a/fixtures/pages-workerjs-with-routes-app/package.json +++ b/fixtures/pages-workerjs-with-routes-app/package.json @@ -6,24 +6,8 @@ "scripts": { "check:type": "tsc", "dev": "npx wrangler pages dev public --port 8751", - "test": "npx jest --forceExit --verbose", - "test:ci": "npx jest --forceExit" - }, - "jest": { - "restoreMocks": true, - "testRegex": ".*.(test|spec)\\.[jt]sx?$", - "testTimeout": 30000, - "transform": { - "^.+\\.c?(t|j)sx?$": [ - "esbuild-jest", - { - "sourcemap": true - } - ] - }, - "transformIgnorePatterns": [ - "node_modules/(?!find-up|locate-path|p-locate|p-limit|yocto-queue|path-exists|execa|strip-final-newline|npm-run-path|path-key|onetime|mimic-fn|human-signals|is-stream)" - ] + "test": "npx vitest", + "test:ci": "npx vitest" }, "devDependencies": { "undici": "^5.9.1" diff --git a/fixtures/pages-workerjs-with-routes-app/tests/index.test.ts b/fixtures/pages-workerjs-with-routes-app/tests/index.test.ts index b34ef57a6b7a..426e990854c7 100644 --- a/fixtures/pages-workerjs-with-routes-app/tests/index.test.ts +++ b/fixtures/pages-workerjs-with-routes-app/tests/index.test.ts @@ -1,6 +1,7 @@ import { fork } from "child_process"; import * as path from "path"; import { fetch } from "undici"; +import { describe, expect, it, beforeAll, afterAll } from "vitest"; import type { ChildProcess } from "child_process"; describe("Pages Advanced Mode with custom _routes.json", () => { diff --git a/fixtures/pages-workerjs-with-routes-app/tsconfig.json b/fixtures/pages-workerjs-with-routes-app/tsconfig.json index 73a2a753f391..9099b3f778f5 100644 --- a/fixtures/pages-workerjs-with-routes-app/tsconfig.json +++ b/fixtures/pages-workerjs-with-routes-app/tsconfig.json @@ -4,7 +4,7 @@ "esModuleInterop": true, "module": "CommonJS", "lib": ["ES2020"], - "types": ["node", "jest"], + "types": ["node", "vitest"], "moduleResolution": "node", "noEmit": true }, diff --git a/fixtures/pages-ws-app/package.json b/fixtures/pages-ws-app/package.json index d3fe3640995f..d3864ecbf43a 100644 --- a/fixtures/pages-ws-app/package.json +++ b/fixtures/pages-ws-app/package.json @@ -9,24 +9,8 @@ "check:type": "tsc && tsc -p tests/tsconfig.json", "dev": "npx wrangler pages dev --port 8790 --proxy 8791 -- npm run server", "server": "node dist/index.js", - "test": "npx jest --forceExit", - "test:ci": "npx jest --forceExit" - }, - "jest": { - "restoreMocks": true, - "testRegex": ".*.(test|spec)\\.[jt]sx?$", - "testTimeout": 30000, - "transform": { - "^.+\\.c?(t|j)sx?$": [ - "esbuild-jest", - { - "sourcemap": true - } - ] - }, - "transformIgnorePatterns": [ - "node_modules/(?!find-up|locate-path|p-locate|p-limit|yocto-queue|path-exists|execa|strip-final-newline|npm-run-path|path-key|onetime|mimic-fn|human-signals|is-stream)" - ] + "test": "npx vitest", + "test:ci": "npx vitest" }, "devDependencies": { "ws": "^8.8.0" diff --git a/fixtures/pages-ws-app/tests/index.test.ts b/fixtures/pages-ws-app/tests/index.test.ts index aa80a488cdab..fee99b803147 100644 --- a/fixtures/pages-ws-app/tests/index.test.ts +++ b/fixtures/pages-ws-app/tests/index.test.ts @@ -1,6 +1,7 @@ import { fork, spawnSync } from "child_process"; import * as path from "path"; import { upgradingFetch } from "@miniflare/web-sockets"; +import { describe, expect, it, beforeAll, afterAll } from "vitest"; import type { ChildProcess } from "child_process"; const isWindows = process.platform === "win32"; diff --git a/fixtures/pages-ws-app/tests/tsconfig.json b/fixtures/pages-ws-app/tests/tsconfig.json index 8301a6878d9c..5f4cfc8c969f 100644 --- a/fixtures/pages-ws-app/tests/tsconfig.json +++ b/fixtures/pages-ws-app/tests/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../tsconfig.json", "compilerOptions": { - "types": ["node", "jest"] + "types": ["node", "vitest"] }, "include": ["**/*.ts"] } diff --git a/fixtures/remix-pages-app/package.json b/fixtures/remix-pages-app/package.json index 6ae2f8cf8066..9203b0b6de99 100644 --- a/fixtures/remix-pages-app/package.json +++ b/fixtures/remix-pages-app/package.json @@ -8,23 +8,9 @@ "dev:wrangler": "cross-env NODE_ENV=development wrangler pages dev ./public", "dev": "remix build && run-p \"dev:*\"", "start": "cross-env NODE_ENV=production npm run dev:wrangler", - "check:type": "tsc && tsc -p tests/tsconfig.json" - }, - "jest": { - "restoreMocks": true, - "testRegex": ".*.(test|spec)\\.[jt]sx?$", - "testTimeout": 30000, - "transform": { - "^.+\\.c?(t|j)sx?$": [ - "esbuild-jest", - { - "sourcemap": true - } - ] - }, - "transformIgnorePatterns": [ - "node_modules/(?!find-up|locate-path|p-locate|p-limit|yocto-queue|path-exists|execa|strip-final-newline|npm-run-path|path-key|onetime|mimic-fn|human-signals|is-stream)" - ] + "check:type": "tsc && tsc -p tests/tsconfig.json", + "test": "npx vitest", + "test:ci": "npx vitest" }, "dependencies": { "@remix-run/cloudflare": "^1.8.2", diff --git a/fixtures/remix-pages-app/tests/index.test.ts b/fixtures/remix-pages-app/tests/index.test.ts index 48986d03b117..3c20a7abff06 100644 --- a/fixtures/remix-pages-app/tests/index.test.ts +++ b/fixtures/remix-pages-app/tests/index.test.ts @@ -1,6 +1,7 @@ import { fork, spawnSync } from "child_process"; import * as path from "path"; import { fetch } from "undici"; +import { describe, expect, it, beforeAll, afterAll } from "vitest"; import type { ChildProcess } from "child_process"; const isWindows = process.platform === "win32"; diff --git a/fixtures/remix-pages-app/tests/tsconfig.json b/fixtures/remix-pages-app/tests/tsconfig.json index a0ef5a29f91c..e708738a69ae 100644 --- a/fixtures/remix-pages-app/tests/tsconfig.json +++ b/fixtures/remix-pages-app/tests/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../tsconfig.json", "compilerOptions": { "lib": ["ES2019"], - "types": ["node", "jest"] + "types": ["node", "vitest"] }, "include": ["**/*.ts"], "exclude": [] diff --git a/fixtures/service-bindings-app/package.json b/fixtures/service-bindings-app/package.json index 27eecd4bff9b..830e1338c420 100644 --- a/fixtures/service-bindings-app/package.json +++ b/fixtures/service-bindings-app/package.json @@ -5,23 +5,7 @@ "scripts": { "check:type": "tsc && tsc -p tests/tsconfig.json", "dev": "npx concurrently -s first -k \"wrangler dev a/index.ts --local --port 8300\" \"wrangler dev b/index.ts --local --port 8301\"", - "test": "npx jest --forceExit", - "test:ci": "npx jest --forceExit" - }, - "jest": { - "restoreMocks": true, - "testRegex": ".*.(test|spec)\\.[jt]sx?$", - "testTimeout": 30000, - "transform": { - "^.+\\.c?(t|j)sx?$": [ - "esbuild-jest", - { - "sourcemap": true - } - ] - }, - "transformIgnorePatterns": [ - "node_modules/(?!find-up|locate-path|p-locate|p-limit|yocto-queue|path-exists|execa|strip-final-newline|npm-run-path|path-key|onetime|mimic-fn|human-signals|is-stream)" - ] + "test": "npx vitest", + "test:ci": "npx vitest" } } diff --git a/fixtures/service-bindings-app/tests/index.test.ts b/fixtures/service-bindings-app/tests/index.test.ts index becb9f425f8d..02a4534c905c 100644 --- a/fixtures/service-bindings-app/tests/index.test.ts +++ b/fixtures/service-bindings-app/tests/index.test.ts @@ -1,6 +1,7 @@ import { fork } from "child_process"; import * as path from "path"; import { fetch } from "undici"; +import { describe, expect, it, beforeAll, afterAll } from "vitest"; import type { ChildProcess } from "child_process"; describe.skip("Service Bindings", () => { diff --git a/fixtures/service-bindings-app/tests/tsconfig.json b/fixtures/service-bindings-app/tests/tsconfig.json index 6b3fa746b54b..47fdad1c84a7 100644 --- a/fixtures/service-bindings-app/tests/tsconfig.json +++ b/fixtures/service-bindings-app/tests/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../tsconfig.json", "compilerOptions": { - "types": ["node", "jest"] + "types": ["node", "vitest"] }, "include": ["**/*.ts"], "exclude": [] diff --git a/fixtures/worker-app/package.json b/fixtures/worker-app/package.json index 47f83159114e..0aac6e986db8 100644 --- a/fixtures/worker-app/package.json +++ b/fixtures/worker-app/package.json @@ -7,22 +7,8 @@ "author": "", "main": "src/index.js", "scripts": { - "check:type": "tsc" - }, - "jest": { - "restoreMocks": true, - "testRegex": ".*.(test|spec)\\.[jt]sx?$", - "testTimeout": 30000, - "transform": { - "^.+\\.c?(t|j)sx?$": [ - "esbuild-jest", - { - "sourcemap": true - } - ] - }, - "transformIgnorePatterns": [ - "node_modules/(?!find-up|locate-path|p-locate|p-limit|yocto-queue|path-exists|execa|strip-final-newline|npm-run-path|path-key|onetime|mimic-fn|human-signals|is-stream)" - ] + "check:type": "tsc", + "test": "npx vitest", + "test:ci": "npx vitest" } } diff --git a/fixtures/worker-app/tests/index.test.ts b/fixtures/worker-app/tests/index.test.ts index d50f107ac0f5..f91a56bb1205 100644 --- a/fixtures/worker-app/tests/index.test.ts +++ b/fixtures/worker-app/tests/index.test.ts @@ -1,6 +1,7 @@ import { fork } from "child_process"; import * as path from "path"; import { fetch } from "undici"; +import { describe, expect, it, beforeAll, afterAll } from "vitest"; import type { ChildProcess } from "child_process"; describe("'wrangler dev' correctly renders pages", () => { diff --git a/fixtures/worker-app/tsconfig.json b/fixtures/worker-app/tsconfig.json index 65dd634208f4..73fe3221b6f4 100644 --- a/fixtures/worker-app/tsconfig.json +++ b/fixtures/worker-app/tsconfig.json @@ -4,7 +4,7 @@ "esModuleInterop": true, "module": "CommonJS", "lib": ["ES2020"], - "types": ["jest", "node"], + "types": ["vitest", "node"], "moduleResolution": "node", "noEmit": true }, diff --git a/package-lock.json b/package-lock.json index 6baccdc60207..b4dcc62b0f25 100644 --- a/package-lock.json +++ b/package-lock.json @@ -33,7 +33,9 @@ "prettier": "^2.6.2", "prettier-plugin-packagejson": "^2.2.18", "rimraf": "^3.0.2", - "typescript": "^4.8.4" + "typescript": "^4.8.4", + "vite": "^4.0.4", + "vitest": "^0.26.3" }, "devDependencies": { "@cloudflare/workers-types": "^4.20221111.1" @@ -2665,6 +2667,141 @@ "node": ">=12" } }, + "node_modules/@esbuild/android-arm64": { + "version": "0.16.13", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.16.13.tgz", + "integrity": "sha512-r4xetsd1ez1NF9/9R2f9Q6AlxqiZLwUqo7ICOcvEVwopVkXUcspIjEbJk0EVTgT6Cp5+ymzGPT6YNV0ievx4yA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.16.13", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.16.13.tgz", + "integrity": "sha512-hKt1bFht/Vtp0xJ0ZVzFMnPy1y1ycmM3KNnp3zsyZfQmw7nhs2WLO4vxdR5YG+6RsHKCb2zbZ3VwlC0Tij0qyA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.16.13", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.16.13.tgz", + "integrity": "sha512-ogrVuNi2URocrr3Ps20f075EMm9V7IeenOi9FRj4qdbT6mQlwLuP4l90PW2iBrKERx0oRkcZprEUNsz/3xd7ww==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.16.13", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.16.13.tgz", + "integrity": "sha512-Agajik9SBGiKD7FPXE+ExW6x3MgA/dUdpZnXa9y1tyfE4lKQx+eQiknSdrBnWPeqa9wL0AOvkhghmYhpVkyqkA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.16.13", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.16.13.tgz", + "integrity": "sha512-KxMO3/XihBcHM+xQUM6nQZO1SgQuOsd1DCnKF1a4SIf/i5VD45vrqN3k8ePgFrEbMi7m5JeGmvNqwJXinF0a4Q==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.16.13", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.16.13.tgz", + "integrity": "sha512-Ez15oqV1vwvZ30cVLeBW14BsWq/fdWNQGMOxxqaSJVQVLqHhvgfQ7gxGDiN9tpJdeQhqJO+Q0r02/Tce5+USNg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.16.13", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.16.13.tgz", + "integrity": "sha512-18dLd2L3mda+iFj6sswyBMSh2UwniamD9M4DwPv8VM+9apRFlQ5IGKxBdumnTuOI4NvwwAernmUseWhYQ9k+rg==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.16.13", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.16.13.tgz", + "integrity": "sha512-qi5n7KwcGViyJeZeQnu8fB6dC3Mlm5PGaqSv2HhQDDx/MPvVfQGNMcv7zcBL4qk3FkuWhGVwXkjQ76x7R0PWlA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.16.13", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.16.13.tgz", + "integrity": "sha512-2489Xad9sr+6GD7nB913fUqpCsSwVwgskkQTq4Or2mZntSPYPebyJm8l1YruHo7oqYMTGV6RiwGE4gRo3H+EPQ==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/@esbuild/linux-loong64": { "version": "0.15.12", "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.15.12.tgz", @@ -2681,6 +2818,171 @@ "node": ">=12" } }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.16.13", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.16.13.tgz", + "integrity": "sha512-qhhdWph9FLwD9rVVC/nUf7k2U4NZIA6/mGx0B7+O6PFV0GjmPA2E3zDQ4NUjq9P26E0DeAZy9akH9dYcUBRU7A==", + "cpu": [ + "mips64el" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.16.13", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.16.13.tgz", + "integrity": "sha512-cVWAPKsrRVxI1jCeJHnYSbE3BrEU+pZTZK2gfao9HRxuc+3m4+RLfs3EVEpGLmMKEcWfVCB9wZ3yNxnknutGKQ==", + "cpu": [ + "ppc64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.16.13", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.16.13.tgz", + "integrity": "sha512-Agb7dbRyZWnmPn5Vvf0eyqaEUqSsaIUwwyInu2EoFTaIDRp093QU2M5alUyOooMLkRbD1WvqQNwx08Z/g+SAcQ==", + "cpu": [ + "riscv64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.16.13", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.16.13.tgz", + "integrity": "sha512-AqRBIrc/+kl08ahliNG+EyU+j41wIzQfwBTKpi80cCDiYvYFPuXjvzZsD9muiu58Isj0RVni9VgC4xK/AnSW4g==", + "cpu": [ + "s390x" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.16.13", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.16.13.tgz", + "integrity": "sha512-S4wn2BimuhPcoArRtVrdHUKIymCCZcYAXQE47kUiX4yrUrEX2/ifn5eKNbZ5c1jJKUlh1gC2ESIN+iw3wQax3g==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.16.13", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.16.13.tgz", + "integrity": "sha512-2c8JWgfUMlQHTdaR5X3xNMwqOyad8kgeCupuVkdm3QkUOzGREjlTETQsK6oHifocYzDCo9FeKcUwsK356SdR+g==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.16.13", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.16.13.tgz", + "integrity": "sha512-Bwh+PmKD/LK+xBjqIpnYnKYj0fIyQJ0YpRxsn0F+WfzvQ2OA+GKDlf8AHosiCns26Q4Dje388jQVwfOBZ1GaFw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.16.13", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.16.13.tgz", + "integrity": "sha512-8wwk6f9XGnhrF94/DBdFM4Xm1JeCyGTCj67r516VS9yvBVQf3Rar54L+XPVDs/oZOokwH+XsktrgkuTMAmjntg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.16.13", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.16.13.tgz", + "integrity": "sha512-Jmwbp/5ArLCiRAHC33ODfcrlIcbP/exXkOEUVkADNJC4e/so2jm+i8IQFvVX/lA2GWvK3GdgcN0VFfp9YITAbg==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.16.13", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.16.13.tgz", + "integrity": "sha512-AX6WjntGjhJHzrPSVvjMD7grxt41koHfAOx6lxLorrpDwwIKKPaGDASPZgvFIZHTbwhOtILW6vAXxYPDsKpDJA==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.16.13", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.16.13.tgz", + "integrity": "sha512-A+U4gM6OOkPS03UgVU08GTpAAAxPsP/8Z4FmneGo4TaVSD99bK9gVJXlqUEPMO/htFXEAht2O6pX4ErtLY5tVg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/@eslint/eslintrc": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.3.tgz", @@ -4064,6 +4366,32 @@ "node": ">=6.0.0" } }, + "node_modules/@jridgewell/source-map": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.2.tgz", + "integrity": "sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==", + "optional": true, + "peer": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, + "node_modules/@jridgewell/source-map/node_modules/@jridgewell/gen-mapping": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", + "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", + "optional": true, + "peer": true, + "dependencies": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/@jridgewell/sourcemap-codec": { "version": "1.4.14", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", @@ -5552,7 +5880,7 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", - "dev": true, + "devOptional": true, "engines": { "node": ">= 6" } @@ -5647,6 +5975,19 @@ "@types/responselike": "^1.0.0" } }, + "node_modules/@types/chai": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.4.tgz", + "integrity": "sha512-KnRanxnpfpjUTqTCXslZSEdLfXExwgNxYPdiO2WGUj8+HDjFi8R3k5RVKPeSCzLjCcshCAtVO2QBbVuAV4kTnw==" + }, + "node_modules/@types/chai-subset": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@types/chai-subset/-/chai-subset-1.3.3.tgz", + "integrity": "sha512-frBecisrNGz+F4T6bcc+NLeolfiojh5FxW2klu669+8BARtyQv2C/GkNW6FUodVe4BroGMP/wER/YDGc7rEllw==", + "dependencies": { + "@types/chai": "*" + } + }, "node_modules/@types/command-exists": { "version": "1.2.0", "dev": true, @@ -6642,7 +6983,7 @@ "version": "2.0.6", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==", - "dev": true + "devOptional": true }, "node_modules/accepts": { "version": "1.3.8", @@ -6657,9 +6998,9 @@ } }, "node_modules/acorn": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz", - "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==", + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz", + "integrity": "sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==", "bin": { "acorn": "bin/acorn" }, @@ -6671,7 +7012,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-6.0.0.tgz", "integrity": "sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg==", - "dev": true, + "devOptional": true, "dependencies": { "acorn": "^7.1.1", "acorn-walk": "^7.1.1" @@ -6681,7 +7022,7 @@ "version": "7.4.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", - "dev": true, + "devOptional": true, "bin": { "acorn": "bin/acorn" }, @@ -6693,7 +7034,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz", "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==", - "dev": true, + "devOptional": true, "engines": { "node": ">=0.4.0" } @@ -6709,7 +7050,6 @@ "version": "8.2.0", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", - "dev": true, "engines": { "node": ">=0.4.0" } @@ -6718,7 +7058,7 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "dev": true, + "devOptional": true, "dependencies": { "debug": "4" }, @@ -7045,6 +7385,14 @@ "inherits": "2.0.1" } }, + "node_modules/assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "engines": { + "node": "*" + } + }, "node_modules/assign-symbols": { "version": "1.0.0", "license": "MIT", @@ -7104,7 +7452,7 @@ "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "dev": true + "devOptional": true }, "node_modules/atob": { "version": "2.1.2", @@ -7602,7 +7950,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz", "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==", - "dev": true + "devOptional": true }, "node_modules/browserify-aes": { "version": "1.2.0", @@ -7994,6 +8342,23 @@ "node": "6.* || 8.* || >= 10.*" } }, + "node_modules/chai": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.7.tgz", + "integrity": "sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A==", + "dependencies": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.2", + "deep-eql": "^4.1.2", + "get-func-name": "^2.0.0", + "loupe": "^2.3.1", + "pathval": "^1.1.1", + "type-detect": "^4.0.5" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -8058,6 +8423,14 @@ "version": "0.7.0", "license": "MIT" }, + "node_modules/check-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", + "integrity": "sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==", + "engines": { + "node": "*" + } + }, "node_modules/chokidar": { "version": "3.5.3", "funding": [ @@ -8527,7 +8900,7 @@ "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, + "devOptional": true, "dependencies": { "delayed-stream": "~1.0.0" }, @@ -8552,7 +8925,7 @@ }, "node_modules/commander": { "version": "2.20.3", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/commondir": { @@ -8945,13 +9318,13 @@ "version": "0.4.4", "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.4.4.tgz", "integrity": "sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw==", - "dev": true + "devOptional": true }, "node_modules/cssstyle": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz", "integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==", - "dev": true, + "devOptional": true, "dependencies": { "cssom": "~0.3.6" }, @@ -8963,7 +9336,7 @@ "version": "0.3.8", "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", - "dev": true + "devOptional": true }, "node_modules/csstype": { "version": "3.0.10", @@ -9017,7 +9390,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-2.0.0.tgz", "integrity": "sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ==", - "dev": true, + "devOptional": true, "dependencies": { "abab": "^2.0.3", "whatwg-mimetype": "^2.3.0", @@ -9103,7 +9476,7 @@ "version": "10.4.3", "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==", - "dev": true + "devOptional": true }, "node_modules/decode-named-character-reference": { "version": "1.0.2", @@ -9154,6 +9527,17 @@ "version": "0.7.0", "license": "MIT" }, + "node_modules/deep-eql": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", + "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", + "dependencies": { + "type-detect": "^4.0.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/deep-equal": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.1.0.tgz", @@ -9285,7 +9669,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "dev": true, + "devOptional": true, "engines": { "node": ">=0.4.0" } @@ -9453,7 +9837,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz", "integrity": "sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg==", - "dev": true, + "devOptional": true, "dependencies": { "webidl-conversions": "^5.0.0" }, @@ -9465,7 +9849,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz", "integrity": "sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA==", - "dev": true, + "devOptional": true, "engines": { "node": ">=8" } @@ -12318,7 +12702,7 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", - "dev": true, + "devOptional": true, "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", @@ -12516,6 +12900,14 @@ "node": "6.* || 8.* || >= 10.*" } }, + "node_modules/get-func-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", + "integrity": "sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==", + "engines": { + "node": "*" + } + }, "node_modules/get-intrinsic": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.3.tgz", @@ -13093,7 +13485,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz", "integrity": "sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ==", - "dev": true, + "devOptional": true, "dependencies": { "whatwg-encoding": "^1.0.5" }, @@ -13132,7 +13524,7 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", - "dev": true, + "devOptional": true, "dependencies": { "@tootallnate/once": "1", "agent-base": "6", @@ -13202,7 +13594,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", - "dev": true, + "devOptional": true, "dependencies": { "agent-base": "6", "debug": "4" @@ -14180,7 +14572,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", - "dev": true + "devOptional": true }, "node_modules/is-reference": { "version": "3.0.0", @@ -18463,7 +18855,7 @@ "version": "16.7.0", "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.7.0.tgz", "integrity": "sha512-u9Smc2G1USStM+s/x1ru5Sxrl6mPYCbByG1U/hUmqaVsm4tbNyS7CicOSRyuGQYZhTu0h84qkZZQ/I+dzizSVw==", - "dev": true, + "devOptional": true, "dependencies": { "abab": "^2.0.5", "acorn": "^8.2.4", @@ -18509,7 +18901,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.0.0.tgz", "integrity": "sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==", - "dev": true, + "devOptional": true, "dependencies": { "esprima": "^4.0.1", "estraverse": "^5.2.0", @@ -18531,7 +18923,7 @@ "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", - "dev": true, + "devOptional": true, "dependencies": { "prelude-ls": "~1.1.2", "type-check": "~0.3.2" @@ -18544,7 +18936,7 @@ "version": "0.8.3", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", - "dev": true, + "devOptional": true, "dependencies": { "deep-is": "~0.1.3", "fast-levenshtein": "~2.0.6", @@ -18561,7 +18953,7 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", - "dev": true, + "devOptional": true, "engines": { "node": ">= 0.8.0" } @@ -18570,8 +18962,8 @@ "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, "optional": true, + "peer": true, "engines": { "node": ">=0.10.0" } @@ -18580,7 +18972,7 @@ "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", - "dev": true, + "devOptional": true, "dependencies": { "prelude-ls": "~1.1.2" }, @@ -18633,6 +19025,11 @@ "node": ">=6" } }, + "node_modules/jsonc-parser": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", + "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==" + }, "node_modules/jsonfile": { "version": "4.0.0", "license": "MIT", @@ -18815,6 +19212,17 @@ "resolved": "fixtures/local-mode-tests", "link": true }, + "node_modules/local-pkg": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.4.2.tgz", + "integrity": "sha512-mlERgSPrbxU3BP4qBqAvvwlgW4MTg78iwJdGGnv7kibKjWcJksrG3t6LB5lXI93wXRDvG4NpUgJFmTG4T6rdrg==", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, "node_modules/locate-path": { "version": "5.0.0", "license": "MIT", @@ -18827,7 +19235,7 @@ }, "node_modules/lodash": { "version": "4.17.21", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/lodash._basefor": { @@ -19005,6 +19413,14 @@ "loose-envify": "cli.js" } }, + "node_modules/loupe": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.6.tgz", + "integrity": "sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==", + "dependencies": { + "get-func-name": "^2.0.0" + } + }, "node_modules/lowercase-keys": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", @@ -20050,7 +20466,7 @@ }, "node_modules/mime-db": { "version": "1.52.0", - "dev": true, + "devOptional": true, "license": "MIT", "engines": { "node": ">= 0.6" @@ -20058,7 +20474,7 @@ }, "node_modules/mime-types": { "version": "2.1.35", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "mime-db": "1.52.0" @@ -20311,6 +20727,22 @@ "node": ">=10" } }, + "node_modules/mlly": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.0.0.tgz", + "integrity": "sha512-QL108Hwt+u9bXdWgOI0dhzZfACovn5Aen4Xvc8Jasd9ouRH4NjnrXEiyP3nVvJo91zPlYjVRckta0Nt2zfoR6g==", + "dependencies": { + "acorn": "^8.8.1", + "pathe": "^1.0.0", + "pkg-types": "^1.0.0", + "ufo": "^1.0.0" + } + }, + "node_modules/mlly/node_modules/pathe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.0.0.tgz", + "integrity": "sha512-nPdMG0Pd09HuSsr7QOKUXO2Jr9eqaDiZvDwdyIhNG5SHYujkQHYKDfGQkulBxvbDHz8oHLsTgKN86LSwYzSHAg==" + }, "node_modules/mock-socket": { "version": "9.1.2", "dev": true, @@ -20520,8 +20952,9 @@ "optional": true }, "node_modules/nanoid": { - "version": "3.3.3", - "license": "MIT", + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz", + "integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==", "bin": { "nanoid": "bin/nanoid.cjs" }, @@ -20906,7 +21339,7 @@ "version": "2.2.2", "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.2.tgz", "integrity": "sha512-90yv+6538zuvUMnN+zCr8LuV6bPFdq50304114vJYJ8RDyK8D5O9Phpbd6SZWgI7PwzmmfN1upeOJlvybDSgCw==", - "dev": true + "devOptional": true }, "node_modules/object-assign": { "version": "4.1.1", @@ -21594,7 +22027,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", - "dev": true + "devOptional": true }, "node_modules/parseurl": { "version": "1.3.3", @@ -21668,6 +22101,19 @@ "node": ">=8" } }, + "node_modules/pathe": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-0.2.0.tgz", + "integrity": "sha512-sTitTPYnn23esFR3RlqYBWn4c45WGeLcsKzQiUpXJAyfcWkolvlYpV8FLo7JishK946oQwMFUCHXQ9AjGPKExw==" + }, + "node_modules/pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "engines": { + "node": "*" + } + }, "node_modules/pbkdf2": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", @@ -21754,6 +22200,21 @@ "node": ">=8" } }, + "node_modules/pkg-types": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.1.tgz", + "integrity": "sha512-jHv9HB+Ho7dj6ItwppRDDl0iZRYBD0jsakHXtFgoLr+cHSF6xC+QL54sJmWxyGxOLYSHm0afhXhXcQDQqH9z8g==", + "dependencies": { + "jsonc-parser": "^3.2.0", + "mlly": "^1.0.0", + "pathe": "^1.0.0" + } + }, + "node_modules/pkg-types/node_modules/pathe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.0.0.tgz", + "integrity": "sha512-nPdMG0Pd09HuSsr7QOKUXO2Jr9eqaDiZvDwdyIhNG5SHYujkQHYKDfGQkulBxvbDHz8oHLsTgKN86LSwYzSHAg==" + }, "node_modules/posix-character-classes": { "version": "0.1.1", "license": "MIT", @@ -21761,6 +22222,29 @@ "node": ">=0.10.0" } }, + "node_modules/postcss": { + "version": "8.4.20", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.20.tgz", + "integrity": "sha512-6Q04AXR1212bXr5fh03u8aAwbLxAQNGQ/Q1LNa0VfOI06ZAlhPHtQvE4OIdpj4kLThXilalPnmDSOD65DcHt+g==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + } + ], + "dependencies": { + "nanoid": "^3.3.4", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, "node_modules/prebuild-install": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.1.tgz", @@ -22071,7 +22555,7 @@ "version": "1.9.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==", - "dev": true + "devOptional": true }, "node_modules/public-encrypt": { "version": "4.0.3", @@ -22165,7 +22649,7 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", - "dev": true + "devOptional": true }, "node_modules/queue-microtask": { "version": "1.2.3", @@ -22833,13 +23317,14 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", - "dev": true + "devOptional": true }, "node_modules/resolve": { - "version": "1.22.0", - "license": "MIT", + "version": "1.22.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", + "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", "dependencies": { - "is-core-module": "^2.8.1", + "is-core-module": "^2.9.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, @@ -22989,6 +23474,21 @@ "node": ">=12.0" } }, + "node_modules/rollup": { + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.9.1.tgz", + "integrity": "sha512-GswCYHXftN8ZKGVgQhTFUJB/NBXxrRGgO2NCy6E8s1rwEJ4Q9/VttNqcYfEvx4dTo4j58YqdC3OVztPzlKSX8w==", + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=14.18.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, "node_modules/rollup-plugin-inject": { "version": "3.0.2", "license": "MIT", @@ -23373,7 +23873,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz", "integrity": "sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw==", - "dev": true, + "devOptional": true, "dependencies": { "xmlchars": "^2.2.0" }, @@ -24077,6 +24577,14 @@ "node": ">= 8" } }, + "node_modules/source-map-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/source-map-resolve": { "version": "0.5.3", "license": "MIT", @@ -24604,6 +25112,17 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/strip-literal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-1.0.0.tgz", + "integrity": "sha512-5o4LsH1lzBzO9UFH63AJ2ad2/S2AVx6NtjOcaz+VTT2h1RiRvbipW72z8M/lxEhcPHDBQwpDrnTF7sXy/7OwCQ==", + "dependencies": { + "acorn": "^8.8.1" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, "node_modules/stripe": { "version": "9.16.0", "resolved": "https://registry.npmjs.org/stripe/-/stripe-9.16.0.tgz", @@ -24677,7 +25196,7 @@ "version": "3.2.4", "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", - "dev": true + "devOptional": true }, "node_modules/synckit": { "version": "0.8.4", @@ -24836,20 +25355,22 @@ } }, "node_modules/terser": { - "version": "4.8.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-4.8.1.tgz", - "integrity": "sha512-4GnLC0x667eJG0ewJTa6z/yXrbLGv80D9Ru6HIpCQmO+Q4PfEtBFi0ObSckqwL6VyQv/7ENJieXHo2ANmdQwgw==", - "dev": true, + "version": "5.16.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.16.1.tgz", + "integrity": "sha512-xvQfyfA1ayT0qdK47zskQgRZeWLoOQ8JQ6mIgRGVNwZKdQMU+5FkCBjmv4QjcrTzyZquRw2FVtlJSRUmMKQslw==", + "optional": true, + "peer": true, "dependencies": { + "@jridgewell/source-map": "^0.3.2", + "acorn": "^8.5.0", "commander": "^2.20.0", - "source-map": "~0.6.1", - "source-map-support": "~0.5.12" + "source-map-support": "~0.5.20" }, "bin": { "terser": "bin/terser" }, "engines": { - "node": ">=6.0.0" + "node": ">=10" } }, "node_modules/terser-webpack-plugin": { @@ -24964,6 +25485,23 @@ "figgy-pudding": "^3.5.1" } }, + "node_modules/terser-webpack-plugin/node_modules/terser": { + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-4.8.1.tgz", + "integrity": "sha512-4GnLC0x667eJG0ewJTa6z/yXrbLGv80D9Ru6HIpCQmO+Q4PfEtBFi0ObSckqwL6VyQv/7ENJieXHo2ANmdQwgw==", + "dev": true, + "dependencies": { + "commander": "^2.20.0", + "source-map": "~0.6.1", + "source-map-support": "~0.5.12" + }, + "bin": { + "terser": "bin/terser" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/terser-webpack-plugin/node_modules/y18n": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", @@ -24976,15 +25514,6 @@ "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", "dev": true }, - "node_modules/terser/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/test-exclude": { "version": "6.0.0", "license": "ISC", @@ -25055,6 +25584,27 @@ "globrex": "^0.1.2" } }, + "node_modules/tinybench": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.3.1.tgz", + "integrity": "sha512-hGYWYBMPr7p4g5IarQE7XhlyWveh1EKhy4wUBS1LrHXCKYgvz+4/jCqgmJqZxxldesn05vccrtME2RLLZNW7iA==" + }, + "node_modules/tinypool": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.3.0.tgz", + "integrity": "sha512-NX5KeqHOBZU6Bc0xj9Vr5Szbb1j8tUHIeD18s41aDJaPeC5QTdEhK0SpdpUrZlj2nv5cctNcSjaKNanXlfcVEQ==", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tinyspy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-1.0.2.tgz", + "integrity": "sha512-bSGlgwLBYf7PnUsQ6WOc6SJ3pGOcd+d8AA6EUnLDDM0kWEstC1JIlSZA3UNliDXhd9ABoS7hiRBDCu+XP/sf1Q==", + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/tmp": { "version": "0.0.33", "license": "MIT", @@ -25175,7 +25725,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.2.tgz", "integrity": "sha512-G9fqXWoYFZgTc2z8Q5zaHy/vJMjm+WV0AkAeHxVCQiEB1b+dGvWzFW6QV07cY5jQ5gRkeid2qIkzkxUnmoQZUQ==", - "dev": true, + "devOptional": true, "dependencies": { "psl": "^1.1.33", "punycode": "^2.1.1", @@ -25190,7 +25740,7 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", - "dev": true, + "devOptional": true, "engines": { "node": ">= 4.0.0" } @@ -25199,7 +25749,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/tr46/-/tr46-2.1.0.tgz", "integrity": "sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw==", - "dev": true, + "devOptional": true, "dependencies": { "punycode": "^2.1.1" }, @@ -25473,6 +26023,11 @@ "node": ">=4.2.0" } }, + "node_modules/ufo": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.0.1.tgz", + "integrity": "sha512-boAm74ubXHY7KJQZLlXrtMz52qFvpsbOxDcZOnw/Wf+LS4Mmyu7JxmzD4tDLtUQtmZECypJ0FrCz4QIe6dvKRA==" + }, "node_modules/unbox-primitive": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", @@ -25855,7 +26410,7 @@ "version": "1.5.10", "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", - "dev": true, + "devOptional": true, "dependencies": { "querystringify": "^2.1.1", "requires-port": "^1.0.0" @@ -26021,6 +26576,213 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/vite": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.0.4.tgz", + "integrity": "sha512-xevPU7M8FU0i/80DMR+YhgrzR5KS2ORy1B4xcX/cXLsvnUWvfHuqMmVU6N0YiJ4JWGRJJsLCgjEzKjG9/GKoSw==", + "dependencies": { + "esbuild": "^0.16.3", + "postcss": "^8.4.20", + "resolve": "^1.22.1", + "rollup": "^3.7.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + }, + "peerDependencies": { + "@types/node": ">= 14", + "less": "*", + "sass": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "sass": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, + "node_modules/vite-node": { + "version": "0.26.3", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-0.26.3.tgz", + "integrity": "sha512-Te2bq0Bfvq6XiO718I+1EinMjpNYKws6SNHKOmVbILAQimKoZKDd+IZLlkaYcBXPpK3HFe2U80k8Zw+m3w/a2w==", + "dependencies": { + "debug": "^4.3.4", + "mlly": "^1.0.0", + "pathe": "^0.2.0", + "source-map": "^0.6.1", + "source-map-support": "^0.5.21", + "vite": "^3.0.0 || ^4.0.0" + }, + "bin": { + "vite-node": "vite-node.mjs" + }, + "engines": { + "node": ">=v14.16.0" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/vite-node/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==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/vite/node_modules/@esbuild/android-arm": { + "version": "0.16.13", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.16.13.tgz", + "integrity": "sha512-JmtqThupn9Yf+FzANE+GG73ASUkssnPwOsndUElhp23685QzRK+MO1UompOlBaXV9D5FTuYcPnw7p4mCq2YbZQ==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-loong64": { + "version": "0.16.13", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.16.13.tgz", + "integrity": "sha512-x8KplRu9Y43Px8I9YS+sPBwQ+fw44Mvp2BPVADopKDWz+h3fcj1BvRU58kxb89WObmwKX9sWdtYzepL4Fmx03A==", + "cpu": [ + "loong64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/esbuild": { + "version": "0.16.13", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.16.13.tgz", + "integrity": "sha512-oYwFdSEIoKM1oYzyem1osgKJAvg5447XF+05ava21fOtilyb2HeQQh26/74K4WeAk5dZmj/Mx10zUqUnI14jhA==", + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/android-arm": "0.16.13", + "@esbuild/android-arm64": "0.16.13", + "@esbuild/android-x64": "0.16.13", + "@esbuild/darwin-arm64": "0.16.13", + "@esbuild/darwin-x64": "0.16.13", + "@esbuild/freebsd-arm64": "0.16.13", + "@esbuild/freebsd-x64": "0.16.13", + "@esbuild/linux-arm": "0.16.13", + "@esbuild/linux-arm64": "0.16.13", + "@esbuild/linux-ia32": "0.16.13", + "@esbuild/linux-loong64": "0.16.13", + "@esbuild/linux-mips64el": "0.16.13", + "@esbuild/linux-ppc64": "0.16.13", + "@esbuild/linux-riscv64": "0.16.13", + "@esbuild/linux-s390x": "0.16.13", + "@esbuild/linux-x64": "0.16.13", + "@esbuild/netbsd-x64": "0.16.13", + "@esbuild/openbsd-x64": "0.16.13", + "@esbuild/sunos-x64": "0.16.13", + "@esbuild/win32-arm64": "0.16.13", + "@esbuild/win32-ia32": "0.16.13", + "@esbuild/win32-x64": "0.16.13" + } + }, + "node_modules/vitest": { + "version": "0.26.3", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.26.3.tgz", + "integrity": "sha512-FmHxU9aUCxTi23keF3vxb/Qp0lYXaaJ+jRLGOUmMS3qVTOJvgGE+f1VArupA6pEhaG2Ans4X+zV9dqM5WISMbg==", + "dependencies": { + "@types/chai": "^4.3.4", + "@types/chai-subset": "^1.3.3", + "@types/node": "*", + "acorn": "^8.8.1", + "acorn-walk": "^8.2.0", + "chai": "^4.3.7", + "debug": "^4.3.4", + "local-pkg": "^0.4.2", + "source-map": "^0.6.1", + "strip-literal": "^1.0.0", + "tinybench": "^2.3.1", + "tinypool": "^0.3.0", + "tinyspy": "^1.0.2", + "vite": "^3.0.0 || ^4.0.0", + "vite-node": "0.26.3" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": ">=v14.16.0" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@vitest/browser": "*", + "@vitest/ui": "*", + "happy-dom": "*", + "jsdom": "*" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@vitest/browser": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + } + } + }, + "node_modules/vitest/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==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/vm-browserify": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", @@ -26048,7 +26810,7 @@ "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", "integrity": "sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==", "deprecated": "Use your platform's native performance.now() and performance.timeOrigin.", - "dev": true, + "devOptional": true, "dependencies": { "browser-process-hrtime": "^1.0.0" } @@ -26057,7 +26819,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz", "integrity": "sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA==", - "dev": true, + "devOptional": true, "dependencies": { "xml-name-validator": "^3.0.0" }, @@ -26411,7 +27173,7 @@ "version": "6.1.0", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz", "integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==", - "dev": true, + "devOptional": true, "engines": { "node": ">=10.4" } @@ -26696,7 +27458,7 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", "integrity": "sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==", - "dev": true, + "devOptional": true, "dependencies": { "iconv-lite": "0.4.24" } @@ -26705,13 +27467,13 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz", "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==", - "dev": true + "devOptional": true }, "node_modules/whatwg-url": { "version": "8.7.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.7.0.tgz", "integrity": "sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg==", - "dev": true, + "devOptional": true, "dependencies": { "lodash": "^4.7.0", "tr46": "^2.1.0", @@ -26920,7 +27682,7 @@ }, "node_modules/ws": { "version": "7.5.6", - "dev": true, + "devOptional": true, "license": "MIT", "engines": { "node": ">=8.3.0" @@ -27010,13 +27772,13 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", - "dev": true + "devOptional": true }, "node_modules/xmlchars": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", - "dev": true + "devOptional": true }, "node_modules/xregexp": { "version": "2.0.0", @@ -30303,6 +31065,60 @@ "dev": true, "optional": true }, + "@esbuild/android-arm64": { + "version": "0.16.13", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.16.13.tgz", + "integrity": "sha512-r4xetsd1ez1NF9/9R2f9Q6AlxqiZLwUqo7ICOcvEVwopVkXUcspIjEbJk0EVTgT6Cp5+ymzGPT6YNV0ievx4yA==", + "optional": true + }, + "@esbuild/android-x64": { + "version": "0.16.13", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.16.13.tgz", + "integrity": "sha512-hKt1bFht/Vtp0xJ0ZVzFMnPy1y1ycmM3KNnp3zsyZfQmw7nhs2WLO4vxdR5YG+6RsHKCb2zbZ3VwlC0Tij0qyA==", + "optional": true + }, + "@esbuild/darwin-arm64": { + "version": "0.16.13", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.16.13.tgz", + "integrity": "sha512-ogrVuNi2URocrr3Ps20f075EMm9V7IeenOi9FRj4qdbT6mQlwLuP4l90PW2iBrKERx0oRkcZprEUNsz/3xd7ww==", + "optional": true + }, + "@esbuild/darwin-x64": { + "version": "0.16.13", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.16.13.tgz", + "integrity": "sha512-Agajik9SBGiKD7FPXE+ExW6x3MgA/dUdpZnXa9y1tyfE4lKQx+eQiknSdrBnWPeqa9wL0AOvkhghmYhpVkyqkA==", + "optional": true + }, + "@esbuild/freebsd-arm64": { + "version": "0.16.13", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.16.13.tgz", + "integrity": "sha512-KxMO3/XihBcHM+xQUM6nQZO1SgQuOsd1DCnKF1a4SIf/i5VD45vrqN3k8ePgFrEbMi7m5JeGmvNqwJXinF0a4Q==", + "optional": true + }, + "@esbuild/freebsd-x64": { + "version": "0.16.13", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.16.13.tgz", + "integrity": "sha512-Ez15oqV1vwvZ30cVLeBW14BsWq/fdWNQGMOxxqaSJVQVLqHhvgfQ7gxGDiN9tpJdeQhqJO+Q0r02/Tce5+USNg==", + "optional": true + }, + "@esbuild/linux-arm": { + "version": "0.16.13", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.16.13.tgz", + "integrity": "sha512-18dLd2L3mda+iFj6sswyBMSh2UwniamD9M4DwPv8VM+9apRFlQ5IGKxBdumnTuOI4NvwwAernmUseWhYQ9k+rg==", + "optional": true + }, + "@esbuild/linux-arm64": { + "version": "0.16.13", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.16.13.tgz", + "integrity": "sha512-qi5n7KwcGViyJeZeQnu8fB6dC3Mlm5PGaqSv2HhQDDx/MPvVfQGNMcv7zcBL4qk3FkuWhGVwXkjQ76x7R0PWlA==", + "optional": true + }, + "@esbuild/linux-ia32": { + "version": "0.16.13", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.16.13.tgz", + "integrity": "sha512-2489Xad9sr+6GD7nB913fUqpCsSwVwgskkQTq4Or2mZntSPYPebyJm8l1YruHo7oqYMTGV6RiwGE4gRo3H+EPQ==", + "optional": true + }, "@esbuild/linux-loong64": { "version": "0.15.12", "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.15.12.tgz", @@ -30310,6 +31126,72 @@ "dev": true, "optional": true }, + "@esbuild/linux-mips64el": { + "version": "0.16.13", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.16.13.tgz", + "integrity": "sha512-qhhdWph9FLwD9rVVC/nUf7k2U4NZIA6/mGx0B7+O6PFV0GjmPA2E3zDQ4NUjq9P26E0DeAZy9akH9dYcUBRU7A==", + "optional": true + }, + "@esbuild/linux-ppc64": { + "version": "0.16.13", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.16.13.tgz", + "integrity": "sha512-cVWAPKsrRVxI1jCeJHnYSbE3BrEU+pZTZK2gfao9HRxuc+3m4+RLfs3EVEpGLmMKEcWfVCB9wZ3yNxnknutGKQ==", + "optional": true + }, + "@esbuild/linux-riscv64": { + "version": "0.16.13", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.16.13.tgz", + "integrity": "sha512-Agb7dbRyZWnmPn5Vvf0eyqaEUqSsaIUwwyInu2EoFTaIDRp093QU2M5alUyOooMLkRbD1WvqQNwx08Z/g+SAcQ==", + "optional": true + }, + "@esbuild/linux-s390x": { + "version": "0.16.13", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.16.13.tgz", + "integrity": "sha512-AqRBIrc/+kl08ahliNG+EyU+j41wIzQfwBTKpi80cCDiYvYFPuXjvzZsD9muiu58Isj0RVni9VgC4xK/AnSW4g==", + "optional": true + }, + "@esbuild/linux-x64": { + "version": "0.16.13", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.16.13.tgz", + "integrity": "sha512-S4wn2BimuhPcoArRtVrdHUKIymCCZcYAXQE47kUiX4yrUrEX2/ifn5eKNbZ5c1jJKUlh1gC2ESIN+iw3wQax3g==", + "optional": true + }, + "@esbuild/netbsd-x64": { + "version": "0.16.13", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.16.13.tgz", + "integrity": "sha512-2c8JWgfUMlQHTdaR5X3xNMwqOyad8kgeCupuVkdm3QkUOzGREjlTETQsK6oHifocYzDCo9FeKcUwsK356SdR+g==", + "optional": true + }, + "@esbuild/openbsd-x64": { + "version": "0.16.13", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.16.13.tgz", + "integrity": "sha512-Bwh+PmKD/LK+xBjqIpnYnKYj0fIyQJ0YpRxsn0F+WfzvQ2OA+GKDlf8AHosiCns26Q4Dje388jQVwfOBZ1GaFw==", + "optional": true + }, + "@esbuild/sunos-x64": { + "version": "0.16.13", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.16.13.tgz", + "integrity": "sha512-8wwk6f9XGnhrF94/DBdFM4Xm1JeCyGTCj67r516VS9yvBVQf3Rar54L+XPVDs/oZOokwH+XsktrgkuTMAmjntg==", + "optional": true + }, + "@esbuild/win32-arm64": { + "version": "0.16.13", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.16.13.tgz", + "integrity": "sha512-Jmwbp/5ArLCiRAHC33ODfcrlIcbP/exXkOEUVkADNJC4e/so2jm+i8IQFvVX/lA2GWvK3GdgcN0VFfp9YITAbg==", + "optional": true + }, + "@esbuild/win32-ia32": { + "version": "0.16.13", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.16.13.tgz", + "integrity": "sha512-AX6WjntGjhJHzrPSVvjMD7grxt41koHfAOx6lxLorrpDwwIKKPaGDASPZgvFIZHTbwhOtILW6vAXxYPDsKpDJA==", + "optional": true + }, + "@esbuild/win32-x64": { + "version": "0.16.13", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.16.13.tgz", + "integrity": "sha512-A+U4gM6OOkPS03UgVU08GTpAAAxPsP/8Z4FmneGo4TaVSD99bK9gVJXlqUEPMO/htFXEAht2O6pX4ErtLY5tVg==", + "optional": true + }, "@eslint/eslintrc": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.3.tgz", @@ -31207,6 +32089,31 @@ "@jridgewell/set-array": { "version": "1.1.0" }, + "@jridgewell/source-map": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.2.tgz", + "integrity": "sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==", + "optional": true, + "peer": true, + "requires": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "dependencies": { + "@jridgewell/gen-mapping": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", + "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", + "optional": true, + "peer": true, + "requires": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + } + } + } + }, "@jridgewell/sourcemap-codec": { "version": "1.4.14", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", @@ -32338,7 +33245,7 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", - "dev": true + "devOptional": true }, "@types/acorn": { "version": "4.0.6", @@ -32423,6 +33330,19 @@ "@types/responselike": "^1.0.0" } }, + "@types/chai": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.4.tgz", + "integrity": "sha512-KnRanxnpfpjUTqTCXslZSEdLfXExwgNxYPdiO2WGUj8+HDjFi8R3k5RVKPeSCzLjCcshCAtVO2QBbVuAV4kTnw==" + }, + "@types/chai-subset": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@types/chai-subset/-/chai-subset-1.3.3.tgz", + "integrity": "sha512-frBecisrNGz+F4T6bcc+NLeolfiojh5FxW2klu669+8BARtyQv2C/GkNW6FUodVe4BroGMP/wER/YDGc7rEllw==", + "requires": { + "@types/chai": "*" + } + }, "@types/command-exists": { "version": "1.2.0", "dev": true @@ -33225,7 +34145,7 @@ "version": "2.0.6", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==", - "dev": true + "devOptional": true }, "accepts": { "version": "1.3.8", @@ -33236,15 +34156,15 @@ } }, "acorn": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz", - "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==" + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz", + "integrity": "sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==" }, "acorn-globals": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-6.0.0.tgz", "integrity": "sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg==", - "dev": true, + "devOptional": true, "requires": { "acorn": "^7.1.1", "acorn-walk": "^7.1.1" @@ -33254,13 +34174,13 @@ "version": "7.4.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", - "dev": true + "devOptional": true }, "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==", - "dev": true + "devOptional": true } } }, @@ -33271,14 +34191,13 @@ "acorn-walk": { "version": "8.2.0", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", - "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", - "dev": true + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==" }, "agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "dev": true, + "devOptional": true, "requires": { "debug": "4" } @@ -33502,6 +34421,11 @@ } } }, + "assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==" + }, "assign-symbols": { "version": "1.0.0" }, @@ -33549,7 +34473,7 @@ "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "dev": true + "devOptional": true }, "atob": { "version": "2.1.2" @@ -33894,7 +34818,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz", "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==", - "dev": true + "devOptional": true }, "browserify-aes": { "version": "1.2.0", @@ -34180,6 +35104,20 @@ "rsvp": "^4.8.4" } }, + "chai": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.7.tgz", + "integrity": "sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A==", + "requires": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.2", + "deep-eql": "^4.1.2", + "get-func-name": "^2.0.0", + "loupe": "^2.3.1", + "pathval": "^1.1.1", + "type-detect": "^4.0.5" + } + }, "chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -34220,6 +35158,11 @@ "chardet": { "version": "0.7.0" }, + "check-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", + "integrity": "sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==" + }, "chokidar": { "version": "3.5.3", "requires": { @@ -34512,7 +35455,7 @@ "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, + "devOptional": true, "requires": { "delayed-stream": "~1.0.0" } @@ -34529,7 +35472,7 @@ }, "commander": { "version": "2.20.3", - "dev": true + "devOptional": true }, "commondir": { "version": "1.0.1", @@ -34815,13 +35758,13 @@ "version": "0.4.4", "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.4.4.tgz", "integrity": "sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw==", - "dev": true + "devOptional": true }, "cssstyle": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz", "integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==", - "dev": true, + "devOptional": true, "requires": { "cssom": "~0.3.6" }, @@ -34830,7 +35773,7 @@ "version": "0.3.8", "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", - "dev": true + "devOptional": true } } }, @@ -34878,7 +35821,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-2.0.0.tgz", "integrity": "sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ==", - "dev": true, + "devOptional": true, "requires": { "abab": "^2.0.3", "whatwg-mimetype": "^2.3.0", @@ -34930,7 +35873,7 @@ "version": "10.4.3", "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==", - "dev": true + "devOptional": true }, "decode-named-character-reference": { "version": "1.0.2", @@ -34960,6 +35903,14 @@ "dedent": { "version": "0.7.0" }, + "deep-eql": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", + "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", + "requires": { + "type-detect": "^4.0.0" + } + }, "deep-equal": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.1.0.tgz", @@ -35053,7 +36004,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "dev": true + "devOptional": true }, "denque": { "version": "1.5.1" @@ -35170,7 +36121,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz", "integrity": "sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg==", - "dev": true, + "devOptional": true, "requires": { "webidl-conversions": "^5.0.0" }, @@ -35179,7 +36130,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz", "integrity": "sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA==", - "dev": true + "devOptional": true } } }, @@ -36985,7 +37936,7 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", - "dev": true, + "devOptional": true, "requires": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", @@ -37131,6 +38082,11 @@ "get-caller-file": { "version": "2.0.5" }, + "get-func-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", + "integrity": "sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==" + }, "get-intrinsic": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.3.tgz", @@ -37534,7 +38490,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz", "integrity": "sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ==", - "dev": true, + "devOptional": true, "requires": { "whatwg-encoding": "^1.0.5" } @@ -37563,7 +38519,7 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", - "dev": true, + "devOptional": true, "requires": { "@tootallnate/once": "1", "agent-base": "6", @@ -37614,7 +38570,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", - "dev": true, + "devOptional": true, "requires": { "agent-base": "6", "debug": "4" @@ -38207,7 +39163,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", - "dev": true + "devOptional": true }, "is-reference": { "version": "3.0.0", @@ -41111,7 +42067,7 @@ "version": "16.7.0", "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.7.0.tgz", "integrity": "sha512-u9Smc2G1USStM+s/x1ru5Sxrl6mPYCbByG1U/hUmqaVsm4tbNyS7CicOSRyuGQYZhTu0h84qkZZQ/I+dzizSVw==", - "dev": true, + "devOptional": true, "requires": { "abab": "^2.0.5", "acorn": "^8.2.4", @@ -41146,7 +42102,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.0.0.tgz", "integrity": "sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==", - "dev": true, + "devOptional": true, "requires": { "esprima": "^4.0.1", "estraverse": "^5.2.0", @@ -41159,7 +42115,7 @@ "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", - "dev": true, + "devOptional": true, "requires": { "prelude-ls": "~1.1.2", "type-check": "~0.3.2" @@ -41169,7 +42125,7 @@ "version": "0.8.3", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", - "dev": true, + "devOptional": true, "requires": { "deep-is": "~0.1.3", "fast-levenshtein": "~2.0.6", @@ -41183,20 +42139,20 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", - "dev": true + "devOptional": true }, "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, - "optional": true + "optional": true, + "peer": true }, "type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", - "dev": true, + "devOptional": true, "requires": { "prelude-ls": "~1.1.2" } @@ -41232,6 +42188,11 @@ "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==" }, + "jsonc-parser": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", + "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==" + }, "jsonfile": { "version": "4.0.0", "requires": { @@ -41385,6 +42346,11 @@ } } }, + "local-pkg": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.4.2.tgz", + "integrity": "sha512-mlERgSPrbxU3BP4qBqAvvwlgW4MTg78iwJdGGnv7kibKjWcJksrG3t6LB5lXI93wXRDvG4NpUgJFmTG4T6rdrg==" + }, "locate-path": { "version": "5.0.0", "requires": { @@ -41393,7 +42359,7 @@ }, "lodash": { "version": "4.17.21", - "dev": true + "devOptional": true }, "lodash._basefor": { "version": "3.0.3", @@ -41530,6 +42496,14 @@ "js-tokens": "^3.0.0 || ^4.0.0" } }, + "loupe": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.6.tgz", + "integrity": "sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==", + "requires": { + "get-func-name": "^2.0.0" + } + }, "lowercase-keys": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", @@ -42197,11 +43171,11 @@ }, "mime-db": { "version": "1.52.0", - "dev": true + "devOptional": true }, "mime-types": { "version": "2.1.35", - "dev": true, + "devOptional": true, "requires": { "mime-db": "1.52.0" } @@ -42368,6 +43342,24 @@ "mkdirp": "^1.0.3" } }, + "mlly": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.0.0.tgz", + "integrity": "sha512-QL108Hwt+u9bXdWgOI0dhzZfACovn5Aen4Xvc8Jasd9ouRH4NjnrXEiyP3nVvJo91zPlYjVRckta0Nt2zfoR6g==", + "requires": { + "acorn": "^8.8.1", + "pathe": "^1.0.0", + "pkg-types": "^1.0.0", + "ufo": "^1.0.0" + }, + "dependencies": { + "pathe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.0.0.tgz", + "integrity": "sha512-nPdMG0Pd09HuSsr7QOKUXO2Jr9eqaDiZvDwdyIhNG5SHYujkQHYKDfGQkulBxvbDHz8oHLsTgKN86LSwYzSHAg==" + } + } + }, "mock-socket": { "version": "9.1.2", "dev": true @@ -42518,7 +43510,9 @@ "optional": true }, "nanoid": { - "version": "3.3.3" + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz", + "integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==" }, "nanomatch": { "version": "1.2.13", @@ -42817,7 +43811,7 @@ "version": "2.2.2", "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.2.tgz", "integrity": "sha512-90yv+6538zuvUMnN+zCr8LuV6bPFdq50304114vJYJ8RDyK8D5O9Phpbd6SZWgI7PwzmmfN1upeOJlvybDSgCw==", - "dev": true + "devOptional": true }, "object-assign": { "version": "4.1.1" @@ -43317,7 +44311,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", - "dev": true + "devOptional": true }, "parseurl": { "version": "1.3.3", @@ -43361,6 +44355,16 @@ "path-type": { "version": "4.0.0" }, + "pathe": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-0.2.0.tgz", + "integrity": "sha512-sTitTPYnn23esFR3RlqYBWn4c45WGeLcsKzQiUpXJAyfcWkolvlYpV8FLo7JishK946oQwMFUCHXQ9AjGPKExw==" + }, + "pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==" + }, "pbkdf2": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", @@ -43418,9 +44422,36 @@ "find-up": "^4.0.0" } }, + "pkg-types": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.1.tgz", + "integrity": "sha512-jHv9HB+Ho7dj6ItwppRDDl0iZRYBD0jsakHXtFgoLr+cHSF6xC+QL54sJmWxyGxOLYSHm0afhXhXcQDQqH9z8g==", + "requires": { + "jsonc-parser": "^3.2.0", + "mlly": "^1.0.0", + "pathe": "^1.0.0" + }, + "dependencies": { + "pathe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.0.0.tgz", + "integrity": "sha512-nPdMG0Pd09HuSsr7QOKUXO2Jr9eqaDiZvDwdyIhNG5SHYujkQHYKDfGQkulBxvbDHz8oHLsTgKN86LSwYzSHAg==" + } + } + }, "posix-character-classes": { "version": "0.1.1" }, + "postcss": { + "version": "8.4.20", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.20.tgz", + "integrity": "sha512-6Q04AXR1212bXr5fh03u8aAwbLxAQNGQ/Q1LNa0VfOI06ZAlhPHtQvE4OIdpj4kLThXilalPnmDSOD65DcHt+g==", + "requires": { + "nanoid": "^3.3.4", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + } + }, "prebuild-install": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.1.tgz", @@ -43635,7 +44666,7 @@ "version": "1.9.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==", - "dev": true + "devOptional": true }, "public-encrypt": { "version": "4.0.3", @@ -43714,7 +44745,7 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", - "dev": true + "devOptional": true }, "queue-microtask": { "version": "1.2.3" @@ -44243,12 +45274,14 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", - "dev": true + "devOptional": true }, "resolve": { - "version": "1.22.0", + "version": "1.22.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", + "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", "requires": { - "is-core-module": "^2.8.1", + "is-core-module": "^2.9.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" } @@ -44342,6 +45375,14 @@ "semver-compare": "^1.0.0" } }, + "rollup": { + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.9.1.tgz", + "integrity": "sha512-GswCYHXftN8ZKGVgQhTFUJB/NBXxrRGgO2NCy6E8s1rwEJ4Q9/VttNqcYfEvx4dTo4j58YqdC3OVztPzlKSX8w==", + "requires": { + "fsevents": "~2.3.2" + } + }, "rollup-plugin-inject": { "version": "3.0.2", "requires": { @@ -44616,7 +45657,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz", "integrity": "sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw==", - "dev": true, + "devOptional": true, "requires": { "xmlchars": "^2.2.0" } @@ -45116,6 +46157,11 @@ "source-map": { "version": "0.7.4" }, + "source-map-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==" + }, "source-map-resolve": { "version": "0.5.3", "requires": { @@ -45493,6 +46539,14 @@ "strip-json-comments": { "version": "3.1.1" }, + "strip-literal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-1.0.0.tgz", + "integrity": "sha512-5o4LsH1lzBzO9UFH63AJ2ad2/S2AVx6NtjOcaz+VTT2h1RiRvbipW72z8M/lxEhcPHDBQwpDrnTF7sXy/7OwCQ==", + "requires": { + "acorn": "^8.8.1" + } + }, "stripe": { "version": "9.16.0", "resolved": "https://registry.npmjs.org/stripe/-/stripe-9.16.0.tgz", @@ -45542,7 +46596,7 @@ "version": "3.2.4", "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", - "dev": true + "devOptional": true }, "synckit": { "version": "0.8.4", @@ -45670,22 +46724,16 @@ } }, "terser": { - "version": "4.8.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-4.8.1.tgz", - "integrity": "sha512-4GnLC0x667eJG0ewJTa6z/yXrbLGv80D9Ru6HIpCQmO+Q4PfEtBFi0ObSckqwL6VyQv/7ENJieXHo2ANmdQwgw==", - "dev": true, + "version": "5.16.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.16.1.tgz", + "integrity": "sha512-xvQfyfA1ayT0qdK47zskQgRZeWLoOQ8JQ6mIgRGVNwZKdQMU+5FkCBjmv4QjcrTzyZquRw2FVtlJSRUmMKQslw==", + "optional": true, + "peer": true, "requires": { + "@jridgewell/source-map": "^0.3.2", + "acorn": "^8.5.0", "commander": "^2.20.0", - "source-map": "~0.6.1", - "source-map-support": "~0.5.12" - }, - "dependencies": { - "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 - } + "source-map-support": "~0.5.20" } }, "terser-webpack-plugin": { @@ -45782,6 +46830,17 @@ "figgy-pudding": "^3.5.1" } }, + "terser": { + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-4.8.1.tgz", + "integrity": "sha512-4GnLC0x667eJG0ewJTa6z/yXrbLGv80D9Ru6HIpCQmO+Q4PfEtBFi0ObSckqwL6VyQv/7ENJieXHo2ANmdQwgw==", + "dev": true, + "requires": { + "commander": "^2.20.0", + "source-map": "~0.6.1", + "source-map-support": "~0.5.12" + } + }, "y18n": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", @@ -45856,6 +46915,21 @@ "globrex": "^0.1.2" } }, + "tinybench": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.3.1.tgz", + "integrity": "sha512-hGYWYBMPr7p4g5IarQE7XhlyWveh1EKhy4wUBS1LrHXCKYgvz+4/jCqgmJqZxxldesn05vccrtME2RLLZNW7iA==" + }, + "tinypool": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.3.0.tgz", + "integrity": "sha512-NX5KeqHOBZU6Bc0xj9Vr5Szbb1j8tUHIeD18s41aDJaPeC5QTdEhK0SpdpUrZlj2nv5cctNcSjaKNanXlfcVEQ==" + }, + "tinyspy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-1.0.2.tgz", + "integrity": "sha512-bSGlgwLBYf7PnUsQ6WOc6SJ3pGOcd+d8AA6EUnLDDM0kWEstC1JIlSZA3UNliDXhd9ABoS7hiRBDCu+XP/sf1Q==" + }, "tmp": { "version": "0.0.33", "requires": { @@ -45942,7 +47016,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.2.tgz", "integrity": "sha512-G9fqXWoYFZgTc2z8Q5zaHy/vJMjm+WV0AkAeHxVCQiEB1b+dGvWzFW6QV07cY5jQ5gRkeid2qIkzkxUnmoQZUQ==", - "dev": true, + "devOptional": true, "requires": { "psl": "^1.1.33", "punycode": "^2.1.1", @@ -45954,7 +47028,7 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", - "dev": true + "devOptional": true } } }, @@ -45962,7 +47036,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/tr46/-/tr46-2.1.0.tgz", "integrity": "sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw==", - "dev": true, + "devOptional": true, "requires": { "punycode": "^2.1.1" } @@ -46137,6 +47211,11 @@ "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz", "integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==" }, + "ufo": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.0.1.tgz", + "integrity": "sha512-boAm74ubXHY7KJQZLlXrtMz52qFvpsbOxDcZOnw/Wf+LS4Mmyu7JxmzD4tDLtUQtmZECypJ0FrCz4QIe6dvKRA==" + }, "unbox-primitive": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", @@ -46415,7 +47494,7 @@ "version": "1.5.10", "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", - "dev": true, + "devOptional": true, "requires": { "querystringify": "^2.1.1", "requires-port": "^1.0.0" @@ -46532,6 +47611,110 @@ "unist-util-stringify-position": "^3.0.0" } }, + "vite": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.0.4.tgz", + "integrity": "sha512-xevPU7M8FU0i/80DMR+YhgrzR5KS2ORy1B4xcX/cXLsvnUWvfHuqMmVU6N0YiJ4JWGRJJsLCgjEzKjG9/GKoSw==", + "requires": { + "esbuild": "^0.16.3", + "fsevents": "~2.3.2", + "postcss": "^8.4.20", + "resolve": "^1.22.1", + "rollup": "^3.7.0" + }, + "dependencies": { + "@esbuild/android-arm": { + "version": "0.16.13", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.16.13.tgz", + "integrity": "sha512-JmtqThupn9Yf+FzANE+GG73ASUkssnPwOsndUElhp23685QzRK+MO1UompOlBaXV9D5FTuYcPnw7p4mCq2YbZQ==", + "optional": true + }, + "@esbuild/linux-loong64": { + "version": "0.16.13", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.16.13.tgz", + "integrity": "sha512-x8KplRu9Y43Px8I9YS+sPBwQ+fw44Mvp2BPVADopKDWz+h3fcj1BvRU58kxb89WObmwKX9sWdtYzepL4Fmx03A==", + "optional": true + }, + "esbuild": { + "version": "0.16.13", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.16.13.tgz", + "integrity": "sha512-oYwFdSEIoKM1oYzyem1osgKJAvg5447XF+05ava21fOtilyb2HeQQh26/74K4WeAk5dZmj/Mx10zUqUnI14jhA==", + "requires": { + "@esbuild/android-arm": "0.16.13", + "@esbuild/android-arm64": "0.16.13", + "@esbuild/android-x64": "0.16.13", + "@esbuild/darwin-arm64": "0.16.13", + "@esbuild/darwin-x64": "0.16.13", + "@esbuild/freebsd-arm64": "0.16.13", + "@esbuild/freebsd-x64": "0.16.13", + "@esbuild/linux-arm": "0.16.13", + "@esbuild/linux-arm64": "0.16.13", + "@esbuild/linux-ia32": "0.16.13", + "@esbuild/linux-loong64": "0.16.13", + "@esbuild/linux-mips64el": "0.16.13", + "@esbuild/linux-ppc64": "0.16.13", + "@esbuild/linux-riscv64": "0.16.13", + "@esbuild/linux-s390x": "0.16.13", + "@esbuild/linux-x64": "0.16.13", + "@esbuild/netbsd-x64": "0.16.13", + "@esbuild/openbsd-x64": "0.16.13", + "@esbuild/sunos-x64": "0.16.13", + "@esbuild/win32-arm64": "0.16.13", + "@esbuild/win32-ia32": "0.16.13", + "@esbuild/win32-x64": "0.16.13" + } + } + } + }, + "vite-node": { + "version": "0.26.3", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-0.26.3.tgz", + "integrity": "sha512-Te2bq0Bfvq6XiO718I+1EinMjpNYKws6SNHKOmVbILAQimKoZKDd+IZLlkaYcBXPpK3HFe2U80k8Zw+m3w/a2w==", + "requires": { + "debug": "^4.3.4", + "mlly": "^1.0.0", + "pathe": "^0.2.0", + "source-map": "^0.6.1", + "source-map-support": "^0.5.21", + "vite": "^3.0.0 || ^4.0.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + } + } + }, + "vitest": { + "version": "0.26.3", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.26.3.tgz", + "integrity": "sha512-FmHxU9aUCxTi23keF3vxb/Qp0lYXaaJ+jRLGOUmMS3qVTOJvgGE+f1VArupA6pEhaG2Ans4X+zV9dqM5WISMbg==", + "requires": { + "@types/chai": "^4.3.4", + "@types/chai-subset": "^1.3.3", + "@types/node": "*", + "acorn": "^8.8.1", + "acorn-walk": "^8.2.0", + "chai": "^4.3.7", + "debug": "^4.3.4", + "local-pkg": "^0.4.2", + "source-map": "^0.6.1", + "strip-literal": "^1.0.0", + "tinybench": "^2.3.1", + "tinypool": "^0.3.0", + "tinyspy": "^1.0.2", + "vite": "^3.0.0 || ^4.0.0", + "vite-node": "0.26.3" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + } + } + }, "vm-browserify": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", @@ -46552,7 +47735,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", "integrity": "sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==", - "dev": true, + "devOptional": true, "requires": { "browser-process-hrtime": "^1.0.0" } @@ -46561,7 +47744,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz", "integrity": "sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA==", - "dev": true, + "devOptional": true, "requires": { "xml-name-validator": "^3.0.0" } @@ -46866,7 +48049,7 @@ "version": "6.1.0", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz", "integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==", - "dev": true + "devOptional": true }, "webpack": { "version": "4.46.0", @@ -47089,7 +48272,7 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", "integrity": "sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==", - "dev": true, + "devOptional": true, "requires": { "iconv-lite": "0.4.24" } @@ -47098,13 +48281,13 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz", "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==", - "dev": true + "devOptional": true }, "whatwg-url": { "version": "8.7.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.7.0.tgz", "integrity": "sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg==", - "dev": true, + "devOptional": true, "requires": { "lodash": "^4.7.0", "tr46": "^2.1.0", @@ -48314,7 +49497,7 @@ }, "ws": { "version": "7.5.6", - "dev": true, + "devOptional": true, "requires": {} }, "xdg-app-paths": { @@ -48373,13 +49556,13 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", - "dev": true + "devOptional": true }, "xmlchars": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", - "dev": true + "devOptional": true }, "xregexp": { "version": "2.0.0", diff --git a/package.json b/package.json index fa4e764717b3..0830fb7e0720 100644 --- a/package.json +++ b/package.json @@ -21,12 +21,12 @@ "check:type": "npm run check:type --workspaces --if-present", "fix": "npm run prettify && npm run check:lint -- --fix", "prettify": "prettier . --write --ignore-unknown", - "test": "npm run clean --workspace=wrangler && npm run bundle --workspace=wrangler && npm run test --workspace=packages/wrangler --workspace=packages/pages-shared --if-present && npx jest --forceExit", - "test:ci": "npm run test:ci --workspace=packages/wrangler --workspace=packages/pages-shared --if-present && npx jest --forceExit" + "test": "npm run clean --workspace=wrangler && npm run bundle --workspace=wrangler && npm run test --workspace=packages/wrangler --workspace=packages/pages-shared --if-present && npx vitest && npx jest --forceExit", + "test:ci": "npm run test:ci --workspace=packages/wrangler --workspace=packages/pages-shared --if-present && npx vitest && npx jest --forceExit" }, "jest": { "projects": [ - "/fixtures/**/package.json" + "/fixtures/local-mode-tests/package.json" ] }, "dependencies": { @@ -50,7 +50,9 @@ "prettier": "^2.6.2", "prettier-plugin-packagejson": "^2.2.18", "rimraf": "^3.0.2", - "typescript": "^4.8.4" + "typescript": "^4.8.4", + "vite": "^4.0.4", + "vitest": "^0.26.3" }, "devDependencies": { "@cloudflare/workers-types": "^4.20221111.1" diff --git a/vitest.config.ts b/vitest.config.ts new file mode 100644 index 000000000000..3359035c5b11 --- /dev/null +++ b/vitest.config.ts @@ -0,0 +1,16 @@ +import { resolve } from "path"; +import { configDefaults, defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: + __dirname === process.cwd() + ? ["fixtures/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"] + : configDefaults.include, + exclude: [ + ...configDefaults.exclude, + resolve(__dirname, "fixtures/local-mode-tests/**/*"), + ], + root: __dirname, + }, +}); From 1d6b4c88da424e97198e09ee3e55c292929c36ee Mon Sep 17 00:00:00 2001 From: Greg Brimble Date: Wed, 4 Jan 2023 14:33:18 +0000 Subject: [PATCH 02/10] Tidy up now that concurrency properly works --- fixtures/node-app-pages/tests/index.test.ts | 38 +++++----- fixtures/pages-d1-shim/tests/index.test.ts | 6 +- .../pages-functions-app/tests/index.test.ts | 71 ++++++------------- .../tests/index.test.ts | 42 +++++------ .../tests/index.test.ts | 41 +++++------ .../pages-workerjs-app/tests/index.test.ts | 4 +- .../tests/index.test.ts | 42 +++++------ fixtures/remix-pages-app/tests/index.test.ts | 42 +++++------ fixtures/worker-app/tests/index.test.ts | 38 +++++----- 9 files changed, 134 insertions(+), 190 deletions(-) diff --git a/fixtures/node-app-pages/tests/index.test.ts b/fixtures/node-app-pages/tests/index.test.ts index e33f7e489102..7684784732d2 100644 --- a/fixtures/node-app-pages/tests/index.test.ts +++ b/fixtures/node-app-pages/tests/index.test.ts @@ -1,36 +1,33 @@ import { fork } from "child_process"; import path from "path"; import { fetch } from "undici"; -import { describe, expect, it, beforeAll, afterAll } from "vitest"; +import { describe, it, beforeAll, afterAll } from "vitest"; import type { ChildProcess } from "child_process"; describe("Pages Dev", () => { let wranglerProcess: ChildProcess; let ip: string; let port: number; - let resolveReadyPromise: (value: unknown) => void; - const readyPromise = new Promise((resolve) => { - resolveReadyPromise = resolve; - }); - beforeAll(() => { - wranglerProcess = fork( - path.join("..", "..", "packages", "wrangler", "bin", "wrangler.js"), - ["pages", "dev", "public", "--node-compat", "--port=0"], - { - stdio: ["inherit", "inherit", "inherit", "ipc"], - cwd: path.resolve(__dirname, ".."), - } - ).on("message", (message) => { - const parsedMessage = JSON.parse(message.toString()); - ip = parsedMessage.ip; - port = parsedMessage.port; - resolveReadyPromise(undefined); + beforeAll(async () => { + await new Promise((resolve) => { + wranglerProcess = fork( + path.join("..", "..", "packages", "wrangler", "bin", "wrangler.js"), + ["pages", "dev", "public", "--node-compat", "--port=0"], + { + stdio: ["inherit", "inherit", "inherit", "ipc"], + cwd: path.resolve(__dirname, ".."), + } + ).on("message", (message) => { + const parsedMessage = JSON.parse(message.toString()); + ip = parsedMessage.ip; + port = parsedMessage.port; + resolve(null); + }); }); }); afterAll(async () => { - await readyPromise; await new Promise((resolve, reject) => { wranglerProcess.once("exit", (code) => { if (!code) { @@ -45,8 +42,7 @@ describe("Pages Dev", () => { it.concurrent( "should work with `--node-compat` when running code requiring polyfills", - async () => { - await readyPromise; + async ({ expect }) => { const response = await fetch(`http://${ip}:${port}/stripe`); await expect(response.text()).resolves.toContain( diff --git a/fixtures/pages-d1-shim/tests/index.test.ts b/fixtures/pages-d1-shim/tests/index.test.ts index dd470b3e2b01..5178159d1a3e 100644 --- a/fixtures/pages-d1-shim/tests/index.test.ts +++ b/fixtures/pages-d1-shim/tests/index.test.ts @@ -3,10 +3,10 @@ import { readFileSync } from "fs"; import { tmpdir } from "os"; import * as path from "path"; import { join } from "path"; -import { describe, expect, it, beforeAll, afterAll } from "vitest"; +import { describe, it } from "vitest"; -describe("Pages Functions", () => { - it.concurrent("applies the d1 shim", async () => { +describe("Pages D1 shim", () => { + it.concurrent("applies the D1 shim", async ({ expect }) => { const dir = tmpdir(); const file = join(dir, "./d1-pages.js"); diff --git a/fixtures/pages-functions-app/tests/index.test.ts b/fixtures/pages-functions-app/tests/index.test.ts index fde91e7e1aea..02f9d6c7c190 100644 --- a/fixtures/pages-functions-app/tests/index.test.ts +++ b/fixtures/pages-functions-app/tests/index.test.ts @@ -8,37 +8,34 @@ describe("Pages Functions", () => { let wranglerProcess: ChildProcess; let ip: string; let port: number; - let resolveReadyPromise: (value: unknown) => void; - const readyPromise = new Promise((resolve) => { - resolveReadyPromise = resolve; - }); beforeAll(async () => { - wranglerProcess = fork( - path.join("..", "..", "packages", "wrangler", "bin", "wrangler.js"), - [ - "pages", - "dev", - "public", - "--binding=NAME=VALUE", - "--binding=OTHER_NAME=THING=WITH=EQUALS", - "--r2=BUCKET", - "--port=0", - ], - { - stdio: ["inherit", "inherit", "inherit", "ipc"], - cwd: path.resolve(__dirname, ".."), - } - ).on("message", (message) => { - const parsedMessage = JSON.parse(message.toString()); - ip = parsedMessage.ip; - port = parsedMessage.port; - resolveReadyPromise(undefined); + await new Promise((resolve) => { + wranglerProcess = fork( + path.join("..", "..", "packages", "wrangler", "bin", "wrangler.js"), + [ + "pages", + "dev", + "public", + "--binding=NAME=VALUE", + "--binding=OTHER_NAME=THING=WITH=EQUALS", + "--r2=BUCKET", + "--port=0", + ], + { + stdio: ["inherit", "inherit", "inherit", "ipc"], + cwd: path.resolve(__dirname, ".."), + } + ).on("message", (message) => { + const parsedMessage = JSON.parse(message.toString()); + ip = parsedMessage.ip; + port = parsedMessage.port; + resolve(null); + }); }); }); afterAll(async () => { - await readyPromise; await new Promise((resolve, reject) => { wranglerProcess.once("exit", (code) => { if (!code) { @@ -52,7 +49,6 @@ describe("Pages Functions", () => { }); it.concurrent("renders static pages", async ({ expect }) => { - await readyPromise; const response = await fetch(`http://${ip}:${port}/`); expect(response.headers.get("x-custom")).toBe("header value"); const text = await response.text(); @@ -60,7 +56,6 @@ describe("Pages Functions", () => { }); it.concurrent("renders pages with . characters", async ({ expect }) => { - await readyPromise; const response = await fetch(`http://${ip}:${port}/a.b`); expect(response.headers.get("x-custom")).toBe("header value"); const text = await response.text(); @@ -68,21 +63,18 @@ describe("Pages Functions", () => { }); it.concurrent("parses URL encoded requests", async ({ expect }) => { - await readyPromise; const response = await fetch(`http://${ip}:${port}/[id].js`); const text = await response.text(); expect(text).toContain("// test script"); }); it.concurrent("parses URLs with regex chars", async ({ expect }) => { - await readyPromise; const response = await fetch(`http://${ip}:${port}/regex_chars/my-file`); const text = await response.text(); expect(text).toEqual("My file with regex chars"); }); it.concurrent("passes environment variables", async ({ expect }) => { - await readyPromise; const response = await fetch(`http://${ip}:${port}/variables`); const env = await response.json(); expect(env).toEqual({ @@ -102,7 +94,6 @@ describe("Pages Functions", () => { it.concurrent( "intercepts static requests with next()", async ({ expect }) => { - await readyPromise; const response = await fetch(`http://${ip}:${port}/intercept`); const text = await response.text(); expect(text).toContain("Hello, world!"); @@ -111,14 +102,12 @@ describe("Pages Functions", () => { ); it.concurrent("can make SSR responses", async ({ expect }) => { - await readyPromise; const response = await fetch(`http://${ip}:${port}/date`); const text = await response.text(); expect(text).toMatch(/\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d/); }); it.concurrent("can use parameters", async ({ expect }) => { - await readyPromise; const response = await fetch(`http://${ip}:${port}/blog/hello-world`); const text = await response.text(); expect(text).toContain("

A blog with a slug: hello-world

"); @@ -127,7 +116,6 @@ describe("Pages Functions", () => { it.concurrent( "can override the incoming request with next() parameters", async ({ expect }) => { - await readyPromise; const response = await fetch(`http://${ip}:${port}/next`); const text = await response.text(); expect(text).toContain("

An asset

"); @@ -136,7 +124,6 @@ describe("Pages Functions", () => { describe("can mount a plugin", () => { it.concurrent("should mount Middleware", async ({ expect }) => { - await readyPromise; const response = await fetch( `http://${ip}:${port}/mounted-plugin/some-page` ); @@ -145,7 +132,6 @@ describe("Pages Functions", () => { }); it.concurrent("should mount Fixed page", async ({ expect }) => { - await readyPromise; const response = await fetch(`http://${ip}:${port}/mounted-plugin/fixed`); const text = await response.text(); expect(text).toContain("I'm a fixed response"); @@ -154,14 +140,12 @@ describe("Pages Functions", () => { describe("can import static assets", () => { it.concurrent("should render a static asset", async ({ expect }) => { - await readyPromise; const response = await fetch(`http://${ip}:${port}/static`); const text = await response.text(); expect(text).toContain("

Hello from an imported static asset!

"); }); it.concurrent("should render from a Plugin", async ({ expect }) => { - await readyPromise; const response = await fetch( `http://${ip}:${port}/mounted-plugin/static` ); @@ -172,7 +156,6 @@ describe("Pages Functions", () => { }); it.concurrent("should render static/foo", async ({ expect }) => { - await readyPromise; const response = await fetch( `http://${ip}:${port}/mounted-plugin/static/foo` ); @@ -181,7 +164,6 @@ describe("Pages Functions", () => { }); it.concurrent("should render static/dir/bar", async ({ expect }) => { - await readyPromise; const response = await fetch( `http://${ip}:${port}/mounted-plugin/static/dir/bar` ); @@ -192,7 +174,6 @@ describe("Pages Functions", () => { it.concurrent( "supports importing .html from a function", async ({ expect }) => { - await readyPromise; const response = await fetch(`http://${ip}:${port}/import-html`); expect(response.headers.get("x-custom")).toBe("header value"); const text = await response.text(); @@ -203,7 +184,6 @@ describe("Pages Functions", () => { describe("it supports R2", () => { it.concurrent("should allow creates", async ({ expect }) => { - await readyPromise; const response = await fetch(`http://${ip}:${port}/r2/create`, { method: "PUT", }); @@ -225,7 +205,6 @@ describe("Pages Functions", () => { describe("redirects", () => { it.concurrent("still attaches redirects correctly", async ({ expect }) => { - await readyPromise; const response = await fetch(`http://${ip}:${port}/redirect`, { redirect: "manual", }); @@ -236,14 +215,12 @@ describe("Pages Functions", () => { describe("headers", () => { it.concurrent("still attaches headers correctly", async ({ expect }) => { - await readyPromise; const response = await fetch(`http://${ip}:${port}/`); expect(response.headers.get("A-Header")).toEqual("Some-Value"); }); it.concurrent("can unset and set together", async ({ expect }) => { - await readyPromise; const response = await fetch(`http://${ip}:${port}/header-test`); expect(response.headers.get("A-Header")).toEqual("New-Value"); @@ -252,7 +229,6 @@ describe("Pages Functions", () => { describe("passThroughOnException", () => { it.concurrent("works on a single handler", async ({ expect }) => { - await readyPromise; const response = await fetch( `http://${ip}:${port}/passThroughOnExceptionOpen` ); @@ -262,7 +238,6 @@ describe("Pages Functions", () => { }); it.concurrent("defaults closed", async ({ expect }) => { - await readyPromise; const response = await fetch( `http://${ip}:${port}/passThroughOnExceptionClosed` ); @@ -272,7 +247,6 @@ describe("Pages Functions", () => { }); it.concurrent("works for nested handlers", async ({ expect }) => { - await readyPromise; const response = await fetch( `http://${ip}:${port}/passThroughOnException/nested` ); @@ -284,7 +258,6 @@ describe("Pages Functions", () => { it.concurrent( "allows errors to still be manually caught in middleware", async ({ expect }) => { - await readyPromise; let response = await fetch( `http://${ip}:${port}/passThroughOnExceptionWithCapture/nested` ); diff --git a/fixtures/pages-functions-with-routes-app/tests/index.test.ts b/fixtures/pages-functions-with-routes-app/tests/index.test.ts index 04703b69c981..4ab6c5040c01 100644 --- a/fixtures/pages-functions-with-routes-app/tests/index.test.ts +++ b/fixtures/pages-functions-with-routes-app/tests/index.test.ts @@ -1,36 +1,33 @@ import { fork } from "child_process"; import * as path from "path"; import { fetch } from "undici"; -import { describe, expect, it, beforeAll, afterAll } from "vitest"; +import { describe, it, beforeAll, afterAll } from "vitest"; import type { ChildProcess } from "child_process"; describe("Pages Functions with custom _routes.json", () => { let wranglerProcess: ChildProcess; let ip: string; let port: number; - let resolveReadyPromise: (value: unknown) => void; - const readyPromise = new Promise((resolve) => { - resolveReadyPromise = resolve; - }); - beforeAll(() => { - wranglerProcess = fork( - path.join("..", "..", "packages", "wrangler", "bin", "wrangler.js"), - ["pages", "dev", "public", "--port=0"], - { - stdio: ["inherit", "inherit", "inherit", "ipc"], - cwd: path.resolve(__dirname, ".."), - } - ).on("message", (message) => { - const parsedMessage = JSON.parse(message.toString()); - ip = parsedMessage.ip; - port = parsedMessage.port; - resolveReadyPromise(undefined); + beforeAll(async () => { + await new Promise((resolve) => { + wranglerProcess = fork( + path.join("..", "..", "packages", "wrangler", "bin", "wrangler.js"), + ["pages", "dev", "public", "--port=0"], + { + stdio: ["inherit", "inherit", "inherit", "ipc"], + cwd: path.resolve(__dirname, ".."), + } + ).on("message", (message) => { + const parsedMessage = JSON.parse(message.toString()); + ip = parsedMessage.ip; + port = parsedMessage.port; + resolve(null); + }); }); }); afterAll(async () => { - await readyPromise; await new Promise((resolve, reject) => { wranglerProcess.once("exit", (code) => { if (!code) { @@ -43,8 +40,7 @@ describe("Pages Functions with custom _routes.json", () => { }); }); - it.concurrent("should render static pages", async () => { - await readyPromise; + it.concurrent("should render static pages", async ({ expect }) => { const response = await fetch(`http://${ip}:${port}/undefined-route`); const text = await response.text(); expect(text).toContain( @@ -54,9 +50,7 @@ describe("Pages Functions with custom _routes.json", () => { it.concurrent( "should correctly apply the routing rules provided in the custom _routes.json file", - async () => { - await readyPromise; - + async ({ expect }) => { // matches / include rule let response = await fetch(`http://${ip}:${port}`); let text = await response.text(); diff --git a/fixtures/pages-workerjs-and-functions-app/tests/index.test.ts b/fixtures/pages-workerjs-and-functions-app/tests/index.test.ts index d6c58510cc9d..9e45dd0bd8a8 100644 --- a/fixtures/pages-workerjs-and-functions-app/tests/index.test.ts +++ b/fixtures/pages-workerjs-and-functions-app/tests/index.test.ts @@ -1,37 +1,34 @@ import { fork } from "child_process"; import * as path from "path"; import { fetch } from "undici"; +import { describe, it, beforeAll, afterAll } from "vitest"; import type { ChildProcess } from "child_process"; -import { describe, expect, it, beforeAll, afterAll } from "vitest"; describe("Pages project with `_worker.js` and `/functions` directory", () => { let wranglerProcess: ChildProcess; let ip: string; let port: number; - let resolveReadyPromise: (value: unknown) => void; - const readyPromise = new Promise((resolve) => { - resolveReadyPromise = resolve; - }); // const std = mockConsoleMethods(); - beforeAll(() => { - wranglerProcess = fork( - path.join("..", "..", "packages", "wrangler", "bin", "wrangler.js"), - ["pages", "dev", "public", "--port=0"], - { - stdio: ["inherit", "inherit", "inherit", "ipc"], - cwd: path.resolve(__dirname, ".."), - } - ).on("message", (message) => { - const parsedMessage = JSON.parse(message.toString()); - ip = parsedMessage.ip; - port = parsedMessage.port; - resolveReadyPromise(undefined); + beforeAll(async () => { + await new Promise((resolve) => { + wranglerProcess = fork( + path.join("..", "..", "packages", "wrangler", "bin", "wrangler.js"), + ["pages", "dev", "public", "--port=0"], + { + stdio: ["inherit", "inherit", "inherit", "ipc"], + cwd: path.resolve(__dirname, ".."), + } + ).on("message", (message) => { + const parsedMessage = JSON.parse(message.toString()); + ip = parsedMessage.ip; + port = parsedMessage.port; + resolve(null); + }); }); }); afterAll(async () => { - await readyPromise; await new Promise((resolve, reject) => { wranglerProcess.once("exit", (code) => { if (!code) { @@ -44,8 +41,7 @@ describe("Pages project with `_worker.js` and `/functions` directory", () => { }); }); - it.concurrent("renders static pages", async () => { - await readyPromise; + it.concurrent("renders static pages", async ({ expect }) => { const response = await fetch(`http://${ip}:${port}/`); const text = await response.text(); expect(text).toContain( @@ -55,8 +51,7 @@ describe("Pages project with `_worker.js` and `/functions` directory", () => { it.concurrent( "runs our _worker.js and ignores the functions directory", - async () => { - await readyPromise; + async ({ expect }) => { let response = await fetch(`http://${ip}:${port}/greeting/hello`); let text = await response.text(); expect(text).toEqual("Bonjour le monde!"); diff --git a/fixtures/pages-workerjs-app/tests/index.test.ts b/fixtures/pages-workerjs-app/tests/index.test.ts index a09ce47b450e..a51aa6d36799 100644 --- a/fixtures/pages-workerjs-app/tests/index.test.ts +++ b/fixtures/pages-workerjs-app/tests/index.test.ts @@ -1,11 +1,11 @@ import { execSync } from "child_process"; import path from "path"; -import { describe, expect, it } from "vitest"; +import { describe, it } from "vitest"; describe("Pages _worker.js", () => { it.concurrent( "should throw an error when the _worker.js file imports something", - () => { + ({ expect }) => { expect(() => execSync("npm run dev", { cwd: path.resolve(__dirname, "..") }) ).toThrowError(); diff --git a/fixtures/pages-workerjs-with-routes-app/tests/index.test.ts b/fixtures/pages-workerjs-with-routes-app/tests/index.test.ts index 426e990854c7..0ef6a3b99893 100644 --- a/fixtures/pages-workerjs-with-routes-app/tests/index.test.ts +++ b/fixtures/pages-workerjs-with-routes-app/tests/index.test.ts @@ -1,36 +1,33 @@ import { fork } from "child_process"; import * as path from "path"; import { fetch } from "undici"; -import { describe, expect, it, beforeAll, afterAll } from "vitest"; +import { describe, it, beforeAll, afterAll } from "vitest"; import type { ChildProcess } from "child_process"; describe("Pages Advanced Mode with custom _routes.json", () => { let wranglerProcess: ChildProcess; let ip: string; let port: number; - let resolveReadyPromise: (value: unknown) => void; - const readyPromise = new Promise((resolve) => { - resolveReadyPromise = resolve; - }); - beforeAll(() => { - wranglerProcess = fork( - path.join("..", "..", "packages", "wrangler", "bin", "wrangler.js"), - ["pages", "dev", "public", "--port=0"], - { - stdio: ["inherit", "inherit", "inherit", "ipc"], - cwd: path.resolve(__dirname, ".."), - } - ).on("message", (message) => { - const parsedMessage = JSON.parse(message.toString()); - ip = parsedMessage.ip; - port = parsedMessage.port; - resolveReadyPromise(undefined); + beforeAll(async () => { + await new Promise((resolve) => { + wranglerProcess = fork( + path.join("..", "..", "packages", "wrangler", "bin", "wrangler.js"), + ["pages", "dev", "public", "--port=0"], + { + stdio: ["inherit", "inherit", "inherit", "ipc"], + cwd: path.resolve(__dirname, ".."), + } + ).on("message", (message) => { + const parsedMessage = JSON.parse(message.toString()); + ip = parsedMessage.ip; + port = parsedMessage.port; + resolve(undefined); + }); }); }); afterAll(async () => { - await readyPromise; await new Promise((resolve, reject) => { wranglerProcess.once("exit", (code) => { if (!code) { @@ -43,8 +40,7 @@ describe("Pages Advanced Mode with custom _routes.json", () => { }); }); - it.concurrent("renders static pages", async () => { - await readyPromise; + it.concurrent("renders static pages", async ({ expect }) => { const response = await fetch(`http://${ip}:${port}/`); const text = await response.text(); expect(text).toContain( @@ -52,9 +48,7 @@ describe("Pages Advanced Mode with custom _routes.json", () => { ); }); - it.concurrent("runs our _worker.js", async () => { - await readyPromise; - + it.concurrent("runs our _worker.js", async ({ expect }) => { // matches /greeting/* include rule let response = await fetch(`http://${ip}:${port}/greeting/hello`); let text = await response.text(); diff --git a/fixtures/remix-pages-app/tests/index.test.ts b/fixtures/remix-pages-app/tests/index.test.ts index 3c20a7abff06..ebf80abc6425 100644 --- a/fixtures/remix-pages-app/tests/index.test.ts +++ b/fixtures/remix-pages-app/tests/index.test.ts @@ -1,7 +1,7 @@ import { fork, spawnSync } from "child_process"; import * as path from "path"; import { fetch } from "undici"; -import { describe, expect, it, beforeAll, afterAll } from "vitest"; +import { describe, it, beforeAll, afterAll } from "vitest"; import type { ChildProcess } from "child_process"; const isWindows = process.platform === "win32"; @@ -10,33 +10,30 @@ describe("Remix", () => { let wranglerProcess: ChildProcess; let ip: string; let port: number; - let resolveReadyPromise: (value: unknown) => void; - const readyPromise = new Promise((resolve) => { - resolveReadyPromise = resolve; - }); beforeAll(async () => { - spawnSync("npm", ["run", "build"], { - shell: isWindows, - cwd: path.resolve(__dirname, ".."), - }); - wranglerProcess = fork( - path.join("..", "..", "packages", "wrangler", "bin", "wrangler.js"), - ["pages", "dev", "public", "--port=0"], - { - stdio: ["inherit", "inherit", "inherit", "ipc"], + await new Promise((resolve) => { + spawnSync("npm", ["run", "build"], { + shell: isWindows, cwd: path.resolve(__dirname, ".."), - } - ).on("message", (message) => { - const parsedMessage = JSON.parse(message.toString()); - ip = parsedMessage.ip; - port = parsedMessage.port; - resolveReadyPromise(undefined); + }); + wranglerProcess = fork( + path.join("..", "..", "packages", "wrangler", "bin", "wrangler.js"), + ["pages", "dev", "public", "--port=0"], + { + stdio: ["inherit", "inherit", "inherit", "ipc"], + cwd: path.resolve(__dirname, ".."), + } + ).on("message", (message) => { + const parsedMessage = JSON.parse(message.toString()); + ip = parsedMessage.ip; + port = parsedMessage.port; + resolve(undefined); + }); }); }); afterAll(async () => { - await readyPromise; await new Promise((resolve, reject) => { wranglerProcess.once("exit", (code) => { if (!code) { @@ -49,8 +46,7 @@ describe("Remix", () => { }); }); - it.concurrent("renders", async () => { - await readyPromise; + it.concurrent("renders", async ({ expect }) => { const response = await fetch(`http://${ip}:${port}/`); const text = await response.text(); expect(text).toContain("Welcome to Remix"); diff --git a/fixtures/worker-app/tests/index.test.ts b/fixtures/worker-app/tests/index.test.ts index f91a56bb1205..b236010c5a58 100644 --- a/fixtures/worker-app/tests/index.test.ts +++ b/fixtures/worker-app/tests/index.test.ts @@ -1,37 +1,34 @@ import { fork } from "child_process"; import * as path from "path"; import { fetch } from "undici"; -import { describe, expect, it, beforeAll, afterAll } from "vitest"; +import { describe, it, beforeAll, afterAll } from "vitest"; import type { ChildProcess } from "child_process"; describe("'wrangler dev' correctly renders pages", () => { let wranglerProcess: ChildProcess; let ip: string; let port: number; - let resolveReadyPromise: (value: unknown) => void; - const readyPromise = new Promise((resolve) => { - resolveReadyPromise = resolve; - }); // const std = mockConsoleMethods(); - beforeAll(() => { - wranglerProcess = fork( - path.join("..", "..", "packages", "wrangler", "bin", "wrangler.js"), - ["dev", "--local", "--port=0"], - { - stdio: ["inherit", "inherit", "inherit", "ipc"], - cwd: path.resolve(__dirname, ".."), - } - ).on("message", (message) => { - const parsedMessage = JSON.parse(message.toString()); - ip = parsedMessage.ip; - port = parsedMessage.port; - resolveReadyPromise(undefined); + beforeAll(async () => { + await new Promise((resolve) => { + wranglerProcess = fork( + path.join("..", "..", "packages", "wrangler", "bin", "wrangler.js"), + ["dev", "--local", "--port=0"], + { + stdio: ["inherit", "inherit", "inherit", "ipc"], + cwd: path.resolve(__dirname, ".."), + } + ).on("message", (message) => { + const parsedMessage = JSON.parse(message.toString()); + ip = parsedMessage.ip; + port = parsedMessage.port; + resolve(null); + }); }); }); afterAll(async () => { - await readyPromise; await new Promise((resolve, reject) => { wranglerProcess.once("exit", (code) => { if (!code) { @@ -44,8 +41,7 @@ describe("'wrangler dev' correctly renders pages", () => { }); }); - it.concurrent("renders ", async () => { - await readyPromise; + it.concurrent("renders ", async ({ expect }) => { const response = await fetch(`http://${ip}:${port}/`); const text = await response.text(); expect(text).toContain(`http://${ip}:${port}/`); From 88054f889dd1ea45d7ee4cc301e9531ec530e84f Mon Sep 17 00:00:00 2001 From: Greg Brimble Date: Wed, 4 Jan 2023 14:49:35 +0000 Subject: [PATCH 03/10] Add DOM to vitest tsc --- fixtures/external-durable-objects-app/tests/tsconfig.json | 1 + fixtures/node-app-pages/tests/tsconfig.json | 1 + fixtures/pages-d1-shim/tests/tsconfig.json | 1 + fixtures/pages-functions-app/tests/tsconfig.json | 1 + fixtures/pages-functions-with-routes-app/tests/tsconfig.json | 1 + fixtures/pages-workerjs-and-functions-app/tests/tsconfig.json | 1 + fixtures/pages-workerjs-with-routes-app/tsconfig.json | 2 +- fixtures/pages-ws-app/tests/tsconfig.json | 1 + fixtures/remix-pages-app/tests/tsconfig.json | 2 +- fixtures/service-bindings-app/tests/tsconfig.json | 1 + fixtures/worker-app/tsconfig.json | 2 +- 11 files changed, 11 insertions(+), 3 deletions(-) diff --git a/fixtures/external-durable-objects-app/tests/tsconfig.json b/fixtures/external-durable-objects-app/tests/tsconfig.json index 5f4cfc8c969f..f4bcc248cfa7 100644 --- a/fixtures/external-durable-objects-app/tests/tsconfig.json +++ b/fixtures/external-durable-objects-app/tests/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../tsconfig.json", "compilerOptions": { + "lib": ["DOM"], "types": ["node", "vitest"] }, "include": ["**/*.ts"] diff --git a/fixtures/node-app-pages/tests/tsconfig.json b/fixtures/node-app-pages/tests/tsconfig.json index 5f4cfc8c969f..f4bcc248cfa7 100644 --- a/fixtures/node-app-pages/tests/tsconfig.json +++ b/fixtures/node-app-pages/tests/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../tsconfig.json", "compilerOptions": { + "lib": ["DOM"], "types": ["node", "vitest"] }, "include": ["**/*.ts"] diff --git a/fixtures/pages-d1-shim/tests/tsconfig.json b/fixtures/pages-d1-shim/tests/tsconfig.json index 47fdad1c84a7..fb1aeb9e2190 100644 --- a/fixtures/pages-d1-shim/tests/tsconfig.json +++ b/fixtures/pages-d1-shim/tests/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../tsconfig.json", "compilerOptions": { + "lib": ["DOM"], "types": ["node", "vitest"] }, "include": ["**/*.ts"], diff --git a/fixtures/pages-functions-app/tests/tsconfig.json b/fixtures/pages-functions-app/tests/tsconfig.json index 47fdad1c84a7..fb1aeb9e2190 100644 --- a/fixtures/pages-functions-app/tests/tsconfig.json +++ b/fixtures/pages-functions-app/tests/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../tsconfig.json", "compilerOptions": { + "lib": ["DOM"], "types": ["node", "vitest"] }, "include": ["**/*.ts"], diff --git a/fixtures/pages-functions-with-routes-app/tests/tsconfig.json b/fixtures/pages-functions-with-routes-app/tests/tsconfig.json index 5f4cfc8c969f..f4bcc248cfa7 100644 --- a/fixtures/pages-functions-with-routes-app/tests/tsconfig.json +++ b/fixtures/pages-functions-with-routes-app/tests/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../tsconfig.json", "compilerOptions": { + "lib": ["DOM"], "types": ["node", "vitest"] }, "include": ["**/*.ts"] diff --git a/fixtures/pages-workerjs-and-functions-app/tests/tsconfig.json b/fixtures/pages-workerjs-and-functions-app/tests/tsconfig.json index 5f4cfc8c969f..f4bcc248cfa7 100644 --- a/fixtures/pages-workerjs-and-functions-app/tests/tsconfig.json +++ b/fixtures/pages-workerjs-and-functions-app/tests/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../tsconfig.json", "compilerOptions": { + "lib": ["DOM"], "types": ["node", "vitest"] }, "include": ["**/*.ts"] diff --git a/fixtures/pages-workerjs-with-routes-app/tsconfig.json b/fixtures/pages-workerjs-with-routes-app/tsconfig.json index 9099b3f778f5..fc8ace64e043 100644 --- a/fixtures/pages-workerjs-with-routes-app/tsconfig.json +++ b/fixtures/pages-workerjs-with-routes-app/tsconfig.json @@ -3,7 +3,7 @@ "target": "ES2020", "esModuleInterop": true, "module": "CommonJS", - "lib": ["ES2020"], + "lib": ["ES2020", "DOM"], "types": ["node", "vitest"], "moduleResolution": "node", "noEmit": true diff --git a/fixtures/pages-ws-app/tests/tsconfig.json b/fixtures/pages-ws-app/tests/tsconfig.json index 5f4cfc8c969f..f4bcc248cfa7 100644 --- a/fixtures/pages-ws-app/tests/tsconfig.json +++ b/fixtures/pages-ws-app/tests/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../tsconfig.json", "compilerOptions": { + "lib": ["DOM"], "types": ["node", "vitest"] }, "include": ["**/*.ts"] diff --git a/fixtures/remix-pages-app/tests/tsconfig.json b/fixtures/remix-pages-app/tests/tsconfig.json index e708738a69ae..1a7a22d802b0 100644 --- a/fixtures/remix-pages-app/tests/tsconfig.json +++ b/fixtures/remix-pages-app/tests/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../tsconfig.json", "compilerOptions": { - "lib": ["ES2019"], + "lib": ["ES2019", "DOM"], "types": ["node", "vitest"] }, "include": ["**/*.ts"], diff --git a/fixtures/service-bindings-app/tests/tsconfig.json b/fixtures/service-bindings-app/tests/tsconfig.json index 47fdad1c84a7..fb1aeb9e2190 100644 --- a/fixtures/service-bindings-app/tests/tsconfig.json +++ b/fixtures/service-bindings-app/tests/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../tsconfig.json", "compilerOptions": { + "lib": ["DOM"], "types": ["node", "vitest"] }, "include": ["**/*.ts"], diff --git a/fixtures/worker-app/tsconfig.json b/fixtures/worker-app/tsconfig.json index 73fe3221b6f4..b9a88756052b 100644 --- a/fixtures/worker-app/tsconfig.json +++ b/fixtures/worker-app/tsconfig.json @@ -3,7 +3,7 @@ "target": "ES2020", "esModuleInterop": true, "module": "CommonJS", - "lib": ["ES2020"], + "lib": ["ES2020", "DOM"], "types": ["vitest", "node"], "moduleResolution": "node", "noEmit": true From 37f2be8e0fd6ec210dbd4bdc86f422966039d547 Mon Sep 17 00:00:00 2001 From: Greg Brimble Date: Wed, 4 Jan 2023 14:57:36 +0000 Subject: [PATCH 04/10] Windows hack? --- vitest.config.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vitest.config.ts b/vitest.config.ts index 3359035c5b11..bfa9e9ca9e42 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -1,4 +1,4 @@ -import { resolve } from "path"; +import { join } from "path"; import { configDefaults, defineConfig } from "vitest/config"; export default defineConfig({ @@ -9,7 +9,7 @@ export default defineConfig({ : configDefaults.include, exclude: [ ...configDefaults.exclude, - resolve(__dirname, "fixtures/local-mode-tests/**/*"), + join(__dirname, "fixtures", "local-mode-tests", "**", "*"), ], root: __dirname, }, From 0c8b9356491d624e41fa9f276227c4edd79f0e89 Mon Sep 17 00:00:00 2001 From: Greg Brimble Date: Wed, 4 Jan 2023 15:04:40 +0000 Subject: [PATCH 05/10] Missed a tsconfig --- fixtures/pages-workerjs-app/tsconfig.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fixtures/pages-workerjs-app/tsconfig.json b/fixtures/pages-workerjs-app/tsconfig.json index 65dd634208f4..b9a88756052b 100644 --- a/fixtures/pages-workerjs-app/tsconfig.json +++ b/fixtures/pages-workerjs-app/tsconfig.json @@ -3,8 +3,8 @@ "target": "ES2020", "esModuleInterop": true, "module": "CommonJS", - "lib": ["ES2020"], - "types": ["jest", "node"], + "lib": ["ES2020", "DOM"], + "types": ["vitest", "node"], "moduleResolution": "node", "noEmit": true }, From 276091e81f1732161fe2d13129974fcc03ffa4fc Mon Sep 17 00:00:00 2001 From: Greg Brimble Date: Wed, 4 Jan 2023 15:14:03 +0000 Subject: [PATCH 06/10] Windows hack v2 --- vitest.config.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/vitest.config.ts b/vitest.config.ts index bfa9e9ca9e42..f89fbdf9fd66 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -1,4 +1,3 @@ -import { join } from "path"; import { configDefaults, defineConfig } from "vitest/config"; export default defineConfig({ @@ -7,10 +6,7 @@ export default defineConfig({ __dirname === process.cwd() ? ["fixtures/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"] : configDefaults.include, - exclude: [ - ...configDefaults.exclude, - join(__dirname, "fixtures", "local-mode-tests", "**", "*"), - ], + exclude: [...configDefaults.exclude, "fixtures/local-mode-tests/**/*"], root: __dirname, }, }); From 928f04183e9b5d8b84ac30476f48382f4ce9da66 Mon Sep 17 00:00:00 2001 From: Greg Brimble Date: Wed, 4 Jan 2023 16:23:25 +0000 Subject: [PATCH 07/10] Boost memory --- .github/workflows/codecov-context.yml | 2 ++ .github/workflows/d1.yml | 2 ++ .github/workflows/experimental-wasm-release.yml | 2 ++ .github/workflows/prereleases.yml | 2 ++ .github/workflows/pullrequests.yml | 2 ++ .github/workflows/queues.yml | 2 ++ .github/workflows/release.yml | 2 ++ 7 files changed, 14 insertions(+) diff --git a/.github/workflows/codecov-context.yml b/.github/workflows/codecov-context.yml index fbc196963a31..9e3932c86ce3 100644 --- a/.github/workflows/codecov-context.yml +++ b/.github/workflows/codecov-context.yml @@ -39,6 +39,8 @@ jobs: - name: Run tests & collect coverage run: npm run test:ci -w wrangler + env: + NODE_OPTIONS: "--max_old_space_size=8192" - name: Report Code Coverage uses: codecov/codecov-action@v3 diff --git a/.github/workflows/d1.yml b/.github/workflows/d1.yml index cb675ae3bfa7..c0dbcb4c14b2 100644 --- a/.github/workflows/d1.yml +++ b/.github/workflows/d1.yml @@ -37,6 +37,8 @@ jobs: - name: Check for errors run: npm run check + env: + NODE_OPTIONS: "--max_old_space_size=8192" - name: Modify package.json version run: node .github/version-script.js diff --git a/.github/workflows/experimental-wasm-release.yml b/.github/workflows/experimental-wasm-release.yml index d7a26fb1da88..e0616fd095ea 100644 --- a/.github/workflows/experimental-wasm-release.yml +++ b/.github/workflows/experimental-wasm-release.yml @@ -39,6 +39,8 @@ jobs: - name: Check for errors run: npm run check + env: + NODE_OPTIONS: "--max_old_space_size=8192" - name: Publish `wrangler@wasm` to NPM run: npm publish --tag wasm diff --git a/.github/workflows/prereleases.yml b/.github/workflows/prereleases.yml index 14c67298285a..1b3ba071f834 100644 --- a/.github/workflows/prereleases.yml +++ b/.github/workflows/prereleases.yml @@ -40,6 +40,8 @@ jobs: - name: Check for errors run: npm run check + env: + NODE_OPTIONS: "--max_old_space_size=8192" - name: Publish Beta to NPM run: npm publish --tag beta diff --git a/.github/workflows/pullrequests.yml b/.github/workflows/pullrequests.yml index e26609f2facd..102112c85efd 100644 --- a/.github/workflows/pullrequests.yml +++ b/.github/workflows/pullrequests.yml @@ -41,6 +41,8 @@ jobs: - name: Check for errors run: npm run check + env: + NODE_OPTIONS: "--max_old_space_size=8192" test: name: "Tests" diff --git a/.github/workflows/queues.yml b/.github/workflows/queues.yml index 0ad04cff8fe0..40ae1099a669 100644 --- a/.github/workflows/queues.yml +++ b/.github/workflows/queues.yml @@ -37,6 +37,8 @@ jobs: - name: Check for errors run: npm run check + env: + NODE_OPTIONS: "--max_old_space_size=8192" - name: Modify package.json version run: node .github/version-script.js diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6a3083337964..a01749352849 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,6 +37,8 @@ jobs: - name: Check for other errors run: npm run check + env: + NODE_OPTIONS: "--max_old_space_size=8192" - name: Create Version PR or Publish to NPM id: changesets From b4037ca4b83b152bc600d03f993af914de6beb88 Mon Sep 17 00:00:00 2001 From: Greg Brimble Date: Thu, 5 Jan 2023 14:30:09 +0000 Subject: [PATCH 08/10] Add manual Node types --- .../tests/tsconfig.json | 3 +- fixtures/node-app-pages/tests/tsconfig.json | 3 +- fixtures/pages-d1-shim/tests/tsconfig.json | 4 +- .../pages-functions-app/tests/tsconfig.json | 4 +- .../tests/tsconfig.json | 3 +- .../tests/tsconfig.json | 4 +- .../tests/tsconfig.json | 3 +- fixtures/pages-workerjs-app/tsconfig.json | 4 +- .../tsconfig.json | 4 +- fixtures/pages-ws-app/tests/tsconfig.json | 3 +- fixtures/remix-pages-app/tests/tsconfig.json | 4 +- .../service-bindings-app/tests/tsconfig.json | 4 +- fixtures/worker-app/tsconfig.json | 4 +- node-types.d.ts | 91 +++++++++++++++++++ 14 files changed, 107 insertions(+), 31 deletions(-) create mode 100644 node-types.d.ts diff --git a/fixtures/external-durable-objects-app/tests/tsconfig.json b/fixtures/external-durable-objects-app/tests/tsconfig.json index f4bcc248cfa7..b1a3500dfd1e 100644 --- a/fixtures/external-durable-objects-app/tests/tsconfig.json +++ b/fixtures/external-durable-objects-app/tests/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../tsconfig.json", "compilerOptions": { - "lib": ["DOM"], "types": ["node", "vitest"] }, - "include": ["**/*.ts"] + "include": ["**/*.ts", "../../../node-types.d.ts"] } diff --git a/fixtures/node-app-pages/tests/tsconfig.json b/fixtures/node-app-pages/tests/tsconfig.json index f4bcc248cfa7..b1a3500dfd1e 100644 --- a/fixtures/node-app-pages/tests/tsconfig.json +++ b/fixtures/node-app-pages/tests/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../tsconfig.json", "compilerOptions": { - "lib": ["DOM"], "types": ["node", "vitest"] }, - "include": ["**/*.ts"] + "include": ["**/*.ts", "../../../node-types.d.ts"] } diff --git a/fixtures/pages-d1-shim/tests/tsconfig.json b/fixtures/pages-d1-shim/tests/tsconfig.json index fb1aeb9e2190..b1a3500dfd1e 100644 --- a/fixtures/pages-d1-shim/tests/tsconfig.json +++ b/fixtures/pages-d1-shim/tests/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../tsconfig.json", "compilerOptions": { - "lib": ["DOM"], "types": ["node", "vitest"] }, - "include": ["**/*.ts"], - "exclude": [] + "include": ["**/*.ts", "../../../node-types.d.ts"] } diff --git a/fixtures/pages-functions-app/tests/tsconfig.json b/fixtures/pages-functions-app/tests/tsconfig.json index fb1aeb9e2190..b1a3500dfd1e 100644 --- a/fixtures/pages-functions-app/tests/tsconfig.json +++ b/fixtures/pages-functions-app/tests/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../tsconfig.json", "compilerOptions": { - "lib": ["DOM"], "types": ["node", "vitest"] }, - "include": ["**/*.ts"], - "exclude": [] + "include": ["**/*.ts", "../../../node-types.d.ts"] } diff --git a/fixtures/pages-functions-with-routes-app/tests/tsconfig.json b/fixtures/pages-functions-with-routes-app/tests/tsconfig.json index f4bcc248cfa7..b1a3500dfd1e 100644 --- a/fixtures/pages-functions-with-routes-app/tests/tsconfig.json +++ b/fixtures/pages-functions-with-routes-app/tests/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../tsconfig.json", "compilerOptions": { - "lib": ["DOM"], "types": ["node", "vitest"] }, - "include": ["**/*.ts"] + "include": ["**/*.ts", "../../../node-types.d.ts"] } diff --git a/fixtures/pages-plugin-mounted-on-root-app/tests/tsconfig.json b/fixtures/pages-plugin-mounted-on-root-app/tests/tsconfig.json index fb1aeb9e2190..b1a3500dfd1e 100644 --- a/fixtures/pages-plugin-mounted-on-root-app/tests/tsconfig.json +++ b/fixtures/pages-plugin-mounted-on-root-app/tests/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../tsconfig.json", "compilerOptions": { - "lib": ["DOM"], "types": ["node", "vitest"] }, - "include": ["**/*.ts"], - "exclude": [] + "include": ["**/*.ts", "../../../node-types.d.ts"] } diff --git a/fixtures/pages-workerjs-and-functions-app/tests/tsconfig.json b/fixtures/pages-workerjs-and-functions-app/tests/tsconfig.json index f4bcc248cfa7..b1a3500dfd1e 100644 --- a/fixtures/pages-workerjs-and-functions-app/tests/tsconfig.json +++ b/fixtures/pages-workerjs-and-functions-app/tests/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../tsconfig.json", "compilerOptions": { - "lib": ["DOM"], "types": ["node", "vitest"] }, - "include": ["**/*.ts"] + "include": ["**/*.ts", "../../../node-types.d.ts"] } diff --git a/fixtures/pages-workerjs-app/tsconfig.json b/fixtures/pages-workerjs-app/tsconfig.json index b9a88756052b..0763751e16e5 100644 --- a/fixtures/pages-workerjs-app/tsconfig.json +++ b/fixtures/pages-workerjs-app/tsconfig.json @@ -3,10 +3,10 @@ "target": "ES2020", "esModuleInterop": true, "module": "CommonJS", - "lib": ["ES2020", "DOM"], + "lib": ["ES2020"], "types": ["vitest", "node"], "moduleResolution": "node", "noEmit": true }, - "include": ["tests"] + "include": ["tests", "../../node-types.d.ts"] } diff --git a/fixtures/pages-workerjs-with-routes-app/tsconfig.json b/fixtures/pages-workerjs-with-routes-app/tsconfig.json index fc8ace64e043..c6e4bc617056 100644 --- a/fixtures/pages-workerjs-with-routes-app/tsconfig.json +++ b/fixtures/pages-workerjs-with-routes-app/tsconfig.json @@ -3,10 +3,10 @@ "target": "ES2020", "esModuleInterop": true, "module": "CommonJS", - "lib": ["ES2020", "DOM"], + "lib": ["ES2020"], "types": ["node", "vitest"], "moduleResolution": "node", "noEmit": true }, - "include": ["tests"] + "include": ["tests", "../../node-types.d.ts"] } diff --git a/fixtures/pages-ws-app/tests/tsconfig.json b/fixtures/pages-ws-app/tests/tsconfig.json index f4bcc248cfa7..b1a3500dfd1e 100644 --- a/fixtures/pages-ws-app/tests/tsconfig.json +++ b/fixtures/pages-ws-app/tests/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../tsconfig.json", "compilerOptions": { - "lib": ["DOM"], "types": ["node", "vitest"] }, - "include": ["**/*.ts"] + "include": ["**/*.ts", "../../../node-types.d.ts"] } diff --git a/fixtures/remix-pages-app/tests/tsconfig.json b/fixtures/remix-pages-app/tests/tsconfig.json index 1a7a22d802b0..b1a3500dfd1e 100644 --- a/fixtures/remix-pages-app/tests/tsconfig.json +++ b/fixtures/remix-pages-app/tests/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../tsconfig.json", "compilerOptions": { - "lib": ["ES2019", "DOM"], "types": ["node", "vitest"] }, - "include": ["**/*.ts"], - "exclude": [] + "include": ["**/*.ts", "../../../node-types.d.ts"] } diff --git a/fixtures/service-bindings-app/tests/tsconfig.json b/fixtures/service-bindings-app/tests/tsconfig.json index fb1aeb9e2190..b1a3500dfd1e 100644 --- a/fixtures/service-bindings-app/tests/tsconfig.json +++ b/fixtures/service-bindings-app/tests/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../tsconfig.json", "compilerOptions": { - "lib": ["DOM"], "types": ["node", "vitest"] }, - "include": ["**/*.ts"], - "exclude": [] + "include": ["**/*.ts", "../../../node-types.d.ts"] } diff --git a/fixtures/worker-app/tsconfig.json b/fixtures/worker-app/tsconfig.json index b9a88756052b..0763751e16e5 100644 --- a/fixtures/worker-app/tsconfig.json +++ b/fixtures/worker-app/tsconfig.json @@ -3,10 +3,10 @@ "target": "ES2020", "esModuleInterop": true, "module": "CommonJS", - "lib": ["ES2020", "DOM"], + "lib": ["ES2020"], "types": ["vitest", "node"], "moduleResolution": "node", "noEmit": true }, - "include": ["tests"] + "include": ["tests", "../../node-types.d.ts"] } diff --git a/node-types.d.ts b/node-types.d.ts new file mode 100644 index 000000000000..3c755dbf4ecd --- /dev/null +++ b/node-types.d.ts @@ -0,0 +1,91 @@ +// https://github.com/cloudflare/wrangler2/pull/2496#discussion_r1062516883 + +import { + Event as WorkerEvent, + WebAssembly as WorkerWebAssembly, +} from "@cloudflare/workers-types"; +import type { + EventListenerOrEventListenerObject, + EventTargetAddEventListenerOptions, + EventTargetEventListenerOptions, +} from "@cloudflare/workers-types"; + +declare global { + // `Event` and `EventTarget` have been global since Node 15, but aren't + // included in `@types/node`. + class Event extends WorkerEvent {} + type EventListenerOptions = EventTargetEventListenerOptions; + type AddEventListenerOptions = EventTargetAddEventListenerOptions; + // (can't use EventTarget from "@cloudflare/workers-types" as it's event map + // type parameters are incompatible with `tinybench`, a `vitest` dependency) + class EventTarget { + addEventListener( + type: string, + callback: EventListenerOrEventListenerObject | null, + options?: EventTargetAddEventListenerOptions | boolean + ): void; + dispatchEvent(event: Event): boolean; + removeEventListener( + type: string, + callback: EventListenerOrEventListenerObject | null, + options?: EventTargetEventListenerOptions | boolean + ): void; + } + + // `WebAssembly` has been global since Node 8, but isn't included in + // `@types/node`. + type BufferSource = ArrayBufferView | ArrayBuffer; + namespace WebAssembly { + class CompileError extends WorkerWebAssembly.CompileError {} + class RuntimeError extends WorkerWebAssembly.RuntimeError {} + + type ValueType = WorkerWebAssembly.ValueType; + type GlobalDescriptor = WorkerWebAssembly.GlobalDescriptor; + class Global extends WorkerWebAssembly.Global {} + + type ImportValue = WorkerWebAssembly.ImportValue; + type ModuleImports = WorkerWebAssembly.ModuleImports; + type Imports = WorkerWebAssembly.Imports; + + type ExportValue = WorkerWebAssembly.ExportValue; + type Exports = WorkerWebAssembly.Exports; + + class Instance extends WorkerWebAssembly.Instance {} + + type MemoryDescriptor = WorkerWebAssembly.MemoryDescriptor; + class Memory extends WorkerWebAssembly.Memory {} + + type ImportExportKind = WorkerWebAssembly.ImportExportKind; + type ModuleExportDescriptor = WorkerWebAssembly.ModuleExportDescriptor; + type ModuleImportDescriptor = WorkerWebAssembly.ModuleImportDescriptor; + class Module extends WorkerWebAssembly.Module { + // Node.js allows dynamic compilation of WebAssembly unlike Workers + constructor(bytes: BufferSource); + } + + type TableKind = WorkerWebAssembly.TableKind; + type TableDescriptor = WorkerWebAssembly.TableDescriptor; + class Table extends WorkerWebAssembly.Table {} + + // Node.js allows dynamic compilation of WebAssembly unlike Workers + interface WebAssemblyInstantiatedSource { + instance: Instance; + module: Module; + } + function compile(bytes: BufferSource): Promise; + function instantiate( + bytes: BufferSource, + importObject?: Imports + ): Promise; + function instantiate( + moduleObject: Module, + importObject?: Imports + ): Promise; + function validate(bytes: BufferSource): boolean; + } + + // `Worker` isn't defined on the global scope in Node.js, but it's required + // by `vite`. Therefore, define it as an empty interface. + // eslint-disable-next-line @typescript-eslint/no-empty-interface + interface Worker {} +} From e2f1fda6ec4a3bd9b545ae34b472fdabb8c8a712 Mon Sep 17 00:00:00 2001 From: Greg Brimble Date: Thu, 5 Jan 2023 15:49:46 +0000 Subject: [PATCH 09/10] Remove unnecessary vitest type in tsconfig --- fixtures/external-durable-objects-app/tests/tsconfig.json | 2 +- fixtures/node-app-pages/tests/tsconfig.json | 2 +- fixtures/pages-d1-shim/tests/tsconfig.json | 2 +- fixtures/pages-functions-app/tests/tsconfig.json | 2 +- fixtures/pages-functions-with-routes-app/tests/tsconfig.json | 2 +- fixtures/pages-plugin-mounted-on-root-app/tests/tsconfig.json | 2 +- fixtures/pages-workerjs-and-functions-app/tests/tsconfig.json | 2 +- fixtures/pages-workerjs-app/tsconfig.json | 2 +- fixtures/pages-workerjs-with-routes-app/tsconfig.json | 2 +- fixtures/pages-ws-app/tests/tsconfig.json | 2 +- fixtures/remix-pages-app/tests/tsconfig.json | 2 +- fixtures/service-bindings-app/tests/tsconfig.json | 2 +- fixtures/worker-app/tsconfig.json | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/fixtures/external-durable-objects-app/tests/tsconfig.json b/fixtures/external-durable-objects-app/tests/tsconfig.json index b1a3500dfd1e..81914cebf00c 100644 --- a/fixtures/external-durable-objects-app/tests/tsconfig.json +++ b/fixtures/external-durable-objects-app/tests/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../tsconfig.json", "compilerOptions": { - "types": ["node", "vitest"] + "types": ["node"] }, "include": ["**/*.ts", "../../../node-types.d.ts"] } diff --git a/fixtures/node-app-pages/tests/tsconfig.json b/fixtures/node-app-pages/tests/tsconfig.json index b1a3500dfd1e..81914cebf00c 100644 --- a/fixtures/node-app-pages/tests/tsconfig.json +++ b/fixtures/node-app-pages/tests/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../tsconfig.json", "compilerOptions": { - "types": ["node", "vitest"] + "types": ["node"] }, "include": ["**/*.ts", "../../../node-types.d.ts"] } diff --git a/fixtures/pages-d1-shim/tests/tsconfig.json b/fixtures/pages-d1-shim/tests/tsconfig.json index b1a3500dfd1e..81914cebf00c 100644 --- a/fixtures/pages-d1-shim/tests/tsconfig.json +++ b/fixtures/pages-d1-shim/tests/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../tsconfig.json", "compilerOptions": { - "types": ["node", "vitest"] + "types": ["node"] }, "include": ["**/*.ts", "../../../node-types.d.ts"] } diff --git a/fixtures/pages-functions-app/tests/tsconfig.json b/fixtures/pages-functions-app/tests/tsconfig.json index b1a3500dfd1e..81914cebf00c 100644 --- a/fixtures/pages-functions-app/tests/tsconfig.json +++ b/fixtures/pages-functions-app/tests/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../tsconfig.json", "compilerOptions": { - "types": ["node", "vitest"] + "types": ["node"] }, "include": ["**/*.ts", "../../../node-types.d.ts"] } diff --git a/fixtures/pages-functions-with-routes-app/tests/tsconfig.json b/fixtures/pages-functions-with-routes-app/tests/tsconfig.json index b1a3500dfd1e..81914cebf00c 100644 --- a/fixtures/pages-functions-with-routes-app/tests/tsconfig.json +++ b/fixtures/pages-functions-with-routes-app/tests/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../tsconfig.json", "compilerOptions": { - "types": ["node", "vitest"] + "types": ["node"] }, "include": ["**/*.ts", "../../../node-types.d.ts"] } diff --git a/fixtures/pages-plugin-mounted-on-root-app/tests/tsconfig.json b/fixtures/pages-plugin-mounted-on-root-app/tests/tsconfig.json index b1a3500dfd1e..81914cebf00c 100644 --- a/fixtures/pages-plugin-mounted-on-root-app/tests/tsconfig.json +++ b/fixtures/pages-plugin-mounted-on-root-app/tests/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../tsconfig.json", "compilerOptions": { - "types": ["node", "vitest"] + "types": ["node"] }, "include": ["**/*.ts", "../../../node-types.d.ts"] } diff --git a/fixtures/pages-workerjs-and-functions-app/tests/tsconfig.json b/fixtures/pages-workerjs-and-functions-app/tests/tsconfig.json index b1a3500dfd1e..81914cebf00c 100644 --- a/fixtures/pages-workerjs-and-functions-app/tests/tsconfig.json +++ b/fixtures/pages-workerjs-and-functions-app/tests/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../tsconfig.json", "compilerOptions": { - "types": ["node", "vitest"] + "types": ["node"] }, "include": ["**/*.ts", "../../../node-types.d.ts"] } diff --git a/fixtures/pages-workerjs-app/tsconfig.json b/fixtures/pages-workerjs-app/tsconfig.json index 0763751e16e5..6eb14e3584b7 100644 --- a/fixtures/pages-workerjs-app/tsconfig.json +++ b/fixtures/pages-workerjs-app/tsconfig.json @@ -4,7 +4,7 @@ "esModuleInterop": true, "module": "CommonJS", "lib": ["ES2020"], - "types": ["vitest", "node"], + "types": ["node"], "moduleResolution": "node", "noEmit": true }, diff --git a/fixtures/pages-workerjs-with-routes-app/tsconfig.json b/fixtures/pages-workerjs-with-routes-app/tsconfig.json index c6e4bc617056..6eb14e3584b7 100644 --- a/fixtures/pages-workerjs-with-routes-app/tsconfig.json +++ b/fixtures/pages-workerjs-with-routes-app/tsconfig.json @@ -4,7 +4,7 @@ "esModuleInterop": true, "module": "CommonJS", "lib": ["ES2020"], - "types": ["node", "vitest"], + "types": ["node"], "moduleResolution": "node", "noEmit": true }, diff --git a/fixtures/pages-ws-app/tests/tsconfig.json b/fixtures/pages-ws-app/tests/tsconfig.json index b1a3500dfd1e..81914cebf00c 100644 --- a/fixtures/pages-ws-app/tests/tsconfig.json +++ b/fixtures/pages-ws-app/tests/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../tsconfig.json", "compilerOptions": { - "types": ["node", "vitest"] + "types": ["node"] }, "include": ["**/*.ts", "../../../node-types.d.ts"] } diff --git a/fixtures/remix-pages-app/tests/tsconfig.json b/fixtures/remix-pages-app/tests/tsconfig.json index b1a3500dfd1e..81914cebf00c 100644 --- a/fixtures/remix-pages-app/tests/tsconfig.json +++ b/fixtures/remix-pages-app/tests/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../tsconfig.json", "compilerOptions": { - "types": ["node", "vitest"] + "types": ["node"] }, "include": ["**/*.ts", "../../../node-types.d.ts"] } diff --git a/fixtures/service-bindings-app/tests/tsconfig.json b/fixtures/service-bindings-app/tests/tsconfig.json index b1a3500dfd1e..81914cebf00c 100644 --- a/fixtures/service-bindings-app/tests/tsconfig.json +++ b/fixtures/service-bindings-app/tests/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../tsconfig.json", "compilerOptions": { - "types": ["node", "vitest"] + "types": ["node"] }, "include": ["**/*.ts", "../../../node-types.d.ts"] } diff --git a/fixtures/worker-app/tsconfig.json b/fixtures/worker-app/tsconfig.json index 0763751e16e5..6eb14e3584b7 100644 --- a/fixtures/worker-app/tsconfig.json +++ b/fixtures/worker-app/tsconfig.json @@ -4,7 +4,7 @@ "esModuleInterop": true, "module": "CommonJS", "lib": ["ES2020"], - "types": ["vitest", "node"], + "types": ["node"], "moduleResolution": "node", "noEmit": true }, From 1886c4654a9153f74bdbe6b7b36e73a86d09d744 Mon Sep 17 00:00:00 2001 From: Greg Brimble Date: Thu, 5 Jan 2023 16:25:49 +0000 Subject: [PATCH 10/10] Make everything concurrent at the 'describe' level --- .../tests/index.test.ts | 59 +++--- fixtures/node-app-pages/tests/index.test.ts | 19 +- fixtures/pages-d1-shim/tests/index.test.ts | 4 +- .../pages-functions-app/tests/index.test.ts | 169 +++++++++--------- .../tests/index.test.ts | 79 ++++---- .../tests/index.test.ts | 4 +- .../tests/index.test.ts | 88 ++++----- .../pages-workerjs-app/tests/index.test.ts | 17 +- .../tests/index.test.ts | 6 +- fixtures/pages-ws-app/tests/index.test.ts | 6 +- fixtures/remix-pages-app/tests/index.test.ts | 4 +- .../service-bindings-app/tests/index.test.ts | 31 ++-- fixtures/worker-app/tests/index.test.ts | 4 +- 13 files changed, 236 insertions(+), 254 deletions(-) diff --git a/fixtures/external-durable-objects-app/tests/index.test.ts b/fixtures/external-durable-objects-app/tests/index.test.ts index d0e7f114cfa9..0226a8aa0f35 100644 --- a/fixtures/external-durable-objects-app/tests/index.test.ts +++ b/fixtures/external-durable-objects-app/tests/index.test.ts @@ -4,7 +4,7 @@ import { fetch } from "undici"; import { describe, expect, it, beforeAll, afterAll } from "vitest"; import type { ChildProcess } from "child_process"; -describe.skip("Pages Functions", () => { +describe.concurrent.skip("Pages Functions", () => { let aWranglerProcess: ChildProcess; let aIP: string; let aPort: number; @@ -137,36 +137,33 @@ describe.skip("Pages Functions", () => { }); }); - it.concurrent( - "connects up Durable Objects and keeps state across wrangler instances", - async () => { - await aReadyPromise; - await bReadyPromise; - await cReadyPromise; - await dReadyPromise; + it("connects up Durable Objects and keeps state across wrangler instances", async () => { + await aReadyPromise; + await bReadyPromise; + await cReadyPromise; + await dReadyPromise; - // Service registry is polled every 300ms, - // so let's give all the Workers a little time to find each other - await new Promise((resolve) => setTimeout(resolve, 700)); + // Service registry is polled every 300ms, + // so let's give all the Workers a little time to find each other + await new Promise((resolve) => setTimeout(resolve, 700)); - const responseA = await fetch(`http://${aIP}:${aPort}/`); - const dataA = (await responseA.json()) as { count: number; id: string }; - expect(dataA.count).toEqual(1); - const responseB = await fetch(`http://${bIP}:${bPort}/`); - const dataB = (await responseB.json()) as { count: number; id: string }; - expect(dataB.count).toEqual(2); - const responseC = await fetch(`http://${cIP}:${cPort}/`); - const dataC = (await responseC.json()) as { count: number; id: string }; - expect(dataC.count).toEqual(3); - const responseD = await fetch(`http://${dIP}:${dPort}/`); - const dataD = (await responseD.json()) as { count: number; id: string }; - expect(dataD.count).toEqual(4); - const responseA2 = await fetch(`http://${aIP}:${aPort}/`); - const dataA2 = (await responseA2.json()) as { count: number; id: string }; - expect(dataA2.count).toEqual(5); - expect(dataA.id).toEqual(dataB.id); - expect(dataA.id).toEqual(dataC.id); - expect(dataA.id).toEqual(dataA2.id); - } - ); + const responseA = await fetch(`http://${aIP}:${aPort}/`); + const dataA = (await responseA.json()) as { count: number; id: string }; + expect(dataA.count).toEqual(1); + const responseB = await fetch(`http://${bIP}:${bPort}/`); + const dataB = (await responseB.json()) as { count: number; id: string }; + expect(dataB.count).toEqual(2); + const responseC = await fetch(`http://${cIP}:${cPort}/`); + const dataC = (await responseC.json()) as { count: number; id: string }; + expect(dataC.count).toEqual(3); + const responseD = await fetch(`http://${dIP}:${dPort}/`); + const dataD = (await responseD.json()) as { count: number; id: string }; + expect(dataD.count).toEqual(4); + const responseA2 = await fetch(`http://${aIP}:${aPort}/`); + const dataA2 = (await responseA2.json()) as { count: number; id: string }; + expect(dataA2.count).toEqual(5); + expect(dataA.id).toEqual(dataB.id); + expect(dataA.id).toEqual(dataC.id); + expect(dataA.id).toEqual(dataA2.id); + }); }); diff --git a/fixtures/node-app-pages/tests/index.test.ts b/fixtures/node-app-pages/tests/index.test.ts index 7684784732d2..2714d7cba227 100644 --- a/fixtures/node-app-pages/tests/index.test.ts +++ b/fixtures/node-app-pages/tests/index.test.ts @@ -4,7 +4,7 @@ import { fetch } from "undici"; import { describe, it, beforeAll, afterAll } from "vitest"; import type { ChildProcess } from "child_process"; -describe("Pages Dev", () => { +describe.concurrent("Pages Dev", () => { let wranglerProcess: ChildProcess; let ip: string; let port: number; @@ -40,14 +40,13 @@ describe("Pages Dev", () => { }); }); - it.concurrent( - "should work with `--node-compat` when running code requiring polyfills", - async ({ expect }) => { - const response = await fetch(`http://${ip}:${port}/stripe`); + it("should work with `--node-compat` when running code requiring polyfills", async ({ + expect, + }) => { + const response = await fetch(`http://${ip}:${port}/stripe`); - await expect(response.text()).resolves.toContain( - `"PATH":"path/to/some-file","STRIPE_OBJECT"` - ); - } - ); + await expect(response.text()).resolves.toContain( + `"PATH":"path/to/some-file","STRIPE_OBJECT"` + ); + }); }); diff --git a/fixtures/pages-d1-shim/tests/index.test.ts b/fixtures/pages-d1-shim/tests/index.test.ts index 5178159d1a3e..726840c09c62 100644 --- a/fixtures/pages-d1-shim/tests/index.test.ts +++ b/fixtures/pages-d1-shim/tests/index.test.ts @@ -5,8 +5,8 @@ import * as path from "path"; import { join } from "path"; import { describe, it } from "vitest"; -describe("Pages D1 shim", () => { - it.concurrent("applies the D1 shim", async ({ expect }) => { +describe.concurrent("Pages D1 shim", () => { + it("applies the D1 shim", async ({ expect }) => { const dir = tmpdir(); const file = join(dir, "./d1-pages.js"); diff --git a/fixtures/pages-functions-app/tests/index.test.ts b/fixtures/pages-functions-app/tests/index.test.ts index 0f0820500cdc..ec642da58de2 100644 --- a/fixtures/pages-functions-app/tests/index.test.ts +++ b/fixtures/pages-functions-app/tests/index.test.ts @@ -4,7 +4,7 @@ import { fetch } from "undici"; import { describe, it, beforeAll, afterAll } from "vitest"; import type { ChildProcess } from "child_process"; -describe("Pages Functions", () => { +describe.concurrent("Pages Functions", () => { let wranglerProcess: ChildProcess; let ip: string; let port: number; @@ -48,33 +48,33 @@ describe("Pages Functions", () => { }); }); - it.concurrent("renders static pages", async ({ expect }) => { + it("renders static pages", async ({ expect }) => { const response = await fetch(`http://${ip}:${port}/`); expect(response.headers.get("x-custom")).toBe("header value"); const text = await response.text(); expect(text).toContain("Hello, world!"); }); - it.concurrent("renders pages with . characters", async ({ expect }) => { + it("renders pages with . characters", async ({ expect }) => { const response = await fetch(`http://${ip}:${port}/a.b`); expect(response.headers.get("x-custom")).toBe("header value"); const text = await response.text(); expect(text).toContain("Hello, a.b!"); }); - it.concurrent("parses URL encoded requests", async ({ expect }) => { + it("parses URL encoded requests", async ({ expect }) => { const response = await fetch(`http://${ip}:${port}/[id].js`); const text = await response.text(); expect(text).toContain("// test script"); }); - it.concurrent("parses URLs with regex chars", async ({ expect }) => { + it("parses URLs with regex chars", async ({ expect }) => { const response = await fetch(`http://${ip}:${port}/regex_chars/my-file`); const text = await response.text(); expect(text).toEqual("My file with regex chars"); }); - it.concurrent("passes environment variables", async ({ expect }) => { + it("passes environment variables", async ({ expect }) => { const response = await fetch(`http://${ip}:${port}/variables`); const env = await response.json(); expect(env).toEqual({ @@ -91,39 +91,35 @@ describe("Pages Functions", () => { }); }); - it.concurrent( - "intercepts static requests with next()", - async ({ expect }) => { - const response = await fetch(`http://${ip}:${port}/intercept`); - const text = await response.text(); - expect(text).toContain("Hello, world!"); - expect(response.headers.get("x-set-from-functions")).toBe("true"); - } - ); + it("intercepts static requests with next()", async ({ expect }) => { + const response = await fetch(`http://${ip}:${port}/intercept`); + const text = await response.text(); + expect(text).toContain("Hello, world!"); + expect(response.headers.get("x-set-from-functions")).toBe("true"); + }); - it.concurrent("can make SSR responses", async ({ expect }) => { + it("can make SSR responses", async ({ expect }) => { const response = await fetch(`http://${ip}:${port}/date`); const text = await response.text(); expect(text).toMatch(/\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d/); }); - it.concurrent("can use parameters", async ({ expect }) => { + it("can use parameters", async ({ expect }) => { const response = await fetch(`http://${ip}:${port}/blog/hello-world`); const text = await response.text(); expect(text).toContain("

A blog with a slug: hello-world

"); }); - it.concurrent( - "can override the incoming request with next() parameters", - async ({ expect }) => { - const response = await fetch(`http://${ip}:${port}/next`); - const text = await response.text(); - expect(text).toContain("

An asset

"); - } - ); + it("can override the incoming request with next() parameters", async ({ + expect, + }) => { + const response = await fetch(`http://${ip}:${port}/next`); + const text = await response.text(); + expect(text).toContain("

An asset

"); + }); - describe("can mount a plugin", () => { - it.concurrent("should mount Middleware", async ({ expect }) => { + describe.concurrent("can mount a plugin", () => { + it("should mount Middleware", async ({ expect }) => { const response = await fetch( `http://${ip}:${port}/mounted-plugin/some-page` ); @@ -131,7 +127,7 @@ describe("Pages Functions", () => { expect(text).toContain("
Set from a Plugin!
"); }); - it.concurrent("should return a status code", async ({ expect }) => { + it("should return a status code", async ({ expect }) => { const response = await fetch( `http://${ip}:${port}/mounted-plugin/status` ); @@ -142,21 +138,20 @@ describe("Pages Functions", () => { expect(response.status).toBe(502); }); - it.concurrent( - "should mount a Plugin even if in a parameterized route", - async ({ expect }) => { - const response = await fetch( - `http://${ip}:${port}/mounted-with-param/p123/plugin/status` - ); - const text = await response.text(); - expect(text).toMatchInlineSnapshot( - `"This should return a 502 status code"` - ); - expect(response.status).toBe(502); - } - ); - - it.concurrent("should work for nested folders", async ({ expect }) => { + it("should mount a Plugin even if in a parameterized route", async ({ + expect, + }) => { + const response = await fetch( + `http://${ip}:${port}/mounted-with-param/p123/plugin/status` + ); + const text = await response.text(); + expect(text).toMatchInlineSnapshot( + `"This should return a 502 status code"` + ); + expect(response.status).toBe(502); + }); + + it("should work for nested folders", async ({ expect }) => { const response = await fetch( `http://${ip}:${port}/mounted-plugin/api/v1/instance` ); @@ -164,21 +159,21 @@ describe("Pages Functions", () => { expect(text).toMatchInlineSnapshot(`"Response from a nested folder"`); }); - it.concurrent("should mount Fixed page", async ({ expect }) => { + it("should mount Fixed page", async ({ expect }) => { const response = await fetch(`http://${ip}:${port}/mounted-plugin/fixed`); const text = await response.text(); expect(text).toContain("I'm a fixed response"); }); }); - describe("can import static assets", () => { - it.concurrent("should render a static asset", async ({ expect }) => { + describe.concurrent("can import static assets", () => { + it("should render a static asset", async ({ expect }) => { const response = await fetch(`http://${ip}:${port}/static`); const text = await response.text(); expect(text).toContain("

Hello from an imported static asset!

"); }); - it.concurrent("should render from a Plugin", async ({ expect }) => { + it("should render from a Plugin", async ({ expect }) => { const response = await fetch( `http://${ip}:${port}/mounted-plugin/static` ); @@ -188,7 +183,7 @@ describe("Pages Functions", () => { ); }); - it.concurrent("should render static/foo", async ({ expect }) => { + it("should render static/foo", async ({ expect }) => { const response = await fetch( `http://${ip}:${port}/mounted-plugin/static/foo` ); @@ -196,7 +191,7 @@ describe("Pages Functions", () => { expect(text).toContain("

foo

"); }); - it.concurrent("should render static/dir/bar", async ({ expect }) => { + it("should render static/dir/bar", async ({ expect }) => { const response = await fetch( `http://${ip}:${port}/mounted-plugin/static/dir/bar` ); @@ -204,19 +199,16 @@ describe("Pages Functions", () => { expect(text).toContain("

bar

"); }); - it.concurrent( - "supports importing .html from a function", - async ({ expect }) => { - const response = await fetch(`http://${ip}:${port}/import-html`); - expect(response.headers.get("x-custom")).toBe("header value"); - const text = await response.text(); - expect(text).toContain("

Hello from an imported static asset!

"); - } - ); + it("supports importing .html from a function", async ({ expect }) => { + const response = await fetch(`http://${ip}:${port}/import-html`); + expect(response.headers.get("x-custom")).toBe("header value"); + const text = await response.text(); + expect(text).toContain("

Hello from an imported static asset!

"); + }); }); - describe("it supports R2", () => { - it.concurrent("should allow creates", async ({ expect }) => { + describe.concurrent("it supports R2", () => { + it("should allow creates", async ({ expect }) => { const response = await fetch(`http://${ip}:${port}/r2/create`, { method: "PUT", }); @@ -236,8 +228,8 @@ describe("Pages Functions", () => { }); }); - describe("redirects", () => { - it.concurrent("still attaches redirects correctly", async ({ expect }) => { + describe.concurrent("redirects", () => { + it("still attaches redirects correctly", async ({ expect }) => { const response = await fetch(`http://${ip}:${port}/redirect`, { redirect: "manual", }); @@ -246,22 +238,22 @@ describe("Pages Functions", () => { }); }); - describe("headers", () => { - it.concurrent("still attaches headers correctly", async ({ expect }) => { + describe.concurrent("headers", () => { + it("still attaches headers correctly", async ({ expect }) => { const response = await fetch(`http://${ip}:${port}/`); expect(response.headers.get("A-Header")).toEqual("Some-Value"); }); - it.concurrent("can unset and set together", async ({ expect }) => { + it("can unset and set together", async ({ expect }) => { const response = await fetch(`http://${ip}:${port}/header-test`); expect(response.headers.get("A-Header")).toEqual("New-Value"); }); }); - describe("passThroughOnException", () => { - it.concurrent("works on a single handler", async ({ expect }) => { + describe.concurrent("passThroughOnException", () => { + it("works on a single handler", async ({ expect }) => { const response = await fetch( `http://${ip}:${port}/passThroughOnExceptionOpen` ); @@ -270,7 +262,7 @@ describe("Pages Functions", () => { expect(await response.text()).toContain("Hello, world!"); }); - it.concurrent("defaults closed", async ({ expect }) => { + it("defaults closed", async ({ expect }) => { const response = await fetch( `http://${ip}:${port}/passThroughOnExceptionClosed` ); @@ -279,7 +271,7 @@ describe("Pages Functions", () => { expect(await response.text()).not.toContain("Hello, world!"); }); - it.concurrent("works for nested handlers", async ({ expect }) => { + it("works for nested handlers", async ({ expect }) => { const response = await fetch( `http://${ip}:${port}/passThroughOnException/nested` ); @@ -288,25 +280,24 @@ describe("Pages Functions", () => { expect(await response.text()).toContain("Hello, world!"); }); - it.concurrent( - "allows errors to still be manually caught in middleware", - async ({ expect }) => { - let response = await fetch( - `http://${ip}:${port}/passThroughOnExceptionWithCapture/nested` - ); - - expect(response.status).toEqual(200); - expect(await response.text()).toContain("Hello, world!"); - - response = await fetch( - `http://${ip}:${port}/passThroughOnExceptionWithCapture/nested?catch` - ); - - expect(response.status).toEqual(200); - expect(await response.text()).toMatchInlineSnapshot( - `"Manually caught error: ReferenceError: x is not defined"` - ); - } - ); + it("allows errors to still be manually caught in middleware", async ({ + expect, + }) => { + let response = await fetch( + `http://${ip}:${port}/passThroughOnExceptionWithCapture/nested` + ); + + expect(response.status).toEqual(200); + expect(await response.text()).toContain("Hello, world!"); + + response = await fetch( + `http://${ip}:${port}/passThroughOnExceptionWithCapture/nested?catch` + ); + + expect(response.status).toEqual(200); + expect(await response.text()).toMatchInlineSnapshot( + `"Manually caught error: ReferenceError: x is not defined"` + ); + }); }); }); diff --git a/fixtures/pages-functions-with-routes-app/tests/index.test.ts b/fixtures/pages-functions-with-routes-app/tests/index.test.ts index 4ab6c5040c01..13a43c5fc57d 100644 --- a/fixtures/pages-functions-with-routes-app/tests/index.test.ts +++ b/fixtures/pages-functions-with-routes-app/tests/index.test.ts @@ -4,7 +4,7 @@ import { fetch } from "undici"; import { describe, it, beforeAll, afterAll } from "vitest"; import type { ChildProcess } from "child_process"; -describe("Pages Functions with custom _routes.json", () => { +describe.concurrent("Pages Functions with custom _routes.json", () => { let wranglerProcess: ChildProcess; let ip: string; let port: number; @@ -40,7 +40,7 @@ describe("Pages Functions with custom _routes.json", () => { }); }); - it.concurrent("should render static pages", async ({ expect }) => { + it("should render static pages", async ({ expect }) => { const response = await fetch(`http://${ip}:${port}/undefined-route`); const text = await response.text(); expect(text).toContain( @@ -48,49 +48,46 @@ describe("Pages Functions with custom _routes.json", () => { ); }); - it.concurrent( - "should correctly apply the routing rules provided in the custom _routes.json file", - async ({ expect }) => { - // matches / include rule - let response = await fetch(`http://${ip}:${port}`); - let text = await response.text(); - expect(text).toEqual("ROOT"); + it("should correctly apply the routing rules provided in the custom _routes.json file", async ({ + expect, + }) => { + // matches / include rule + let response = await fetch(`http://${ip}:${port}`); + let text = await response.text(); + expect(text).toEqual("ROOT"); - // matches /greeting/* include rule - response = await fetch(`http://${ip}:${port}/greeting`); - text = await response.text(); - expect(text).toEqual("[/functions/greeting/index]: Bonjour alligator!"); + // matches /greeting/* include rule + response = await fetch(`http://${ip}:${port}/greeting`); + text = await response.text(); + expect(text).toEqual("[/functions/greeting/index]: Bonjour alligator!"); - // matches /greeting/* include rule - response = await fetch(`http://${ip}:${port}/greeting/hello`); - text = await response.text(); - expect(text).toEqual("[/functions/greeting/hello]: Bonjour le monde!"); + // matches /greeting/* include rule + response = await fetch(`http://${ip}:${port}/greeting/hello`); + text = await response.text(); + expect(text).toEqual("[/functions/greeting/hello]: Bonjour le monde!"); - // matches /greeting/* include rule - response = await fetch(`http://${ip}:${port}/greeting/bye`); - text = await response.text(); - expect(text).toEqual( - "[/functions/greeting/bye]: A plus tard alligator 👋" - ); + // matches /greeting/* include rule + response = await fetch(`http://${ip}:${port}/greeting/bye`); + text = await response.text(); + expect(text).toEqual("[/functions/greeting/bye]: A plus tard alligator 👋"); - // matches both include|exclude /date rules, but exclude has priority - response = await fetch(`http://${ip}:${port}/date`); - text = await response.text(); - expect(text).toContain( - "Bienvenue sur notre projet ✨ pages-functions-with-routes-app!" - ); + // matches both include|exclude /date rules, but exclude has priority + response = await fetch(`http://${ip}:${port}/date`); + text = await response.text(); + expect(text).toContain( + "Bienvenue sur notre projet ✨ pages-functions-with-routes-app!" + ); - // matches /bye* exclude rule - response = await fetch(`http://${ip}:${port}/bye`); - text = await response.text(); - expect(text).toContain( - "Bienvenue sur notre projet ✨ pages-functions-with-routes-app!" - ); + // matches /bye* exclude rule + response = await fetch(`http://${ip}:${port}/bye`); + text = await response.text(); + expect(text).toContain( + "Bienvenue sur notre projet ✨ pages-functions-with-routes-app!" + ); - // matches /greeting* include rule - response = await fetch(`http://${ip}:${port}/greetings`); - text = await response.text(); - expect(text).toEqual("[/functions/greetings]: Bonjour à tous!"); - } - ); + // matches /greeting* include rule + response = await fetch(`http://${ip}:${port}/greetings`); + text = await response.text(); + expect(text).toEqual("[/functions/greetings]: Bonjour à tous!"); + }); }); diff --git a/fixtures/pages-plugin-mounted-on-root-app/tests/index.test.ts b/fixtures/pages-plugin-mounted-on-root-app/tests/index.test.ts index b3fa002990c8..6ab1bfefed00 100644 --- a/fixtures/pages-plugin-mounted-on-root-app/tests/index.test.ts +++ b/fixtures/pages-plugin-mounted-on-root-app/tests/index.test.ts @@ -4,7 +4,7 @@ import { fetch } from "undici"; import { describe, it, beforeAll, afterAll } from "vitest"; import type { ChildProcess } from "child_process"; -describe("Pages Functions", () => { +describe.concurrent("Pages Functions", () => { let wranglerProcess: ChildProcess; let ip: string; let port: number; @@ -40,7 +40,7 @@ describe("Pages Functions", () => { }); }); - it.concurrent("mounts a plugin correctly at root", async ({ expect }) => { + it("mounts a plugin correctly at root", async ({ expect }) => { const response = await fetch(`http://${ip}:${port}/api/v1/instance`); const text = await response.text(); expect(text).toMatchInlineSnapshot(`"Response from a nested folder"`); diff --git a/fixtures/pages-workerjs-and-functions-app/tests/index.test.ts b/fixtures/pages-workerjs-and-functions-app/tests/index.test.ts index 9e45dd0bd8a8..213587678335 100644 --- a/fixtures/pages-workerjs-and-functions-app/tests/index.test.ts +++ b/fixtures/pages-workerjs-and-functions-app/tests/index.test.ts @@ -4,54 +4,56 @@ import { fetch } from "undici"; import { describe, it, beforeAll, afterAll } from "vitest"; import type { ChildProcess } from "child_process"; -describe("Pages project with `_worker.js` and `/functions` directory", () => { - let wranglerProcess: ChildProcess; - let ip: string; - let port: number; +describe.concurrent( + "Pages project with `_worker.js` and `/functions` directory", + () => { + let wranglerProcess: ChildProcess; + let ip: string; + let port: number; - // const std = mockConsoleMethods(); - beforeAll(async () => { - await new Promise((resolve) => { - wranglerProcess = fork( - path.join("..", "..", "packages", "wrangler", "bin", "wrangler.js"), - ["pages", "dev", "public", "--port=0"], - { - stdio: ["inherit", "inherit", "inherit", "ipc"], - cwd: path.resolve(__dirname, ".."), - } - ).on("message", (message) => { - const parsedMessage = JSON.parse(message.toString()); - ip = parsedMessage.ip; - port = parsedMessage.port; - resolve(null); + // const std = mockConsoleMethods(); + beforeAll(async () => { + await new Promise((resolve) => { + wranglerProcess = fork( + path.join("..", "..", "packages", "wrangler", "bin", "wrangler.js"), + ["pages", "dev", "public", "--port=0"], + { + stdio: ["inherit", "inherit", "inherit", "ipc"], + cwd: path.resolve(__dirname, ".."), + } + ).on("message", (message) => { + const parsedMessage = JSON.parse(message.toString()); + ip = parsedMessage.ip; + port = parsedMessage.port; + resolve(null); + }); }); }); - }); - afterAll(async () => { - await new Promise((resolve, reject) => { - wranglerProcess.once("exit", (code) => { - if (!code) { - resolve(code); - } else { - reject(code); - } + afterAll(async () => { + await new Promise((resolve, reject) => { + wranglerProcess.once("exit", (code) => { + if (!code) { + resolve(code); + } else { + reject(code); + } + }); + wranglerProcess.kill("SIGTERM"); }); - wranglerProcess.kill("SIGTERM"); }); - }); - it.concurrent("renders static pages", async ({ expect }) => { - const response = await fetch(`http://${ip}:${port}/`); - const text = await response.text(); - expect(text).toContain( - "Bienvenue sur notre projet ✨ pages-workerjs-and-functions-app!" - ); - }); + it("renders static pages", async ({ expect }) => { + const response = await fetch(`http://${ip}:${port}/`); + const text = await response.text(); + expect(text).toContain( + "Bienvenue sur notre projet ✨ pages-workerjs-and-functions-app!" + ); + }); - it.concurrent( - "runs our _worker.js and ignores the functions directory", - async ({ expect }) => { + it("runs our _worker.js and ignores the functions directory", async ({ + expect, + }) => { let response = await fetch(`http://${ip}:${port}/greeting/hello`); let text = await response.text(); expect(text).toEqual("Bonjour le monde!"); @@ -69,6 +71,6 @@ describe("Pages project with `_worker.js` and `/functions` directory", () => { response = await fetch(`http://${ip}:${port}/party`); text = await response.text(); expect(text).toEqual("Oops! Tous les alligators sont allés à la fête 🎉"); - } - ); -}); + }); + } +); diff --git a/fixtures/pages-workerjs-app/tests/index.test.ts b/fixtures/pages-workerjs-app/tests/index.test.ts index a51aa6d36799..8f9efd416601 100644 --- a/fixtures/pages-workerjs-app/tests/index.test.ts +++ b/fixtures/pages-workerjs-app/tests/index.test.ts @@ -2,13 +2,12 @@ import { execSync } from "child_process"; import path from "path"; import { describe, it } from "vitest"; -describe("Pages _worker.js", () => { - it.concurrent( - "should throw an error when the _worker.js file imports something", - ({ expect }) => { - expect(() => - execSync("npm run dev", { cwd: path.resolve(__dirname, "..") }) - ).toThrowError(); - } - ); +describe.concurrent("Pages _worker.js", () => { + it("should throw an error when the _worker.js file imports something", ({ + expect, + }) => { + expect(() => + execSync("npm run dev", { cwd: path.resolve(__dirname, "..") }) + ).toThrowError(); + }); }); diff --git a/fixtures/pages-workerjs-with-routes-app/tests/index.test.ts b/fixtures/pages-workerjs-with-routes-app/tests/index.test.ts index 0ef6a3b99893..71bd36ac6bc7 100644 --- a/fixtures/pages-workerjs-with-routes-app/tests/index.test.ts +++ b/fixtures/pages-workerjs-with-routes-app/tests/index.test.ts @@ -4,7 +4,7 @@ import { fetch } from "undici"; import { describe, it, beforeAll, afterAll } from "vitest"; import type { ChildProcess } from "child_process"; -describe("Pages Advanced Mode with custom _routes.json", () => { +describe.concurrent("Pages Advanced Mode with custom _routes.json", () => { let wranglerProcess: ChildProcess; let ip: string; let port: number; @@ -40,7 +40,7 @@ describe("Pages Advanced Mode with custom _routes.json", () => { }); }); - it.concurrent("renders static pages", async ({ expect }) => { + it("renders static pages", async ({ expect }) => { const response = await fetch(`http://${ip}:${port}/`); const text = await response.text(); expect(text).toContain( @@ -48,7 +48,7 @@ describe("Pages Advanced Mode with custom _routes.json", () => { ); }); - it.concurrent("runs our _worker.js", async ({ expect }) => { + it("runs our _worker.js", async ({ expect }) => { // matches /greeting/* include rule let response = await fetch(`http://${ip}:${port}/greeting/hello`); let text = await response.text(); diff --git a/fixtures/pages-ws-app/tests/index.test.ts b/fixtures/pages-ws-app/tests/index.test.ts index fee99b803147..37c5473c6457 100644 --- a/fixtures/pages-ws-app/tests/index.test.ts +++ b/fixtures/pages-ws-app/tests/index.test.ts @@ -6,7 +6,7 @@ import type { ChildProcess } from "child_process"; const isWindows = process.platform === "win32"; -describe.skip("Pages Functions", () => { +describe.concurrent.skip("Pages Functions", () => { let wranglerProcess: ChildProcess; let ip: string; let port: number; @@ -48,7 +48,7 @@ describe.skip("Pages Functions", () => { }); }); - it.concurrent("understands normal fetches", async () => { + it("understands normal fetches", async () => { await readyPromise; const response = await upgradingFetch(`http://${ip}:${port}/`); expect(response.headers.get("x-proxied")).toBe("true"); @@ -56,7 +56,7 @@ describe.skip("Pages Functions", () => { expect(text).toContain("Hello, world!"); }); - it.concurrent("understands websocket fetches", async () => { + it("understands websocket fetches", async () => { await readyPromise; const response = await upgradingFetch(`http://${ip}:${port}/ws`, { headers: { Upgrade: "websocket" }, diff --git a/fixtures/remix-pages-app/tests/index.test.ts b/fixtures/remix-pages-app/tests/index.test.ts index ebf80abc6425..0ddefa62dacf 100644 --- a/fixtures/remix-pages-app/tests/index.test.ts +++ b/fixtures/remix-pages-app/tests/index.test.ts @@ -6,7 +6,7 @@ import type { ChildProcess } from "child_process"; const isWindows = process.platform === "win32"; -describe("Remix", () => { +describe.concurrent("Remix", () => { let wranglerProcess: ChildProcess; let ip: string; let port: number; @@ -46,7 +46,7 @@ describe("Remix", () => { }); }); - it.concurrent("renders", async ({ expect }) => { + it("renders", async ({ expect }) => { const response = await fetch(`http://${ip}:${port}/`); const text = await response.text(); expect(text).toContain("Welcome to Remix"); diff --git a/fixtures/service-bindings-app/tests/index.test.ts b/fixtures/service-bindings-app/tests/index.test.ts index 02a4534c905c..cefcb6025791 100644 --- a/fixtures/service-bindings-app/tests/index.test.ts +++ b/fixtures/service-bindings-app/tests/index.test.ts @@ -4,7 +4,7 @@ import { fetch } from "undici"; import { describe, expect, it, beforeAll, afterAll } from "vitest"; import type { ChildProcess } from "child_process"; -describe.skip("Service Bindings", () => { +describe.concurrent.skip("Service Bindings", () => { let aProcess: ChildProcess; let aIP: string; let aPort: number; @@ -75,23 +75,20 @@ describe.skip("Service Bindings", () => { }); }); - it.concurrent( - "connects up Durable Objects and keeps state across wrangler instances", - async () => { - await aReadyPromise; - await bReadyPromise; + it("connects up Durable Objects and keeps state across wrangler instances", async () => { + await aReadyPromise; + await bReadyPromise; - // Service registry is polled every 300ms, - // so let's give worker A some time to find B - await new Promise((resolve) => setTimeout(resolve, 700)); + // Service registry is polled every 300ms, + // so let's give worker A some time to find B + await new Promise((resolve) => setTimeout(resolve, 700)); - const responseA = await fetch(`http://${aIP}:${aPort}/`); - const textA = await responseA.text(); - expect(textA).toEqual("hello world"); + const responseA = await fetch(`http://${aIP}:${aPort}/`); + const textA = await responseA.text(); + expect(textA).toEqual("hello world"); - const responseB = await fetch(`http://${bIP}:${bPort}/`); - const textB = await responseB.text(); - expect(textB).toEqual("hello world"); - } - ); + const responseB = await fetch(`http://${bIP}:${bPort}/`); + const textB = await responseB.text(); + expect(textB).toEqual("hello world"); + }); }); diff --git a/fixtures/worker-app/tests/index.test.ts b/fixtures/worker-app/tests/index.test.ts index b236010c5a58..2741207ca838 100644 --- a/fixtures/worker-app/tests/index.test.ts +++ b/fixtures/worker-app/tests/index.test.ts @@ -4,7 +4,7 @@ import { fetch } from "undici"; import { describe, it, beforeAll, afterAll } from "vitest"; import type { ChildProcess } from "child_process"; -describe("'wrangler dev' correctly renders pages", () => { +describe.concurrent("'wrangler dev' correctly renders pages", () => { let wranglerProcess: ChildProcess; let ip: string; let port: number; @@ -41,7 +41,7 @@ describe("'wrangler dev' correctly renders pages", () => { }); }); - it.concurrent("renders ", async ({ expect }) => { + it("renders ", async ({ expect }) => { const response = await fetch(`http://${ip}:${port}/`); const text = await response.text(); expect(text).toContain(`http://${ip}:${port}/`);