Commit fdad4991 authored by David Sveningsson's avatar David Sveningsson
Browse files

Merge branch 'refactor/vitest-separate' into 'master'

refactor: fully detach vitest matchers from jest code

See merge request !1347
parents 306b81ac 2c6c7d1f
Loading
Loading
Loading
Loading
Loading
+13 −3
Original line number Diff line number Diff line
@@ -124,7 +124,17 @@ Jest:
        path: coverage/cobertura-coverage.xml
      junit: temp/jest.xml
  script:
    - npm test -- src/ tests/
    - npx jest -- --ci src/ tests/

Vitest:
  stage: test
  dependencies:
    - NPM
  needs:
    - NPM
  coverage: /Branches\s+:\s+([\d\.]+%)/
  script:
    - npx vitest

Prettier:
  stage: test
@@ -147,7 +157,7 @@ Docs:
    - npm run build
    - npm run docs
    - npm run htmlvalidate -- --formatter codeframe --config docs/htmlvalidate-public.json 'public/**/*.html'
    - npm test -- --no-coverage docs
    - npx jest -- --no-coverage docs
    - npm exec eslint docs/examples
    - git status
    - test -z "$(git status --porcelain)" || (echo 'working copy dirty, need to commit updated specs'; exit 1)
@@ -160,7 +170,7 @@ Docs:
    - npm ci --no-fund --no-audit --no-update-notifier
  script:
    - npm run --if-present build
    - npm test -- --no-coverage --ci --testPathIgnorePatterns matchers --workerThreads 1 --logHeapUsage -- src tests/jest
    - npx jest -- --no-coverage --ci --testPathIgnorePatterns matchers --workerThreads 1 --logHeapUsage -- src tests/jest
    - npm run -w tests/vitest test
    - npm run compatibility

+7 −0
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ import defaultConfig from "@html-validate/eslint-config";
import jestConfig from "@html-validate/eslint-config-jest";
import typescriptConfig from "@html-validate/eslint-config-typescript";
import typescriptTypeinfoConfig from "@html-validate/eslint-config-typescript-typeinfo";
import vitestConfig from "@html-validate/eslint-config-vitest";

