Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

refactor: migrate CLI tests to vitest (#4409)

Bogdan Chadkincb255932bf48
diff --git a/apps/builder/package.json b/apps/builder/package.json
index 8ad837b884..18039b2e7f 100644
--- a/apps/builder/package.json
+++ b/apps/builder/package.json
@@ -81,7 +81,7 @@
"cookie": "^1.0.1",
"css-tree": "^2.3.1",
"date-fns": "^3.6.0",
- "debug": "^4.3.6",
+ "debug": "^4.3.7",
"detect-font": "^0.1.5",
"downshift": "^6.1.7",
"fast-deep-equal": "^3.1.3",
@@ -131,6 +131,7 @@
"@webstudio-is/jest-config": "workspace:*",
"@webstudio-is/tsconfig": "workspace:*",
"html-tags": "^4.0.0",
+ "jest-environment-jsdom": "^29.7.0",
"react-router-dom": "^6.26.2",
"react-test-renderer": "18.3.0-canary-14898b6a9-20240318",
"type-fest": "^4.26.1",
diff --git a/package.json b/package.json
index 1361cfdd51..378acd0958 100644
--- a/package.json
+++ b/package.json
@@ -3,6 +3,7 @@
"name": "webstudio-root",
"version": "0.0.0",
"private": true,
+ "type": "module",
"scripts": {
"build": "pnpm -r --filter='!./fixtures/*' build",
"dts": "pnpm -r dts",
diff --git a/packages/cli/jest.config.js b/packages/cli/jest.config.js
deleted file mode 100644
index e7fc137533..0000000000
--- a/packages/cli/jest.config.js
+++ /dev/null
@@ -1 +0,0 @@
-export { default } from "@webstudio-is/jest-config";
diff --git a/packages/cli/package.json b/packages/cli/package.json
index 3d5ea9c465..fdf2c4321f 100644
--- a/packages/cli/package.json
+++ b/packages/cli/package.json
@@ -24,7 +24,7 @@
"scripts": {
"typecheck": "tsc",
"build": "rm -rf lib && esbuild src/cli.ts --outdir=lib --bundle --format=esm --packages=external",
- "test": "NODE_OPTIONS=--experimental-vm-modules jest"
+ "test": "vitest run"
},
"license": "AGPL-3.0-or-later",
"engines": {
@@ -51,7 +51,6 @@
"zod": "^3.22.4"
},
"devDependencies": {
- "@jest/globals": "^29.7.0",
"@netlify/remix-adapter": "^2.5.1",
"@netlify/remix-edge-adapter": "3.4.2",
"@remix-run/cloudflare": "^2.12.1",
@@ -65,14 +64,15 @@
"@types/react-dom": "^18.2.25",
"@types/yargs": "^17.0.33",
"@vitejs/plugin-react": "^4.3.3",
- "@webstudio-is/jest-config": "workspace:*",
"@webstudio-is/tsconfig": "workspace:*",
+ "prettier": "3.3.3",
"react": "18.3.0-canary-14898b6a9-20240318",
"react-dom": "18.3.0-canary-14898b6a9-20240318",
"ts-expect": "^1.3.0",
"typescript": "5.6.3",
"vike": "^0.4.182",
"vite": "^5.4.10",
+ "vitest": "^2.1.4",
"wrangler": "^3.63.2"
}
}
diff --git a/packages/cli/src/html-to-jsx.test.ts b/packages/cli/src/html-to-jsx.test.ts
index 12c9154ad0..d7a2810092 100644
--- a/packages/cli/src/html-to-jsx.test.ts
+++ b/packages/cli/src/html-to-jsx.test.ts
@@ -1,9 +1,11 @@
-import { test, expect } from "@jest/globals";
+import { test, expect } from "vitest";
import * as React from "react";
import ReactDOMServer from "react-dom/server";
import esbuild from "esbuild";
+import prettier from "prettier/standalone";
+import parserHtml from "prettier/parser-html";
+
import { htmlToJsx } from "./html-to-jsx";
-import prettier from "prettier";
/**
* Converts HTML to JSX, renders the JSX to HTML.
@@ -61,7 +63,10 @@ const convertHtmlToJsxAndRenderToHtml = async (htmlCode: string) => {
};
const formatHtml = async (htmlCode: string) => {
- return await prettier.format(htmlCode, { parser: "html" });
+ return await prettier.format(htmlCode, {
+ parser: "html",
+ plugins: [parserHtml],
+ });
};
test("Simple conversion works", async () => {
diff --git a/packages/css-engine/jest.config.js b/packages/css-engine/jest.config.js
deleted file mode 100644
index e7fc137533..0000000000
--- a/packages/css-engine/jest.config.js
+++ /dev/null
@@ -1 +0,0 @@
-export { default } from "@webstudio-is/jest-config";
diff --git a/packages/css-engine/package.json b/packages/css-engine/package.json
index 18e24eee5f..9e14a52351 100644
--- a/packages/css-engine/package.json
+++ b/packages/css-engine/package.json
@@ -9,7 +9,7 @@
"typecheck": "tsc",
"build": "rm -rf lib && esbuild src/index.ts --outdir=lib --bundle --format=esm --packages=external",
"dts": "tsc --project tsconfig.dts.json",
- "test": "NODE_OPTIONS=--experimental-vm-modules jest"
+ "test": "vitest run"
},
"dependencies": {
"@emotion/hash": "^0.9.2",
@@ -18,14 +18,13 @@
"zod": "^3.22.4"
},
"devDependencies": {
- "@jest/globals": "^29.7.0",
"@types/react": "^18.2.70",
"@types/react-dom": "^18.2.25",
- "@webstudio-is/jest-config": "workspace:*",
"@webstudio-is/tsconfig": "workspace:*",
"react": "18.3.0-canary-14898b6a9-20240318",
"react-dom": "18.3.0-canary-14898b6a9-20240318",
- "typescript": "5.6.3"
+ "typescript": "5.6.3",
+ "vitest": "^2.1.4"
},
"exports": {
"webstudio": "./src/index.ts",
diff --git a/packages/css-engine/src/core/atomic.test.ts b/packages/css-engine/src/core/atomic.test.ts
index 996a9608dd..e3070f4efe 100644
--- a/packages/css-engine/src/core/atomic.test.ts
+++ b/packages/css-engine/src/core/atomic.test.ts
@@ -1,4 +1,4 @@
-import { test, expect } from "@jest/globals";
+import { test, expect } from "vitest";
import { createRegularStyleSheet } from "./create-style-sheet";
import { generateAtomic } from "./atomic";
import type { NestingRule } from "./rules";
diff --git a/packages/css-engine/src/core/compare-media.test.ts b/packages/css-engine/src/core/compare-media.test.ts
index 65e17c4d09..f9ca5f832e 100644
--- a/packages/css-engine/src/core/compare-media.test.ts
+++ b/packages/css-engine/src/core/compare-media.test.ts
@@ -1,4 +1,4 @@
-import { describe, test, expect } from "@jest/globals";
+import { describe, test, expect } from "vitest";
import { compareMedia } from "./compare-media";
describe("Compare media", () => {
diff --git a/packages/css-engine/src/core/equal-media.test.ts b/packages/css-engine/src/core/equal-media.test.ts
index 5917ab54ac..1ad4a0cef5 100644
--- a/packages/css-engine/src/core/equal-media.test.ts
+++ b/packages/css-engine/src/core/equal-media.test.ts
@@ -1,4 +1,4 @@
-import { describe, expect, test } from "@jest/globals";
+import { describe, expect, test } from "vitest";
import { equalMedia } from "./equal-media";
describe("equalMedia", () => {
diff --git a/packages/css-engine/src/core/find-applicable-media.test.ts b/packages/css-engine/src/core/find-applicable-media.test.ts
index 8c04fd96e9..82f6b7f3f2 100644
--- a/packages/css-engine/src/core/find-applicable-media.test.ts
+++ b/packages/css-engine/src/core/find-applicable-media.test.ts
@@ -1,4 +1,4 @@
-import { describe, test, expect } from "@jest/globals";
+import { describe, test, expect } from "vitest";
import { findApplicableMedia } from "./find-applicable-media";
const media = [
diff --git a/packages/css-engine/src/core/match-media.test.ts b/packages/css-engine/src/core/match-media.test.ts
index cfebb6c725..ff40c49759 100644
--- a/packages/css-engine/src/core/match-media.test.ts
+++ b/packages/css-engine/src/core/match-media.test.ts
@@ -1,4 +1,4 @@
-import { describe, expect, test } from "@jest/globals";
+import { describe, expect, test } from "vitest";
import { matchMedia } from "./match-media";
describe("matchMedia", () => {
diff --git a/packages/css-engine/src/core/merger.test.ts b/packages/css-engine/src/core/merger.test.ts
index a9fd98cd83..f23bf1046a 100644
--- a/packages/css-engine/src/core/merger.test.ts
+++ b/packages/css-engine/src/core/merger.test.ts
@@ -1,4 +1,4 @@
-import { expect, test } from "@jest/globals";
+import { expect, test } from "vitest";
import type { StyleValue } from "../schema";
import { mergeStyles } from "./merger";
import type { StyleMap } from "./rules";
diff --git a/packages/css-engine/src/core/prefixer.test.ts b/packages/css-engine/src/core/prefixer.test.ts
index ca6490d714..ca7eec40ba 100644
--- a/packages/css-engine/src/core/prefixer.test.ts
+++ b/packages/css-engine/src/core/prefixer.test.ts
@@ -1,4 +1,4 @@
-import { expect, test } from "@jest/globals";
+import { expect, test } from "vitest";
import { prefixStyles } from "./prefixer";
test("prefix background-clip", () => {
diff --git a/packages/css-engine/src/core/style-sheet-regular.test.ts b/packages/css-engine/src/core/style-sheet-regular.test.ts
index b479ef8bdb..b200a373ea 100644
--- a/packages/css-engine/src/core/style-sheet-regular.test.ts
+++ b/packages/css-engine/src/core/style-sheet-regular.test.ts
@@ -1,4 +1,4 @@
-import { describe, test, expect } from "@jest/globals";
+import { describe, test, expect } from "vitest";
import { createRegularStyleSheet } from "./create-style-sheet";
import type { TransformValue } from "./to-value";
import type { NestingRule } from "./rules";
diff --git a/packages/css-engine/src/core/to-property.test.ts b/packages/css-engine/src/core/to-property.test.ts
index c8576ea638..796b827fda 100644
--- a/packages/css-engine/src/core/to-property.test.ts
+++ b/packages/css-engine/src/core/to-property.test.ts
@@ -1,4 +1,4 @@
-import { describe, test, expect } from "@jest/globals";
+import { describe, test, expect } from "vitest";
import { hyphenateProperty } from "./to-property";
describe("hyphenateProperty", () => {
diff --git a/packages/css-engine/src/core/to-value.test.ts b/packages/css-engine/src/core/to-value.test.ts
index 34dfb2400f..b9ae3a2ad8 100644
--- a/packages/css-engine/src/core/to-value.test.ts
+++ b/packages/css-engine/src/core/to-value.test.ts
@@ -1,4 +1,4 @@
-import { describe, test, expect } from "@jest/globals";
+import { describe, test, expect } from "vitest";
import { toValue } from "./to-value";
describe("Convert WS CSS Values to native CSS strings", () => {
diff --git a/packages/fonts/jest.config.js b/packages/fonts/jest.config.js
deleted file mode 100644
index e7fc137533..0000000000
--- a/packages/fonts/jest.config.js
+++ /dev/null
@@ -1 +0,0 @@
-export { default } from "@webstudio-is/jest-config";
diff --git a/packages/fonts/package.json b/packages/fonts/package.json
index 93e83e899a..b45fe917b6 100644
--- a/packages/fonts/package.json
+++ b/packages/fonts/package.json
@@ -7,15 +7,14 @@
"type": "module",
"scripts": {
"typecheck": "tsc",
- "test": "NODE_OPTIONS=--experimental-vm-modules jest",
+ "test": "vitest run",
"build": "rm -rf lib && esbuild src/index.ts --outdir=lib --bundle --format=esm --packages=external",
"dts": "tsc --project tsconfig.dts.json"
},
"devDependencies": {
- "@jest/globals": "^29.7.0",
- "@webstudio-is/jest-config": "workspace:*",
"@webstudio-is/tsconfig": "workspace:*",
"typescript": "5.6.3",
+ "vitest": "^2.1.4",
"zod": "^3.22.4"
},
"peerDependencies": {
diff --git a/packages/fonts/src/get-font-faces.test.ts b/packages/fonts/src/get-font-faces.test.ts
index 21a58b23fd..d547e1deb9 100644
--- a/packages/fonts/src/get-font-faces.test.ts
+++ b/packages/fonts/src/get-font-faces.test.ts
@@ -1,4 +1,4 @@
-import { describe, test, expect } from "@jest/globals";
+import { describe, test, expect } from "vitest";
import { getFontFaces, type PartialFontAsset } from "./get-font-faces";
describe("getFontFaces()", () => {
diff --git a/packages/http-client/jest.config.js b/packages/http-client/jest.config.js
deleted file mode 100644
index e7fc137533..0000000000
--- a/packages/http-client/jest.config.js
+++ /dev/null
@@ -1 +0,0 @@
-export { default } from "@webstudio-is/jest-config";
diff --git a/packages/http-client/package.json b/packages/http-client/package.json
index 9ef6d2c313..3e988f0123 100644
--- a/packages/http-client/package.json
+++ b/packages/http-client/package.json
@@ -9,16 +9,15 @@
"build": "rm -rf lib && esbuild src/index.ts --outdir=lib --bundle --format=esm --packages=external",
"dts": "tsc --project tsconfig.dts.json",
"typecheck": "tsc",
- "test": "NODE_OPTIONS=--experimental-vm-modules jest"
+ "test": "vitest run"
},
"dependencies": {
"@webstudio-is/sdk": "workspace:*"
},
"devDependencies": {
- "@jest/globals": "^29.7.0",
- "@webstudio-is/jest-config": "workspace:*",
"@webstudio-is/tsconfig": "workspace:*",
- "typescript": "5.6.3"
+ "typescript": "5.6.3",
+ "vitest": "^2.1.4"
},
"exports": {
"webstudio": "./src/index.ts",
diff --git a/packages/http-client/src/index.test.ts b/packages/http-client/src/index.test.ts
index 6f7fd4f5de..bdaf08721e 100644
--- a/packages/http-client/src/index.test.ts
+++ b/packages/http-client/src/index.test.ts
@@ -1,4 +1,4 @@
-import { expect, test } from "@jest/globals";
+import { expect, test } from "vitest";
import { parseBuilderUrl } from "./index";
test("parseBuilderUrl wstd.dev", async () => {
diff --git a/packages/image/jest.config.js b/packages/image/jest.config.js
deleted file mode 100644
index e7fc137533..0000000000
--- a/packages/image/jest.config.js
+++ /dev/null
@@ -1 +0,0 @@
-export { default } from "@webstudio-is/jest-config";
diff --git a/packages/image/package.json b/packages/image/package.json
index 90aa7a99ab..ba3918c703 100644
--- a/packages/image/package.json
+++ b/packages/image/package.json
@@ -7,7 +7,7 @@
"type": "module",
"scripts": {
"typecheck": "tsc",
- "test": "NODE_OPTIONS=--experimental-vm-modules jest",
+ "test": "vitest run",
"build": "rm -rf lib && esbuild src/index.ts --outdir=lib --bundle --format=esm --packages=external",
"dts": "tsc --project tsconfig.dts.json"
},
@@ -16,14 +16,13 @@
"warn-once": "^0.1.1"
},
"devDependencies": {
- "@jest/globals": "^29.7.0",
"@types/react": "^18.2.70",
"@types/react-dom": "^18.2.25",
- "@webstudio-is/jest-config": "workspace:*",
"@webstudio-is/tsconfig": "workspace:*",
"react": "18.3.0-canary-14898b6a9-20240318",
"react-dom": "18.3.0-canary-14898b6a9-20240318",
- "typescript": "5.6.3"
+ "typescript": "5.6.3",
+ "vitest": "^2.1.4"
},
"peerDependencies": {
"react": "18.3.0-canary-14898b6a9-20240318",
diff --git a/packages/image/src/image-loader.test.ts b/packages/image/src/image-loader.test.ts
index 01322b2b38..2cc00efe6e 100644
--- a/packages/image/src/image-loader.test.ts
+++ b/packages/image/src/image-loader.test.ts
@@ -1,4 +1,4 @@
-import { describe, test, expect } from "@jest/globals";
+import { describe, test, expect } from "vitest";
import { createImageLoader } from "./image-loaders";
const decodePathFragment = (fragment: string) => {
diff --git a/packages/image/src/image-optimize.test.ts b/packages/image/src/image-optimize.test.ts
index 842fc2d824..8b1f3866e9 100644
--- a/packages/image/src/image-optimize.test.ts
+++ b/packages/image/src/image-optimize.test.ts
@@ -1,4 +1,4 @@
-import { describe, test, expect } from "@jest/globals";
+import { describe, test, expect } from "vitest";
import { getImageAttributes } from "./image-optimize";
import { createImageLoader } from "./image-loaders";
diff --git a/packages/react-sdk/jest.config.js b/packages/react-sdk/jest.config.js
deleted file mode 100644
index e7fc137533..0000000000
--- a/packages/react-sdk/jest.config.js
+++ /dev/null
@@ -1 +0,0 @@
-export { default } from "@webstudio-is/jest-config";
diff --git a/packages/react-sdk/package.json b/packages/react-sdk/package.json
index 80e169b762..33b2b642b0 100644
--- a/packages/react-sdk/package.json
+++ b/packages/react-sdk/package.json
@@ -9,19 +9,18 @@
"build": "rm -rf lib && esbuild src/index.ts src/runtime.ts --outdir=lib --bundle --format=esm --packages=external",
"dts": "tsc --project tsconfig.dts.json",
"typecheck": "tsc",
- "test": "NODE_OPTIONS=--experimental-vm-modules jest --passWithNoTests"
+ "test": "vitest run"
},
"devDependencies": {
- "@jest/globals": "^29.7.0",
"@types/react": "^18.2.70",
"@types/react-dom": "^18.2.25",
- "@webstudio-is/jest-config": "workspace:*",
"@webstudio-is/tsconfig": "workspace:*",
"react": "18.3.0-canary-14898b6a9-20240318",
"react-dom": "18.3.0-canary-14898b6a9-20240318",
"strip-indent": "^4.0.0",
"type-fest": "^4.26.1",
"typescript": "5.6.3",
+ "vitest": "^2.1.4",
"zod": "^3.22.4"
},
"peerDependencies": {
diff --git a/packages/react-sdk/src/component-generator.test.tsx b/packages/react-sdk/src/component-generator.test.tsx
index 32cb58e08b..6c5774eb2a 100644
--- a/packages/react-sdk/src/component-generator.test.tsx
+++ b/packages/react-sdk/src/component-generator.test.tsx
@@ -1,5 +1,5 @@
import ts from "typescript";
-import { expect, test } from "@jest/globals";
+import { expect, test } from "vitest";
import stripIndent from "strip-indent";
import { createScope, type DataSource } from "@webstudio-is/sdk";
import {
diff --git a/packages/react-sdk/src/css/css.test.tsx b/packages/react-sdk/src/css/css.test.tsx
index ca809e7b16..2a00696c4b 100644
--- a/packages/react-sdk/src/css/css.test.tsx
+++ b/packages/react-sdk/src/css/css.test.tsx
@@ -1,4 +1,4 @@
-import { expect, test } from "@jest/globals";
+import { expect, test } from "vitest";
import type { Breakpoint } from "@webstudio-is/sdk";
import { generateCss, type CssConfig } from "./css";
import { descendantComponent, rootComponent } from "../core-components";
diff --git a/packages/react-sdk/src/embed-template.test.tsx b/packages/react-sdk/src/embed-template.test.tsx
index fbf6777a94..158c7e260c 100644
--- a/packages/react-sdk/src/embed-template.test.tsx
+++ b/packages/react-sdk/src/embed-template.test.tsx
@@ -1,4 +1,4 @@
-import { expect, test } from "@jest/globals";
+import { expect, test } from "vitest";
import { generateDataFromEmbedTemplate, namespaceMeta } from "./embed-template";
import { showAttribute } from "./props";
import type { WsComponentMeta } from "./components/component-meta";
diff --git a/packages/react-sdk/src/hook.test.ts b/packages/react-sdk/src/hook.test.ts
index cad642bde6..8728b67fcb 100644
--- a/packages/react-sdk/src/hook.test.ts
+++ b/packages/react-sdk/src/hook.test.ts
@@ -1,4 +1,4 @@
-import { expect, test } from "@jest/globals";
+import { expect, test } from "vitest";
import { getClosestInstance, type InstancePath } from "./hook";
test("get closest instance", () => {
diff --git a/packages/react-sdk/src/instance-utils.test.tsx b/packages/react-sdk/src/instance-utils.test.tsx
index f0f1f93533..fd8fadc33c 100644
--- a/packages/react-sdk/src/instance-utils.test.tsx
+++ b/packages/react-sdk/src/instance-utils.test.tsx
@@ -1,4 +1,4 @@
-import { test, expect } from "@jest/globals";
+import { test, expect } from "vitest";
import type { Instance, Instances } from "@webstudio-is/sdk";
import { getIndexesWithinAncestors } from "./instance-utils";
import type { WsComponentMeta } from ".";
diff --git a/packages/react-sdk/src/props.test.ts b/packages/react-sdk/src/props.test.ts
index dadd8c2790..cb04b22d9b 100644
--- a/packages/react-sdk/src/props.test.ts
+++ b/packages/react-sdk/src/props.test.ts
@@ -1,4 +1,4 @@
-import { test, expect, describe } from "@jest/globals";
+import { test, expect, describe } from "vitest";
import type { Pages, Prop } from "@webstudio-is/sdk";
import { isAttributeNameSafe, normalizeProps } from "./props";
diff --git a/packages/react-sdk/src/remix.test.ts b/packages/react-sdk/src/remix.test.ts
index 8865a3632b..ad7aaef8fe 100644
--- a/packages/react-sdk/src/remix.test.ts
+++ b/packages/react-sdk/src/remix.test.ts
@@ -1,4 +1,4 @@
-import { expect, test } from "@jest/globals";
+import { expect, test } from "vitest";
import { generateRemixParams, generateRemixRoute } from "./remix";
test("convert home page to remix route", () => {
diff --git a/packages/sdk-components-react/jest.config.js b/packages/sdk-components-react/jest.config.js
deleted file mode 100644
index e7fc137533..0000000000
--- a/packages/sdk-components-react/jest.config.js
+++ /dev/null
@@ -1 +0,0 @@
-export { default } from "@webstudio-is/jest-config";
diff --git a/packages/sdk-components-react/package.json b/packages/sdk-components-react/package.json
index 9e1559f40e..64cc53b690 100644
--- a/packages/sdk-components-react/package.json
+++ b/packages/sdk-components-react/package.json
@@ -38,7 +38,7 @@
"build": "rm -rf lib && esbuild src/components.ts src/metas.ts src/props.ts --outdir=lib --bundle --format=esm --packages=external",
"build:args": "NODE_OPTIONS=--conditions=webstudio generate-arg-types './src/*.tsx !./src/*.stories.tsx !./src/*.test.{ts,tsx} !./src/*.ws.ts' && prettier --write \"**/*.props.ts\"",
"dts": "tsc --project tsconfig.dts.json",
- "test": "NODE_OPTIONS=--experimental-vm-modules jest",
+ "test": "vitest run",
"typecheck": "tsc"
},
"peerDependencies": {
@@ -55,16 +55,14 @@
"micromark": "^4.0.0"
},
"devDependencies": {
- "@jest/globals": "^29.7.0",
"@testing-library/react": "^14.2.2",
"@types/react": "^18.2.70",
"@types/react-dom": "^18.2.25",
"@webstudio-is/generate-arg-types": "workspace:*",
- "@webstudio-is/jest-config": "workspace:*",
"@webstudio-is/tsconfig": "workspace:*",
- "jest-environment-jsdom": "^29.7.0",
"react": "18.3.0-canary-14898b6a9-20240318",
"react-dom": "18.3.0-canary-14898b6a9-20240318",
- "typescript": "5.6.3"
+ "typescript": "5.6.3",
+ "vitest": "^2.1.4"
}
}
diff --git a/packages/sdk-components-react/src/html-embed.test.tsx b/packages/sdk-components-react/src/html-embed.test.tsx
index 78e97a26d4..305fca25d3 100644
--- a/packages/sdk-components-react/src/html-embed.test.tsx
+++ b/packages/sdk-components-react/src/html-embed.test.tsx
@@ -1,9 +1,9 @@
/**
- * @jest-environment jsdom
+ * @vitest-environment jsdom
*/
import * as React from "react";
import ReactDOMServer from "react-dom/server";
-import { test, expect, describe } from "@jest/globals";
+import { test, expect, describe, beforeEach } from "vitest";
import { fireEvent, render, screen } from "@testing-library/react";
import { ReactSdkContext } from "@webstudio-is/react-sdk/runtime";
import { __testing__, HtmlEmbed } from "./html-embed";
@@ -55,6 +55,13 @@ const App = (props: {
);
};
+beforeEach(() => {
+ // clear body
+ for (const child of document.body.children) {
+ child.remove();
+ }
+});
+
describe("Published site", () => {
/**
* Tests the behavior of script tags in an SSR context for a published site with `clientOnly` set to false:
diff --git a/packages/sdk-components-react/src/time.test.ts b/packages/sdk-components-react/src/time.test.ts
index 87eeddaa5c..352ab7728a 100644
--- a/packages/sdk-components-react/src/time.test.ts
+++ b/packages/sdk-components-react/src/time.test.ts
@@ -1,4 +1,4 @@
-import { expect, test } from "@jest/globals";
+import { expect, test } from "vitest";
import { __testing__ } from "./time";
const { parseDate } = __testing__;
diff --git a/packages/sdk/jest.config.js b/packages/sdk/jest.config.js
deleted file mode 100644
index e7fc137533..0000000000
--- a/packages/sdk/jest.config.js
+++ /dev/null
@@ -1 +0,0 @@
-export { default } from "@webstudio-is/jest-config";
diff --git a/packages/sdk/package.json b/packages/sdk/package.json
index 4692a08b77..538cc8ff81 100644
--- a/packages/sdk/package.json
+++ b/packages/sdk/package.json
@@ -28,7 +28,7 @@
"sideEffects": false,
"scripts": {
"typecheck": "tsc",
- "test": "NODE_OPTIONS=--experimental-vm-modules jest",
+ "test": "vitest run",
"build:normalize.css": "tsx --conditions=webstudio ./scripts/normalize.css.ts && prettier --write src/__generated__/normalize.css.ts",
"build": "rm -rf lib && esbuild src/index.ts src/__generated__/normalize.css.ts --outdir=lib --bundle --format=esm --packages=external",
"dts": "tsc --project tsconfig.dts.json"
@@ -43,11 +43,10 @@
"zod": "^3.22.4"
},
"devDependencies": {
- "@jest/globals": "^29.7.0",
"@webstudio-is/css-data": "workspace:*",
- "@webstudio-is/jest-config": "workspace:*",
"@webstudio-is/tsconfig": "workspace:*",
"html-tags": "^4.0.0",
- "strip-indent": "^4.0.0"
+ "strip-indent": "^4.0.0",
+ "vitest": "^2.1.4"
}
}
diff --git a/packages/sdk/src/expression.test.ts b/packages/sdk/src/expression.test.ts
index fff2c2a3e6..b7ef4e4810 100644
--- a/packages/sdk/src/expression.test.ts
+++ b/packages/sdk/src/expression.test.ts
@@ -1,4 +1,4 @@
-import { describe, expect, test } from "@jest/globals";
+import { describe, expect, test } from "vitest";
import {
type Diagnostic,
decodeDataSourceVariable,
diff --git a/packages/sdk/src/instances-utils.test.tsx b/packages/sdk/src/instances-utils.test.tsx
index 1bd40e21e3..b7c4bb2f97 100644
--- a/packages/sdk/src/instances-utils.test.tsx
+++ b/packages/sdk/src/instances-utils.test.tsx
@@ -1,4 +1,4 @@
-import { expect, test } from "@jest/globals";
+import { expect, test } from "vitest";
import { $, renderJsx } from "./jsx";
import {
findTreeInstanceIds,
diff --git a/packages/sdk/src/jsx.test.tsx b/packages/sdk/src/jsx.test.tsx
index 28062a3363..9221b91307 100644
--- a/packages/sdk/src/jsx.test.tsx
+++ b/packages/sdk/src/jsx.test.tsx
@@ -1,4 +1,4 @@
-import { expect, test } from "@jest/globals";
+import { expect, test } from "vitest";
import {
$,
AssetValue,
diff --git a/packages/sdk/src/page-meta-generator.test.ts b/packages/sdk/src/page-meta-generator.test.ts
index 9436a6ee32..b6bf641d60 100644
--- a/packages/sdk/src/page-meta-generator.test.ts
+++ b/packages/sdk/src/page-meta-generator.test.ts
@@ -1,4 +1,4 @@
-import { expect, test } from "@jest/globals";
+import { expect, test } from "vitest";
import { createScope } from "./scope";
import { generatePageMeta } from "./page-meta-generator";
import type { Asset } from "./schema/assets";
diff --git a/packages/sdk/src/page-utils.test.ts b/packages/sdk/src/page-utils.test.ts
index 3cb5c35179..244660bd55 100644
--- a/packages/sdk/src/page-utils.test.ts
+++ b/packages/sdk/src/page-utils.test.ts
@@ -1,4 +1,4 @@
-import { describe, expect, test } from "@jest/globals";
+import { describe, expect, test } from "vitest";
import type { Pages } from "./schema/pages";
import {
findPageByIdOrPath,
diff --git a/packages/sdk/src/resource-loader.test.ts b/packages/sdk/src/resource-loader.test.ts
index c68a97e570..7f0b9d759f 100644
--- a/packages/sdk/src/resource-loader.test.ts
+++ b/packages/sdk/src/resource-loader.test.ts
@@ -1,4 +1,4 @@
-import { describe, expect, test, beforeEach, jest } from "@jest/globals";
+import { describe, expect, test, beforeEach, vi, type Mock } from "vitest";
import { loadResource } from "./resource-loader";
import type { ResourceRequest } from "./schema/resources";
@@ -6,11 +6,11 @@ import type { ResourceRequest } from "./schema/resources";
// Mock the fetch function
describe("loadResource", () => {
- let mockFetch: jest.Mock<typeof fetch>;
+ let mockFetch: Mock<typeof fetch>;
beforeEach(() => {
- mockFetch = jest.fn();
- jest.clearAllMocks();
+ mockFetch = vi.fn();
+ vi.clearAllMocks();
});
test("should successfully fetch a resource and return a JSON response", async () => {
diff --git a/packages/sdk/src/resources-generator.test.tsx b/packages/sdk/src/resources-generator.test.tsx
index f948c98254..e4063e2d6c 100644
--- a/packages/sdk/src/resources-generator.test.tsx
+++ b/packages/sdk/src/resources-generator.test.tsx
@@ -1,4 +1,4 @@
-import { expect, test } from "@jest/globals";
+import { expect, test } from "vitest";
import { renderJsx, $ } from "./jsx";
import type { Page } from "./schema/pages";
import { createScope } from "./scope";
diff --git a/packages/sdk/src/scope.test.ts b/packages/sdk/src/scope.test.ts
index cf97745da6..136ca7b3de 100644
--- a/packages/sdk/src/scope.test.ts
+++ b/packages/sdk/src/scope.test.ts
@@ -1,4 +1,4 @@
-import { expect, test } from "@jest/globals";
+import { expect, test } from "vitest";
import { createScope } from "./scope";
test("use variable name for specific id and suffix on collision", () => {
diff --git a/packages/sdk/src/url-pattern.test.ts b/packages/sdk/src/url-pattern.test.ts
index cad919f351..06089fb161 100644
--- a/packages/sdk/src/url-pattern.test.ts
+++ b/packages/sdk/src/url-pattern.test.ts
@@ -1,4 +1,4 @@
-import { expect, test } from "@jest/globals";
+import { expect, test } from "vitest";
import { isPathnamePattern } from "./url-pattern";
test("check pathname is pattern", () => {
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index b8b6dd9dc5..698daca7be 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -317,8 +317,8 @@ importers:
specifier: ^3.6.0
version: 3.6.0
debug:
- specifier: ^4.3.6
- version: 4.3.6
+ specifier: ^4.3.7
+ version: 4.3.7
detect-font:
specifier: ^0.1.5
version: 0.1.5
@@ -461,6 +461,9 @@ importers:
html-tags:
specifier: ^4.0.0
version: 4.0.0
+ jest-environment-jsdom:
+ specifier: ^29.7.0
+ version: 29.7.0
react-router-dom:
specifier: ^6.26.2
@@ -1087,9 +1090,6 @@ importers:
specifier: ^3.22.4
version: 3.22.4
devDependencies:
- '@jest/globals':
- specifier: ^29.7.0
- version: 29.7.0
'@netlify/remix-adapter':
specifier: ^2.5.1
@@ -1129,12 +1129,12 @@ importers:
'@vitejs/plugin-react':
specifier: ^4.3.3
version: 4.3.3([email protected](@types/[email protected]))
- '@webstudio-is/jest-config':
- specifier: workspace:*
- version: link:../jest-config
'@webstudio-is/tsconfig':
specifier: workspace:*
version: link:../tsconfig
+ prettier:
+ specifier: 3.3.3
+ version: 3.3.3
react:
specifier: 18.3.0-canary-14898b6a9-20240318
version: 18.3.0-canary-14898b6a9-20240318
@@ -1153,6 +1153,9 @@ importers:
vite:
specifier: ^5.4.10
version: 5.4.10(@types/[email protected])
+ vitest:
+ specifier: ^2.1.4
+ version: 2.1.4(@types/[email protected])([email protected])
wrangler:
specifier: ^3.63.2
version: 3.63.2(@cloudflare/[email protected])
@@ -1236,18 +1239,12 @@ importers:
specifier: ^3.22.4
version: 3.22.4
devDependencies:
- '@jest/globals':
- specifier: ^29.7.0
- version: 29.7.0
'@types/react':
specifier: ^18.2.70
version: 18.2.79
'@types/react-dom':
specifier: ^18.2.25
version: 18.2.25
- '@webstudio-is/jest-config':
- specifier: workspace:*
- version: link:../jest-config
'@webstudio-is/tsconfig':
specifier: workspace:*
version: link:../tsconfig
@@ -1260,6 +1257,9 @@ importers:
typescript:
specifier: 5.6.3
version: 5.6.3
+ vitest:
+ specifier: ^2.1.4
+ version: 2.1.4(@types/[email protected])([email protected])
packages/dashboard:
dependencies:
@@ -1500,18 +1500,15 @@ importers:
packages/fonts:
devDependencies:
- '@jest/globals':
- specifier: ^29.7.0
- version: 29.7.0
- '@webstudio-is/jest-config':
- specifier: workspace:*
- version: link:../jest-config
'@webstudio-is/tsconfig':
specifier: workspace:*
version: link:../tsconfig
typescript:
specifier: 5.6.3
version: 5.6.3
+ vitest:
+ specifier: ^2.1.4
+ version: 2.1.4(@types/[email protected])([email protected])
zod:
specifier: ^3.22.4
version: 3.22.4
@@ -1553,18 +1550,15 @@ importers:
specifier: workspace:*
version: link:../sdk
devDependencies:
- '@jest/globals':
- specifier: ^29.7.0
- version: 29.7.0
- '@webstudio-is/jest-config':
- specifier: workspace:*
- version: link:../jest-config
'@webstudio-is/tsconfig':
specifier: workspace:*
version: link:../tsconfig
typescript:
specifier: 5.6.3
version: 5.6.3
+ vitest:
+ specifier: ^2.1.4
+ version: 2.1.4(@types/[email protected])([email protected])
packages/icons:
devDependencies:
@@ -1608,18 +1602,12 @@ importers:
specifier: ^0.1.1
version: 0.1.1
devDependencies:
- '@jest/globals':
- specifier: ^29.7.0
- version: 29.7.0
'@types/react':
specifier: ^18.2.70
version: 18.2.79
'@types/react-dom':
specifier: ^18.2.25
version: 18.2.25
- '@webstudio-is/jest-config':
- specifier: workspace:*
- version: link:../jest-config
'@webstudio-is/tsconfig':
specifier: workspace:*
version: link:../tsconfig
@@ -1629,6 +1617,9 @@ importers:
typescript:
specifier: 5.6.3
version: 5.6.3
+ vitest:
+ specifier: ^2.1.4
+ version: 2.1.4(@types/[email protected])([email protected])
packages/jest-config:
dependencies:
@@ -1821,18 +1812,12 @@ importers:
specifier: ^4.3.2
version: 4.3.2
devDependencies:
- '@jest/globals':
- specifier: ^29.7.0
- version: 29.7.0
'@types/react':
specifier: ^18.2.70
version: 18.2.79
'@types/react-dom':
specifier: ^18.2.25
version: 18.2.25
- '@webstudio-is/jest-config':
- specifier: workspace:*
- version: link:../jest-config
'@webstudio-is/tsconfig':
specifier: workspace:*
version: link:../tsconfig
@@ -1851,6 +1836,9 @@ importers:
typescript:
specifier: 5.6.3
version: 5.6.3
+ vitest:
+ specifier: ^2.1.4
+ version: 2.1.4(@types/[email protected])([email protected])
zod:
specifier: ^3.22.4
version: 3.22.4
@@ -1879,15 +1867,9 @@ importers:
specifier: ^3.22.4
version: 3.22.4
devDependencies:
- '@jest/globals':
- specifier: ^29.7.0
- version: 29.7.0
'@webstudio-is/css-data':
specifier: workspace:*
version: link:../css-data
- '@webstudio-is/jest-config':
- specifier: workspace:*
- version: link:../jest-config
'@webstudio-is/tsconfig':
specifier: workspace:*
version: link:../tsconfig
@@ -1897,6 +1879,9 @@ importers:
strip-indent:
specifier: ^4.0.0
version: 4.0.0
+ vitest:
+ specifier: ^2.1.4
+ version: 2.1.4(@types/[email protected])([email protected])
packages/sdk-cli:
dependencies:
@@ -1944,9 +1929,6 @@ importers:
specifier: ^4.0.0
version: 4.0.0
devDependencies:
- '@jest/globals':
- specifier: ^29.7.0
- version: 29.7.0
'@testing-library/react':
specifier: ^14.2.2
@@ -1959,15 +1941,9 @@ importers:
'@webstudio-is/generate-arg-types':
specifier: workspace:*
version: link:../generate-arg-types
- '@webstudio-is/jest-config':
- specifier: workspace:*
- version: link:../jest-config
'@webstudio-is/tsconfig':
specifier: workspace:*
version: link:../tsconfig
- jest-environment-jsdom:
- specifier: ^29.7.0
- version: 29.7.0
react:
specifier: 18.3.0-canary-14898b6a9-20240318
version: 18.3.0-canary-14898b6a9-20240318
@@ -1977,6 +1953,9 @@ importers:
typescript:
specifier: 5.6.3
version: 5.6.3
+ vitest:
+ specifier: ^2.1.4
+ version: 2.1.4(@types/[email protected])([email protected])
packages/sdk-components-react-radix:
dependencies:
@@ -3736,6 +3715,9 @@ packages:
'@jridgewell/[email protected]':
resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==}
+ '@jridgewell/[email protected]':
+ resolution: {integrity: sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==}
+
'@jridgewell/[email protected]':
resolution: {integrity: sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==}
@@ -5303,6 +5285,35 @@ packages:
peerDependencies:
vite: ^4.2.0 || ^5.0.0
+ '@vitest/[email protected]':
+ resolution: {integrity: sha512-DOETT0Oh1avie/D/o2sgMHGrzYUFFo3zqESB2Hn70z6QB1HrS2IQ9z5DfyTqU8sg4Bpu13zZe9V4+UTNQlUeQA==}
+
+ '@vitest/[email protected]':
+ resolution: {integrity: sha512-Ky/O1Lc0QBbutJdW0rqLeFNbuLEyS+mIPiNdlVlp2/yhJ0SbyYqObS5IHdhferJud8MbbwMnexg4jordE5cCoQ==}
+ peerDependencies:
+ msw: ^2.4.9
+ vite: ^5.0.0
+ peerDependenciesMeta:
+ msw:
+ optional: true
+ vite:
+ optional: true
+
+ '@vitest/[email protected]':
+ resolution: {integrity: sha512-L95zIAkEuTDbUX1IsjRl+vyBSLh3PwLLgKpghl37aCK9Jvw0iP+wKwIFhfjdUtA2myLgjrG6VU6JCFLv8q/3Ww==}
+
+ '@vitest/[email protected]':
+ resolution: {integrity: sha512-sKRautINI9XICAMl2bjxQM8VfCMTB0EbsBc/EDFA57V6UQevEKY/TOPOF5nzcvCALltiLfXWbq4MaAwWx/YxIA==}
+
+ '@vitest/[email protected]':
+ resolution: {integrity: sha512-3Kab14fn/5QZRog5BPj6Rs8dc4B+mim27XaKWFWHWA87R56AKjHTGcBFKpvZKDzC4u5Wd0w/qKsUIio3KzWW4Q==}
+
+ '@vitest/[email protected]':
+ resolution: {integrity: sha512-4JOxa+UAizJgpZfaCPKK2smq9d8mmjZVPMt2kOsg/R8QkoRzydHH1qHxIYNvr1zlEaFj4SXiaaJWxq/LPLKaLg==}
+
+ '@vitest/[email protected]':
+ resolution: {integrity: sha512-MXDnZn0Awl2S86PSNIim5PWXgIAx8CIkzu35mBdSApUip6RFOGXBCf3YFyeEu8n1IHk4bWD46DeYFu9mQlFIRg==}
+
resolution: {integrity: sha512-cquyDNvZ6jTbf/+x+AgM2Arrp6G4Dzbb0R64jiG804HRMfRiFXWI6kqUVqZ6ZR0bQhIoQjB4+2bhNtVwndW15g==}
@@ -5478,6 +5489,10 @@ packages:
resolution: {integrity: sha512-xvsWESUJn0JN421Xb9MQw6AsMHRCUknCe0Wjlxvjud80mU4E6hQf1A6NzQKcYNmYw62MfzEtXc+badstZP3JpQ==}
+ resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==}
+ engines: {node: '>=12'}
+
resolution: {integrity: sha512-6t10qk83GOG8p0vKmaCr8eiilZwO171AvbROMtvvNiwrTly62t+7XkA8RdIIVbpMhCASAsxgAzdRSwh6nw/5Dg==}
engines: {node: '>=4'}
@@ -5667,6 +5682,10 @@ packages:
resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==}
+ resolution: {integrity: sha512-aGtmf24DW6MLHHG5gCx4zaI3uBq3KRtxeVs0DjFH6Z0rDNbsvTxFASFvdj79pxjxZ8/5u3PIiN3IwEIQkiiuPw==}
+ engines: {node: '>=12'}
+
resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==}
engines: {node: '>=4'}
@@ -5697,6 +5716,10 @@ packages:
resolution: {integrity: sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==}
+ resolution: {integrity: sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==}
+ engines: {node: '>= 16'}
+
resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==}
engines: {node: '>= 8.10.0'}
@@ -5936,8 +5959,8 @@ packages:
supports-color:
optional: true
- resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==}
+ resolution: {integrity: sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==}
engines: {node: '>=6.0'}
peerDependencies:
supports-color: '*'
@@ -5945,8 +5968,8 @@ packages:
supports-color:
optional: true
- resolution: {integrity: sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==}
+ resolution: {integrity: sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==}
engines: {node: '>=6.0'}
peerDependencies:
supports-color: '*'
@@ -5976,6 +5999,10 @@ packages:
babel-plugin-macros:
optional: true
+ resolution: {integrity: sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==}
+ engines: {node: '>=6'}
+
resolution: {integrity: sha512-ZIwpnevOurS8bpT4192sqAowWM76JDKSHYzMLty3BZGSswgq6pBaH3DhCSW5xVAZICZyKdOBPjwww5wfgT/6PA==}
engines: {node: '>= 0.4'}
@@ -6354,6 +6381,10 @@ packages:
resolution: {integrity: sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==}
engines: {node: '>= 0.8.0'}
+ resolution: {integrity: sha512-bFi65yM+xZgk+u/KRIpekdSYkTB5W1pEf0Lt8Q8Msh7b+eQ7LXVtIB1Bkm4fvclDEL1b2CZkMhv2mOeF8tMdkA==}
+ engines: {node: '>=12.0.0'}
+
resolution: {integrity: sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==}
engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
@@ -7265,6 +7296,9 @@ packages:
resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==}
hasBin: true
+ resolution: {integrity: sha512-23I4pFZHmAemUnz8WZXbYRSKYj801VDaNv9ETuMh7IrMc7VuVVSo+Z9iLE3ni30+U48iDWfi30d3twAXBYmnCg==}
+
resolution: {integrity: sha512-svTf/fzsKHffP42sujkO/Rjs37BCIsQVRCeNYIm9WN8rgT7ffoUnRtZCqU+6BqcSBdv8gwJeTz8knJpgACeQMw==}
engines: {node: 14 || >=16.14}
@@ -7294,6 +7328,9 @@ packages:
resolution: {integrity: sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==}
+ resolution: {integrity: sha512-Ea8I3sQMVXr8JhN4z+H/d8zwo+tYDgHE9+5G4Wnrwhs0gaK9fXTKx0Tw5Xwsd/bCPTTZNRAdpyzvoeORe9LYpw==}
+
resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==}
engines: {node: '>=8'}
@@ -7980,6 +8017,10 @@ packages:
resolution: {integrity: sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==}
+ resolution: {integrity: sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==}
+ engines: {node: '>= 14.16'}
+
resolution: {integrity: sha512-FhJ+YbOSBb9/rIl2ZeE/QHEsWn7PqNYt8ARAY3kIgNGOk13g9FGyIY6JIl/xB/3TFRVoTv5as0l11weORrTekA==}
@@ -8644,6 +8685,9 @@ packages:
resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==}
+ resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==}
+
resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==}
@@ -8741,6 +8785,9 @@ packages:
resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==}
engines: {node: '>=10'}
+ resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==}
+
resolution: {integrity: sha512-Kpij9riA+UNg7TnphqjH7/CzctQ/owJGNbFkfEeve4Z4uxT5+JapVLFXcsurIfN34gnTWZNJ/f7NMG0E8JDzTw==}
@@ -8748,6 +8795,9 @@ packages:
resolution: {integrity: sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==}
engines: {node: '>= 0.8'}
+ resolution: {integrity: sha512-Bc3YwwCB+OzldMxOXJIIvC6cPRWr/LxOp48CdQTOkPyk/t4JWWJbrilwBd7RJzKV8QW7tJkcgAmeuLLJugl5/w==}
+
resolution: {integrity: sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==}
engines: {node: '>= 0.4'}
@@ -8926,9 +8976,24 @@ packages:
resolution: {integrity: sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==}
+ resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==}
+
resolution: {integrity: sha512-WiCJLEECkO18gwqIp6+hJg0//p23HXp4S+gGtAKu3mI2F2/sXC4FvHvXvB0zJVVaTPhx1/tOwdbRsa1sOBIKqQ==}
+ resolution: {integrity: sha512-URZYihUbRPcGv95En+sz6MfghfIc2OJ1sv/RmhWZLouPY0/8Vo80viwPvg3dlaS9fuq7fQMEfgRRK7BBZThBEA==}
+ engines: {node: ^18.0.0 || >=20.0.0}
+
+ resolution: {integrity: sha512-weEDEq7Z5eTHPDh4xjX789+fHfF+P8boiFB+0vbWzpbnbsEr/GRaohi/uMKxg8RZMXnl1ItAi/IUHWMsjDV7kQ==}
+ engines: {node: '>=14.0.0'}
+
+ resolution: {integrity: sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==}
+ engines: {node: '>=14.0.0'}
+
resolution: {integrity: sha512-I/nkcBo73mO42Idfv08jhInV61IMb61OdIFxk+B4Gu1oBjWBPOLmhZdsli+oJCVaD+86pYQA93cJfFt224ZFAA==}
@@ -9283,6 +9348,11 @@ packages:
engines: {node: ^18.0.0 || >=20.0.0}
hasBin: true
+ resolution: {integrity: sha512-kqa9v+oi4HwkG6g8ufRnb5AeplcRw8jUF6/7/Qz1qRQOXHImG8YnLbB+LLszENwFnoBl9xIf9nVdCFzNd7GQEg==}
+ engines: {node: ^18.0.0 || >=20.0.0}
+ hasBin: true
+
resolution: {integrity: sha512-1hvaPshuPUtxeQ0hsVH3Mud0ZanOLwVTneA1EgbAM5LhaZEqyPWGRQ7BtaMvUrTDeEaC8pxtj6a6jku3x4z6SQ==}
engines: {node: ^18.0.0 || >=20.0.0}
@@ -9314,6 +9384,31 @@ packages:
terser:
optional: true
+ resolution: {integrity: sha512-eDjxbVAJw1UJJCHr5xr/xM86Zx+YxIEXGAR+bmnEID7z9qWfoxpHw0zdobz+TQAFOLT+nEXz3+gx6nUJ7RgmlQ==}
+ engines: {node: ^18.0.0 || >=20.0.0}
+ hasBin: true
+ peerDependencies:
+ '@edge-runtime/vm': '*'
+ '@types/node': ^18.0.0 || >=20.0.0
+ '@vitest/browser': 2.1.4
+ '@vitest/ui': 2.1.4
+ happy-dom: '*'
+ jsdom: '*'
+ peerDependenciesMeta:
+ '@edge-runtime/vm':
+ optional: true
+ '@types/node':
+ optional: true
+ '@vitest/browser':
+ optional: true
+ '@vitest/ui':
+ optional: true
+ happy-dom:
+ optional: true
+ jsdom:
+ optional: true
+
resolution: {integrity: sha512-VTyEYn3yvIeY1Py0WaYGZsXnz3y5UnGi62GjVEqvEGPl6nxbOrCXbVOTQWBEJUqAyTUk2uJ5JLVnYJ6ZzGbrSw==}
@@ -9396,6 +9491,11 @@ packages:
engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0}
hasBin: true
+ resolution: {integrity: sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==}
+ engines: {node: '>=8'}
+ hasBin: true
+
resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==}
engines: {node: '>=0.10.0'}
@@ -9446,18 +9546,6 @@ packages:
utf-8-validate:
optional: true
- resolution: {integrity: sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==}
- engines: {node: '>=10.0.0'}
- peerDependencies:
- bufferutil: ^4.0.1
- utf-8-validate: '>=5.0.2'
- peerDependenciesMeta:
- bufferutil:
- optional: true
- utf-8-validate:
- optional: true
-
resolution: {integrity: sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==}
engines: {node: '>=10.0.0'}
@@ -9612,7 +9700,7 @@ snapshots:
'@babel/traverse': 7.24.1
'@babel/types': 7.24.0
convert-source-map: 1.9.0
- debug: 4.3.6
+ debug: 4.3.7
gensync: 1.0.0-beta.2
json5: 2.2.3
semver: 6.3.1
@@ -9632,7 +9720,7 @@ snapshots:
'@babel/traverse': 7.24.5
'@babel/types': 7.24.7
convert-source-map: 2.0.0
- debug: 4.3.6
+ debug: 4.3.7
gensync: 1.0.0-beta.2
json5: 2.2.3
semver: 6.3.1
@@ -9652,7 +9740,7 @@ snapshots:
'@babel/traverse': 7.25.7
'@babel/types': 7.25.7
convert-source-map: 2.0.0
- debug: 4.3.6
+ debug: 4.3.7
gensync: 1.0.0-beta.2
json5: 2.2.3
semver: 6.3.1
@@ -10067,7 +10155,7 @@ snapshots:
'@babel/helper-split-export-declaration': 7.24.5
'@babel/parser': 7.24.5
'@babel/types': 7.24.7
- debug: 4.3.6
+ debug: 4.3.7
globals: 11.12.0
transitivePeerDependencies:
- supports-color
@@ -10082,7 +10170,7 @@ snapshots:
'@babel/helper-split-export-declaration': 7.22.6
'@babel/parser': 7.24.1
'@babel/types': 7.24.7
- debug: 4.3.6
+ debug: 4.3.7
globals: 11.12.0
transitivePeerDependencies:
- supports-color
@@ -10097,7 +10185,7 @@ snapshots:
'@babel/helper-split-export-declaration': 7.24.5
'@babel/parser': 7.24.5
'@babel/types': 7.24.7
- debug: 4.3.4
+ debug: 4.3.7
globals: 11.12.0
transitivePeerDependencies:
- supports-color
@@ -10109,7 +10197,7 @@ snapshots:
'@babel/parser': 7.25.7
'@babel/template': 7.25.7
'@babel/types': 7.25.7
- debug: 4.3.6
+ debug: 4.3.7
globals: 11.12.0
transitivePeerDependencies:
- supports-color
@@ -10701,7 +10789,7 @@ snapshots:
'@eslint/[email protected]':
dependencies:
'@eslint/object-schema': 2.1.4
- debug: 4.3.6
+ debug: 4.3.7
minimatch: 3.1.2
transitivePeerDependencies:
- supports-color
@@ -10711,7 +10799,7 @@ snapshots:
'@eslint/[email protected]':
dependencies:
ajv: 6.12.6
- debug: 4.3.6
+ debug: 4.3.7
espree: 10.2.0
globals: 14.0.0
ignore: 5.3.1
@@ -10979,6 +11067,8 @@ snapshots:
'@jridgewell/[email protected]': {}
+ '@jridgewell/[email protected]': {}
+
'@jridgewell/[email protected]':
dependencies:
'@jridgewell/resolve-uri': 3.1.0
@@ -12740,7 +12830,7 @@ snapshots:
'@typescript-eslint/types': 8.11.0
'@typescript-eslint/typescript-estree': 8.11.0([email protected])
'@typescript-eslint/visitor-keys': 8.11.0
- debug: 4.3.6
+ debug: 4.3.7
eslint: 9.13.0([email protected])
optionalDependencies:
typescript: 5.6.3
@@ -12756,7 +12846,7 @@ snapshots:
dependencies:
'@typescript-eslint/typescript-estree': 8.11.0([email protected])
'@typescript-eslint/utils': 8.11.0([email protected]([email protected]))([email protected])
- debug: 4.3.6
+ debug: 4.3.7
ts-api-utils: 1.3.0([email protected])
optionalDependencies:
typescript: 5.6.3
@@ -12770,7 +12860,7 @@ snapshots:
dependencies:
'@typescript-eslint/types': 8.11.0
'@typescript-eslint/visitor-keys': 8.11.0
- debug: 4.3.6
+ debug: 4.3.7
fast-glob: 3.3.2
is-glob: 4.0.3
minimatch: 9.0.4
@@ -12906,6 +12996,46 @@ snapshots:
transitivePeerDependencies:
- supports-color
+ '@vitest/[email protected]':
+ dependencies:
+ '@vitest/spy': 2.1.4
+ '@vitest/utils': 2.1.4
+ chai: 5.1.2
+ tinyrainbow: 1.2.0
+
+ dependencies:
+ '@vitest/spy': 2.1.4
+ estree-walker: 3.0.3
+ magic-string: 0.30.12
+ optionalDependencies:
+ vite: 5.4.10(@types/[email protected])
+
+ '@vitest/[email protected]':
+ dependencies:
+ tinyrainbow: 1.2.0
+
+ '@vitest/[email protected]':
+ dependencies:
+ '@vitest/utils': 2.1.4
+ pathe: 1.1.2
+
+ '@vitest/[email protected]':
+ dependencies:
+ '@vitest/pretty-format': 2.1.4
+ magic-string: 0.30.12
+ pathe: 1.1.2
+
+ '@vitest/[email protected]':
+ dependencies:
+ tinyspy: 3.0.2
+
+ '@vitest/[email protected]':
+ dependencies:
+ '@vitest/pretty-format': 2.1.4
+ loupe: 3.1.2
+ tinyrainbow: 1.2.0
+
dependencies:
'@babel/parser': 7.25.7
@@ -12927,7 +13057,7 @@ snapshots:
'@vue/reactivity-transform': 3.3.4
'@vue/shared': 3.3.4
estree-walker: 2.0.2
- magic-string: 0.30.10
+ magic-string: 0.30.12
postcss: 8.4.47
source-map-js: 1.2.1
@@ -12942,7 +13072,7 @@ snapshots:
'@vue/compiler-core': 3.3.4
'@vue/shared': 3.3.4
estree-walker: 2.0.2
- magic-string: 0.30.10
+ magic-string: 0.30.12
dependencies:
@@ -13002,7 +13132,7 @@ snapshots:
dependencies:
- debug: 4.3.6
+ debug: 4.3.7
transitivePeerDependencies:
- supports-color
@@ -13107,6 +13237,8 @@ snapshots:
dependencies:
printable-characters: 1.0.42
+
dependencies:
tslib: 2.6.2
@@ -13338,13 +13470,21 @@ snapshots:
dependencies:
- debug: 4.3.4
+ debug: 4.3.7
tslib: 2.6.2
transitivePeerDependencies:
- supports-color
+ dependencies:
+ assertion-error: 2.0.1
+ check-error: 2.1.1
+ deep-eql: 5.0.2
+ loupe: 3.1.2
+ pathval: 2.0.0
+
dependencies:
ansi-styles: 3.2.1
@@ -13370,6 +13510,8 @@ snapshots:
+
dependencies:
anymatch: 3.1.3
@@ -13434,7 +13576,7 @@ snapshots:
dependencies:
- '@jridgewell/sourcemap-codec': 1.4.15
+ '@jridgewell/sourcemap-codec': 1.5.0
'@types/estree': 1.0.6
acorn: 8.12.1
estree-walker: 3.0.3
@@ -13593,13 +13735,13 @@ snapshots:
dependencies:
ms: 2.0.0
dependencies:
ms: 2.1.2
dependencies:
- ms: 2.1.2
+ ms: 2.1.3
@@ -13611,6 +13753,8 @@ snapshots:
+
dependencies:
array-buffer-byte-length: 1.0.0
@@ -13805,7 +13949,7 @@ snapshots:
dependencies:
- debug: 4.3.6
+ debug: 4.3.7
esbuild: 0.24.0
transitivePeerDependencies:
- supports-color
@@ -14149,6 +14293,8 @@ snapshots:
+
dependencies:
'@jest/expect-utils': 29.7.0
@@ -14544,14 +14690,14 @@ snapshots:
dependencies:
'@tootallnate/once': 2.0.0
agent-base: 6.0.2
- debug: 4.3.4
+ debug: 4.3.7
transitivePeerDependencies:
- supports-color
dependencies:
agent-base: 6.0.2
- debug: 4.3.4
+ debug: 4.3.7
transitivePeerDependencies:
- supports-color
@@ -14809,7 +14955,7 @@ snapshots:
dependencies:
- debug: 4.3.6
+ debug: 4.3.7
istanbul-lib-coverage: 3.2.0
source-map: 0.6.1
transitivePeerDependencies:
@@ -15192,7 +15338,7 @@ snapshots:
whatwg-encoding: 2.0.0
whatwg-mimetype: 3.0.0
whatwg-url: 11.0.0
- ws: 8.16.0
+ ws: 8.18.0
xml-name-validator: 4.0.0
transitivePeerDependencies:
- bufferutil
@@ -15293,6 +15439,8 @@ snapshots:
dependencies:
js-tokens: 4.0.0
+
@@ -15319,6 +15467,10 @@ snapshots:
dependencies:
'@jridgewell/sourcemap-codec': 1.4.15
+ dependencies:
+ '@jridgewell/sourcemap-codec': 1.5.0
+
dependencies:
semver: 6.3.1
@@ -15943,7 +16095,7 @@ snapshots:
dependencies:
'@types/debug': 4.1.12
- debug: 4.3.6
+ debug: 4.3.7
decode-named-character-reference: 1.0.2
micromark-core-commonmark: 1.1.0
micromark-factory-space: 1.1.0
@@ -15965,7 +16117,7 @@ snapshots:
dependencies:
'@types/debug': 4.1.7
- debug: 4.3.4
+ debug: 4.3.7
decode-named-character-reference: 1.0.2
devlop: 1.1.0
micromark-core-commonmark: 2.0.1
@@ -16373,6 +16525,8 @@ snapshots:
+
dependencies:
buffer-from: 1.1.2
@@ -16866,7 +17020,7 @@ snapshots:
dependencies:
'@remix-run/server-runtime': 2.12.1([email protected])
- debug: 4.3.6
+ debug: 4.3.7
uuid: 9.0.1
transitivePeerDependencies:
@@ -16877,7 +17031,7 @@ snapshots:
'@oslojs/crypto': 0.6.2
'@oslojs/encoding': 0.4.1
'@oslojs/oauth2': 0.5.0
- debug: 4.3.6
+ debug: 4.3.7
optionalDependencies:
'@remix-run/cloudflare': 2.12.1(@cloudflare/[email protected])([email protected])
@@ -17081,6 +17235,8 @@ snapshots:
get-intrinsic: 1.2.1
object-inspect: 1.12.3
+
@@ -17162,6 +17318,8 @@ snapshots:
dependencies:
escape-string-regexp: 2.0.0
+
dependencies:
as-table: 1.0.55
@@ -17169,6 +17327,8 @@ snapshots:
+
dependencies:
internal-slot: 1.0.5
@@ -17280,7 +17440,7 @@ snapshots:
dependencies:
'@ampproject/remapping': 2.2.1
- '@jridgewell/sourcemap-codec': 1.4.15
+ '@jridgewell/sourcemap-codec': 1.5.0
'@jridgewell/trace-mapping': 0.3.25
acorn: 8.12.1
aria-query: 5.3.0
@@ -17290,7 +17450,7 @@ snapshots:
estree-walker: 3.0.3
is-reference: 3.0.1
locate-character: 3.0.0
- magic-string: 0.30.10
+ magic-string: 0.30.12
periscopic: 3.1.0
@@ -17395,8 +17555,16 @@ snapshots:
+
+
+
+
@@ -17758,7 +17926,7 @@ snapshots:
dependencies:
cac: 6.7.14
- debug: 4.3.6
+ debug: 4.3.7
pathe: 1.1.2
picocolors: 1.1.0
vite: 5.4.10(@types/[email protected])
@@ -17773,6 +17941,23 @@ snapshots:
- supports-color
- terser
+ dependencies:
+ cac: 6.7.14
+ debug: 4.3.7
+ pathe: 1.1.2
+ vite: 5.4.10(@types/[email protected])
+ transitivePeerDependencies:
+ - '@types/node'
+ - less
+ - lightningcss
+ - sass
+ - sass-embedded
+ - stylus
+ - sugarss
+ - supports-color
+ - terser
+
dependencies:
esbuild: 0.21.5
@@ -17782,6 +17967,42 @@ snapshots:
'@types/node': 22.8.1
fsevents: 2.3.3
+ dependencies:
+ '@vitest/expect': 2.1.4
+ '@vitest/mocker': 2.1.4([email protected](@types/[email protected]))
+ '@vitest/pretty-format': 2.1.4
+ '@vitest/runner': 2.1.4
+ '@vitest/snapshot': 2.1.4
+ '@vitest/spy': 2.1.4
+ '@vitest/utils': 2.1.4
+ chai: 5.1.2
+ debug: 4.3.7
+ expect-type: 1.1.0
+ magic-string: 0.30.12
+ pathe: 1.1.2
+ std-env: 3.8.0
+ tinybench: 2.9.0
+ tinyexec: 0.3.1
+ tinypool: 1.0.1
+ tinyrainbow: 1.2.0
+ vite: 5.4.10(@types/[email protected])
+ vite-node: 2.1.4(@types/[email protected])
+ why-is-node-running: 2.3.0
+ optionalDependencies:
+ '@types/node': 22.8.1
+ jsdom: 20.0.3
+ transitivePeerDependencies:
+ - less
+ - lightningcss
+ - msw
+ - sass
+ - sass-embedded
+ - stylus
+ - sugarss
+ - supports-color
+ - terser
+
dependencies:
'@vue/compiler-dom': 3.3.4
@@ -17873,6 +18094,11 @@ snapshots:
dependencies:
isexe: 2.0.0
+ dependencies:
+ siginfo: 2.0.0
+ stackback: 0.0.2
+
@@ -17935,8 +18161,6 @@ snapshots:
-
diff --git a/vite.config.ts b/vite.config.ts
new file mode 100644
index 0000000000..d52ba000d4
--- /dev/null
+++ b/vite.config.ts
@@ -0,0 +1,8 @@
+import { defineConfig } from "vite";
+
+export default defineConfig({
+ // resolve only webstudio condition in tests
+ resolve: {
+ conditions: ["webstudio"],
+ },
+});