export default [
	{
@@ -46,6 +47,12 @@ export default [
		...jestConfig,
	},

	{
		name: "@html-validate/eslint-config-vitest",
		files: ["**/*.vitest.[jt]s"],
		...vitestConfig,
	},

	{
		name: "local",
		rules: {
+1 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@ const { build } = require("esbuild");

module.exports = function setup() {
	return build({
		entryPoints: ["src/jest/worker/worker.ts"],
		entryPoints: ["src/jest/worker/jest-worker.ts"],
		bundle: true,
		format: "cjs",
		outfile: "temp/jest-worker.js",
+1 −1
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@ jest.mock(
);

jest.mock(
	"./src/jest/worker/worker.ts?worker&url",
	"./src/jest/worker/jest-worker.ts?worker&url",
	() => require.resolve("./temp/jest-worker.js"),
	{ virtual: true },
);
+64 −11
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@
        "@html-validate/eslint-config-jest": "9.1.1",
        "@html-validate/eslint-config-typescript": "9.1.1",
        "@html-validate/eslint-config-typescript-typeinfo": "9.1.1",
        "@html-validate/eslint-config-vitest": "9.1.1",
        "@html-validate/jest-config": "3.18.0",
        "@html-validate/prettier-config": "4.0.0",
        "@html-validate/release-scripts": "7.2.2",
@@ -93,6 +94,7 @@
      },
      "peerDependencies": {
        "@jest/globals": "^29.0.3 || ^30.0.0",
        "@vitest/expect": "^3.0.0 || ^4.0.1",
        "jest": "^29.0.3 || ^30.0.0",
        "jest-snapshot": "^29.0.3 || ^30.0.0",
        "vitest": "^3.0.0 || ^4.0.1"
@@ -101,6 +103,9 @@
        "@jest/globals": {
          "optional": true
        },
        "@vitest/expect": {
          "optional": true
        },
        "jest": {
          "optional": true
        },
@@ -2968,6 +2973,23 @@
        "eslint": "^10.0.0"
      }
    },
    "node_modules/@html-validate/eslint-config-vitest": {
      "version": "9.1.1",
      "resolved": "https://registry.npmjs.org/@html-validate/eslint-config-vitest/-/eslint-config-vitest-9.1.1.tgz",
      "integrity": "sha512-A5PQ5qXAY3uwFEDY3nWPmpcbmzcEgGao/bMH0y1Top3c/hxn0spZwISZa0a6QoT9NLyAgxU61TwOPZmKqdFIqQ==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "@vitest/eslint-plugin": "1.6.17"
      },
      "engines": {
        "node": "^22.16.0 || >= 24.0.0",
        "npm": ">= 7"
      },
      "peerDependencies": {
        "eslint": "^10.0.0"
      }
    },
    "node_modules/@html-validate/jest-config": {
      "version": "3.18.0",
      "resolved": "https://registry.npmjs.org/@html-validate/jest-config/-/jest-config-3.18.0.tgz",
@@ -5687,7 +5709,7 @@
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz",
      "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==",
      "dev": true,
      "devOptional": true,
      "license": "MIT"
    },
    "node_modules/@tsconfig/node-ts": {
@@ -5792,7 +5814,7 @@
      "version": "5.2.3",
      "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz",
      "integrity": "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==",
      "dev": true,
      "devOptional": true,
      "license": "MIT",
      "dependencies": {
        "@types/deep-eql": "*",
@@ -5810,7 +5832,7 @@
      "version": "4.0.2",
      "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz",
      "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==",
      "dev": true,
      "devOptional": true,
      "license": "MIT"
    },
    "node_modules/@types/esrecurse": {
@@ -6490,11 +6512,42 @@
        "win32"
      ]
    },
    "node_modules/@vitest/eslint-plugin": {
      "version": "1.6.17",
      "resolved": "https://registry.npmjs.org/@vitest/eslint-plugin/-/eslint-plugin-1.6.17.tgz",
      "integrity": "sha512-sIVY9ZeVcXyPxFCNRkIt8Yw4keKIcUyp9/8qnmuomPwE+ST1htw5sZsbqdUMTiah9SmCg1JYoK9RqdDtPeNYYg==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "@typescript-eslint/scope-manager": "^8.58.0",
        "@typescript-eslint/utils": "^8.58.0"
      },
      "engines": {
        "node": ">=18"
      },
      "peerDependencies": {
        "@typescript-eslint/eslint-plugin": "*",
        "eslint": ">=8.57.0",
        "typescript": ">=5.0.0",
        "vitest": "*"
      },
      "peerDependenciesMeta": {
        "@typescript-eslint/eslint-plugin": {
          "optional": true
        },
        "typescript": {
          "optional": true
        },
        "vitest": {
          "optional": true
        }
      }
    },
    "node_modules/@vitest/expect": {
      "version": "4.1.6",
      "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-4.1.6.tgz",
      "integrity": "sha512-7EHDquPthALSV0jhhjgEW8FXaviMx7rSqu8W6oqCoAuOhKov814P99QDV1pxMA3QPv21YudvJngIhjrNI4opLg==",
      "dev": true,
      "devOptional": true,
      "license": "MIT",
      "dependencies": {
        "@standard-schema/spec": "^1.1.0",
@@ -6549,7 +6602,7 @@
      "version": "4.1.6",
      "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-4.1.6.tgz",
      "integrity": "sha512-h5SxD/IzNhZYnrSZRsUZQIC+vD0GY8cUvq0iwsmkFKixRCKLLWqCXa/FIQ4S1R+sI+PGoojkHsdNrbZiM9Qpgw==",
      "dev": true,
      "devOptional": true,
      "license": "MIT",
      "dependencies": {
        "tinyrainbow": "^3.1.0"
@@ -6592,7 +6645,7 @@
      "version": "4.1.6",
      "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-4.1.6.tgz",
      "integrity": "sha512-JFKxMx6udhwKh/Ldo270e17QX710vgunMkuPAvXjHSvC6oqLWAHhVhjg/I71q0u0CBSErIODV1Kjv0FQNSWjdg==",
      "dev": true,
      "devOptional": true,
      "license": "MIT",
      "funding": {
        "url": "https://opencollective.com/vitest"
@@ -6602,7 +6655,7 @@
      "version": "4.1.6",
      "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-4.1.6.tgz",
      "integrity": "sha512-FxIY+U81R3LGKCxaHHFRQ5+g6/iRgGLmeHWdp2Amj4ljQRrEIWHmZyDfDYBRZlpyqA7qKxtS9DD1dhk8RnRIVQ==",
      "dev": true,
      "devOptional": true,
      "license": "MIT",
      "dependencies": {
        "@vitest/pretty-format": "4.1.6",
@@ -6871,7 +6924,7 @@
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz",
      "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==",
      "dev": true,
      "devOptional": true,
      "license": "MIT",
      "engines": {
        "node": ">=12"
@@ -7694,7 +7747,7 @@
      "version": "6.2.2",
      "resolved": "https://registry.npmjs.org/chai/-/chai-6.2.2.tgz",
      "integrity": "sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==",
      "dev": true,
      "devOptional": true,
      "license": "MIT",
      "engines": {
        "node": ">=18"
@@ -8131,7 +8184,7 @@
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz",
      "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==",
      "dev": true,
      "devOptional": true,
      "license": "MIT"
    },
    "node_modules/core-js-compat": {
@@ -16707,7 +16760,7 @@
      "version": "3.1.0",
      "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-3.1.0.tgz",
      "integrity": "sha512-Bf+ILmBgretUrdJxzXM0SgXLZ3XfiaUuOj/IKQHuTXip+05Xn+uyEYdVg0kYDipTBcLrCVyUzAPz7QmArb0mmw==",
      "dev": true,
      "devOptional": true,
      "license": "MIT",
      "engines": {
        "node": ">=14.0.0"
Loading