diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 47d4d5211..7aab447d2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,7 @@ jobs: strategy: fail-fast: false matrix: - node-version: [16, 18, 20] + node-version: [16, 18, 20.9.0] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 20125c6e4..d97c0d89a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -34,14 +34,10 @@ jobs: run: | yarn install --immutable --immutable-cache --check-cache - - name: "Set release version" - run: | - yarn workspaces foreach version ${{ github.event.inputs.releaseVersion }} - - name: "Commit release version and create tag" run: | git add -A - git commit -am "release ${{ github.event.inputs.releaseVersion }}" + git commit --allow-empty -am "release ${{ github.event.inputs.releaseVersion }}" git tag v${{ github.event.inputs.releaseVersion }} git push origin v${{ github.event.inputs.releaseVersion }} git push origin ${GITHUB_REF} diff --git a/.pnp.cjs b/.pnp.cjs index 63faf7f59..58eae93bd 100755 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -3696,23 +3696,23 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }]\ ]],\ ["@vitest/expect", [\ - ["npm:1.3.1", {\ - "packageLocation": "./.yarn/cache/@vitest-expect-npm-1.3.1-973071a540-3626b02f04.zip/node_modules/@vitest/expect/",\ + ["npm:1.4.0", {\ + "packageLocation": "./.yarn/cache/@vitest-expect-npm-1.4.0-b2e1e5e1f9-aca8b0b592.zip/node_modules/@vitest/expect/",\ "packageDependencies": [\ - ["@vitest/expect", "npm:1.3.1"],\ - ["@vitest/spy", "npm:1.3.1"],\ - ["@vitest/utils", "npm:1.3.1"],\ + ["@vitest/expect", "npm:1.4.0"],\ + ["@vitest/spy", "npm:1.4.0"],\ + ["@vitest/utils", "npm:1.4.0"],\ ["chai", "npm:4.4.1"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@vitest/runner", [\ - ["npm:1.3.1", {\ - "packageLocation": "./.yarn/cache/@vitest-runner-npm-1.3.1-944c525608-86dfb4d485.zip/node_modules/@vitest/runner/",\ + ["npm:1.4.0", {\ + "packageLocation": "./.yarn/cache/@vitest-runner-npm-1.4.0-837c5e79ed-41a847d1ba.zip/node_modules/@vitest/runner/",\ "packageDependencies": [\ - ["@vitest/runner", "npm:1.3.1"],\ - ["@vitest/utils", "npm:1.3.1"],\ + ["@vitest/runner", "npm:1.4.0"],\ + ["@vitest/utils", "npm:1.4.0"],\ ["p-limit", "npm:5.0.0"],\ ["pathe", "npm:1.1.2"]\ ],\ @@ -3729,23 +3729,33 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["pretty-format", "npm:29.7.0"]\ ],\ "linkType": "HARD"\ + }],\ + ["npm:1.4.0", {\ + "packageLocation": "./.yarn/cache/@vitest-snapshot-npm-1.4.0-92303161af-fe495661d6.zip/node_modules/@vitest/snapshot/",\ + "packageDependencies": [\ + ["@vitest/snapshot", "npm:1.4.0"],\ + ["magic-string", "npm:0.30.7"],\ + ["pathe", "npm:1.1.2"],\ + ["pretty-format", "npm:29.7.0"]\ + ],\ + "linkType": "HARD"\ }]\ ]],\ ["@vitest/spy", [\ - ["npm:1.3.1", {\ - "packageLocation": "./.yarn/cache/@vitest-spy-npm-1.3.1-6cf3de14ab-f52e4d2382.zip/node_modules/@vitest/spy/",\ + ["npm:1.4.0", {\ + "packageLocation": "./.yarn/cache/@vitest-spy-npm-1.4.0-477e8c3874-3b1c422760.zip/node_modules/@vitest/spy/",\ "packageDependencies": [\ - ["@vitest/spy", "npm:1.3.1"],\ + ["@vitest/spy", "npm:1.4.0"],\ ["tinyspy", "npm:2.2.1"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@vitest/utils", [\ - ["npm:1.3.1", {\ - "packageLocation": "./.yarn/cache/@vitest-utils-npm-1.3.1-9057d8d83a-dab1f66c22.zip/node_modules/@vitest/utils/",\ + ["npm:1.4.0", {\ + "packageLocation": "./.yarn/cache/@vitest-utils-npm-1.4.0-156b258a0b-5b54e36e5a.zip/node_modules/@vitest/utils/",\ "packageDependencies": [\ - ["@vitest/utils", "npm:1.3.1"],\ + ["@vitest/utils", "npm:1.4.0"],\ ["diff-sequences", "npm:29.6.3"],\ ["estree-walker", "npm:3.0.3"],\ ["loupe", "npm:2.3.7"],\ @@ -4297,19 +4307,17 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "packageLocation": "./packages/allure-cypress/",\ "packageDependencies": [\ ["allure-cypress", "workspace:packages/allure-cypress"],\ - ["@jest/globals", "npm:29.7.0"],\ ["@rollup/plugin-commonjs", "virtual:98c60b7d3b6c5117c4513c6cb8006cab39e0411be8ffe9bb791d9b6d0a1566b28587d5455e7567553092cbdbab928cfaf2a758f8f25f0e31ddedfee569ca964b#npm:25.0.7"],\ ["@rollup/plugin-node-resolve", "virtual:98c60b7d3b6c5117c4513c6cb8006cab39e0411be8ffe9bb791d9b6d0a1566b28587d5455e7567553092cbdbab928cfaf2a758f8f25f0e31ddedfee569ca964b#npm:15.2.3"],\ ["@rollup/plugin-typescript", "virtual:98c60b7d3b6c5117c4513c6cb8006cab39e0411be8ffe9bb791d9b6d0a1566b28587d5455e7567553092cbdbab928cfaf2a758f8f25f0e31ddedfee569ca964b#npm:11.1.6"],\ ["@types/eslint", "npm:8.56.3"],\ ["@types/glob", "npm:8.1.0"],\ - ["@types/jest", "npm:29.5.12"],\ ["@types/mocha", "npm:10.0.6"],\ ["@types/node", "npm:20.11.20"],\ ["@typescript-eslint/eslint-plugin", "virtual:a59b12f7fe7bf3b80fc61d73eaaa33af60483f6ce31789d384fbe8ef169791f667d2559ec5f2fbae1a273a658ce021f1f5f1ea0718c56f81b30ad4e95a5668dd#npm:6.21.0"],\ ["@typescript-eslint/parser", "virtual:a59b12f7fe7bf3b80fc61d73eaaa33af60483f6ce31789d384fbe8ef169791f667d2559ec5f2fbae1a273a658ce021f1f5f1ea0718c56f81b30ad4e95a5668dd#npm:6.21.0"],\ - ["allure-jest", "workspace:packages/allure-jest"],\ ["allure-js-commons", "workspace:packages/allure-js-commons"],\ + ["allure-vitest", "workspace:packages/allure-vitest"],\ ["cypress", "npm:13.6.6"],\ ["enquirer", "npm:2.4.1"],\ ["eslint", "npm:8.57.0"],\ @@ -4320,14 +4328,13 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["eslint-plugin-no-null", "virtual:a59b12f7fe7bf3b80fc61d73eaaa33af60483f6ce31789d384fbe8ef169791f667d2559ec5f2fbae1a273a658ce021f1f5f1ea0718c56f81b30ad4e95a5668dd#npm:1.0.2"],\ ["eslint-plugin-prefer-arrow", "virtual:a59b12f7fe7bf3b80fc61d73eaaa33af60483f6ce31789d384fbe8ef169791f667d2559ec5f2fbae1a273a658ce021f1f5f1ea0718c56f81b30ad4e95a5668dd#npm:1.2.3"],\ ["glob", "npm:10.3.10"],\ - ["jest", "virtual:f22a73b9c1f4f0e2e1c95f149ccb41c96491085e4b2ecd3061e554432306c4df6c2976f3c6ce3a6d62abead3ccc6cf04e88b4aebf1de7356583819351e2346e2#npm:29.7.0"],\ - ["npm-run-all", "npm:4.1.5"],\ + ["npm-run-all2", "npm:5.0.2"],\ ["rimraf", "npm:5.0.5"],\ ["rollup", "npm:4.13.0"],\ - ["ts-jest", "virtual:98c60b7d3b6c5117c4513c6cb8006cab39e0411be8ffe9bb791d9b6d0a1566b28587d5455e7567553092cbdbab928cfaf2a758f8f25f0e31ddedfee569ca964b#npm:29.1.2"],\ ["ts-node", "virtual:3c6c31eedba60f6d4a0031098f0272720e7414162569ae8f58388d36f8e79683154a59f38a8e5aece9f0d5e45421fab86d5311a37a1c1aec338de3c79151496a#npm:10.9.2"],\ ["tslib", "npm:2.6.2"],\ - ["typescript", "patch:typescript@npm%3A5.3.3#~builtin::version=5.3.3&hash=e012d7"]\ + ["typescript", "patch:typescript@npm%3A5.3.3#~builtin::version=5.3.3&hash=e012d7"],\ + ["vitest", "virtual:f37ad3099f3665d5bbc9ee71081416c8874087a5d9739472f56367e210ca9246356f462b31407a28e510bc022801edd4632f86364db715287d62bd50b42e2c00#npm:1.4.0"]\ ],\ "linkType": "SOFT"\ }]\ @@ -4623,7 +4630,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["rimraf", "npm:5.0.5"],\ ["typescript", "patch:typescript@npm%3A5.3.3#~builtin::version=5.3.3&hash=e012d7"],\ ["vite", "virtual:f37ad3099f3665d5bbc9ee71081416c8874087a5d9739472f56367e210ca9246356f462b31407a28e510bc022801edd4632f86364db715287d62bd50b42e2c00#npm:5.1.4"],\ - ["vitest", "virtual:f37ad3099f3665d5bbc9ee71081416c8874087a5d9739472f56367e210ca9246356f462b31407a28e510bc022801edd4632f86364db715287d62bd50b42e2c00#npm:1.3.1"]\ + ["vitest", "virtual:f37ad3099f3665d5bbc9ee71081416c8874087a5d9739472f56367e210ca9246356f462b31407a28e510bc022801edd4632f86364db715287d62bd50b42e2c00#npm:1.4.0"]\ ],\ "linkType": "SOFT"\ }]\ @@ -14561,6 +14568,22 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["npm-run-all2", [\ + ["npm:5.0.2", {\ + "packageLocation": "./.yarn/cache/npm-run-all2-npm-5.0.2-26599fa7da-c52091478d.zip/node_modules/npm-run-all2/",\ + "packageDependencies": [\ + ["npm-run-all2", "npm:5.0.2"],\ + ["ansi-styles", "npm:5.2.0"],\ + ["cross-spawn", "npm:7.0.3"],\ + ["memorystream", "npm:0.3.1"],\ + ["minimatch", "npm:3.1.2"],\ + ["pidtree", "npm:0.5.0"],\ + ["read-pkg", "npm:5.2.0"],\ + ["shell-quote", "npm:1.8.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["npm-run-path", [\ ["npm:4.0.1", {\ "packageLocation": "./.yarn/cache/npm-run-path-npm-4.0.1-7aebd8bab3-5374c0cea4.zip/node_modules/npm-run-path/",\ @@ -15413,6 +15436,13 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ],\ "linkType": "HARD"\ }],\ + ["npm:0.5.0", {\ + "packageLocation": "./.yarn/cache/pidtree-npm-0.5.0-ed08283e89-371cd14bbc.zip/node_modules/pidtree/",\ + "packageDependencies": [\ + ["pidtree", "npm:0.5.0"]\ + ],\ + "linkType": "HARD"\ + }],\ ["npm:0.6.0", {\ "packageLocation": "./.yarn/cache/pidtree-npm-0.6.0-3d92e16117-8fbc073ede.zip/node_modules/pidtree/",\ "packageDependencies": [\ @@ -16292,6 +16322,17 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ],\ "linkType": "HARD"\ }],\ + ["npm:5.2.0", {\ + "packageLocation": "./.yarn/cache/read-pkg-npm-5.2.0-50426bd8dc-eb696e6052.zip/node_modules/read-pkg/",\ + "packageDependencies": [\ + ["read-pkg", "npm:5.2.0"],\ + ["@types/normalize-package-data", "npm:2.4.4"],\ + ["normalize-package-data", "npm:2.5.0"],\ + ["parse-json", "npm:5.2.0"],\ + ["type-fest", "npm:0.6.0"]\ + ],\ + "linkType": "HARD"\ + }],\ ["npm:8.1.0", {\ "packageLocation": "./.yarn/cache/read-pkg-npm-8.1.0-05761f7fd1-f4cd164f09.zip/node_modules/read-pkg/",\ "packageDependencies": [\ @@ -18533,47 +18574,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ],\ "linkType": "SOFT"\ }],\ - ["virtual:98c60b7d3b6c5117c4513c6cb8006cab39e0411be8ffe9bb791d9b6d0a1566b28587d5455e7567553092cbdbab928cfaf2a758f8f25f0e31ddedfee569ca964b#npm:29.1.2", {\ - "packageLocation": "./.yarn/__virtual__/ts-jest-virtual-12c1a4e707/0/cache/ts-jest-npm-29.1.2-22ab85b861-a0ce0affc1.zip/node_modules/ts-jest/",\ - "packageDependencies": [\ - ["ts-jest", "virtual:98c60b7d3b6c5117c4513c6cb8006cab39e0411be8ffe9bb791d9b6d0a1566b28587d5455e7567553092cbdbab928cfaf2a758f8f25f0e31ddedfee569ca964b#npm:29.1.2"],\ - ["@babel/core", null],\ - ["@jest/types", null],\ - ["@types/babel-jest", null],\ - ["@types/babel__core", null],\ - ["@types/esbuild", null],\ - ["@types/jest", "npm:29.5.12"],\ - ["@types/jest__types", null],\ - ["@types/typescript", null],\ - ["babel-jest", null],\ - ["bs-logger", "npm:0.2.6"],\ - ["esbuild", null],\ - ["fast-json-stable-stringify", "npm:2.1.0"],\ - ["jest", "virtual:f22a73b9c1f4f0e2e1c95f149ccb41c96491085e4b2ecd3061e554432306c4df6c2976f3c6ce3a6d62abead3ccc6cf04e88b4aebf1de7356583819351e2346e2#npm:29.7.0"],\ - ["jest-util", "npm:29.7.0"],\ - ["json5", "npm:2.2.3"],\ - ["lodash.memoize", "npm:4.1.2"],\ - ["make-error", "npm:1.3.6"],\ - ["semver", "npm:7.6.0"],\ - ["typescript", "patch:typescript@npm%3A5.3.3#~builtin::version=5.3.3&hash=e012d7"],\ - ["yargs-parser", "npm:21.1.1"]\ - ],\ - "packagePeers": [\ - "@babel/core",\ - "@jest/types",\ - "@types/babel-jest",\ - "@types/babel__core",\ - "@types/esbuild",\ - "@types/jest",\ - "@types/jest__types",\ - "@types/typescript",\ - "babel-jest",\ - "esbuild",\ - "jest",\ - "typescript"\ - ],\ - "linkType": "HARD"\ - }],\ ["virtual:f22a73b9c1f4f0e2e1c95f149ccb41c96491085e4b2ecd3061e554432306c4df6c2976f3c6ce3a6d62abead3ccc6cf04e88b4aebf1de7356583819351e2346e2#npm:29.1.2", {\ "packageLocation": "./.yarn/__virtual__/ts-jest-virtual-03a80283ed/0/cache/ts-jest-npm-29.1.2-22ab85b861-a0ce0affc1.zip/node_modules/ts-jest/",\ "packageDependencies": [\ @@ -18805,6 +18805,13 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ],\ "linkType": "HARD"\ }],\ + ["npm:0.6.0", {\ + "packageLocation": "./.yarn/cache/type-fest-npm-0.6.0-76b229965b-b2188e6e4b.zip/node_modules/type-fest/",\ + "packageDependencies": [\ + ["type-fest", "npm:0.6.0"]\ + ],\ + "linkType": "HARD"\ + }],\ ["npm:2.13.0", {\ "packageLocation": "./.yarn/cache/type-fest-npm-2.13.0-dc5d69f23c-3492384f75.zip/node_modules/type-fest/",\ "packageDependencies": [\ @@ -19400,10 +19407,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ],\ "linkType": "SOFT"\ }],\ - ["virtual:d8d3f8afc1af82234d28ba17d4b19a0f6ab025fa332bb964422c533d39162ef49e8e94b84a106a2236a3f9ca59d41250b7ef919ed5b1ddd1e5bfb5ae24a5291f#npm:5.1.4", {\ - "packageLocation": "./.yarn/__virtual__/vite-virtual-4e0d94cdb4/0/cache/vite-npm-5.1.4-330f2f209c-fb8b944c69.zip/node_modules/vite/",\ + ["virtual:209e0aec1ba389316de2c518b3bc888a3270710a469cf1ab3bb7a65335a4e787ef6a1c8d6b11b0c20b3fc71192f33c343379bf658c393073601d24c0d6666db9#npm:5.1.4", {\ + "packageLocation": "./.yarn/__virtual__/vite-virtual-53042d1c47/0/cache/vite-npm-5.1.4-330f2f209c-fb8b944c69.zip/node_modules/vite/",\ "packageDependencies": [\ - ["vite", "virtual:d8d3f8afc1af82234d28ba17d4b19a0f6ab025fa332bb964422c533d39162ef49e8e94b84a106a2236a3f9ca59d41250b7ef919ed5b1ddd1e5bfb5ae24a5291f#npm:5.1.4"],\ + ["vite", "virtual:209e0aec1ba389316de2c518b3bc888a3270710a469cf1ab3bb7a65335a4e787ef6a1c8d6b11b0c20b3fc71192f33c343379bf658c393073601d24c0d6666db9#npm:5.1.4"],\ ["@types/less", null],\ ["@types/lightningcss", null],\ ["@types/node", null],\ @@ -19480,31 +19487,31 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }]\ ]],\ ["vite-node", [\ - ["npm:1.3.1", {\ - "packageLocation": "./.yarn/cache/vite-node-npm-1.3.1-d8d3f8afc1-62a0bd2cdb.zip/node_modules/vite-node/",\ + ["npm:1.4.0", {\ + "packageLocation": "./.yarn/cache/vite-node-npm-1.4.0-209e0aec1b-1abbeac935.zip/node_modules/vite-node/",\ "packageDependencies": [\ - ["vite-node", "npm:1.3.1"],\ + ["vite-node", "npm:1.4.0"],\ ["cac", "npm:6.7.14"],\ ["debug", "virtual:1ff4b5f90832ba0a9c93ba1223af226e44ba70c1126a3740d93562b97bc36544e896a5e95908196f7458713e6a6089a34bfc67362fc6df7fa093bd06c878be47#npm:4.3.4"],\ ["pathe", "npm:1.1.2"],\ ["picocolors", "npm:1.0.0"],\ - ["vite", "virtual:d8d3f8afc1af82234d28ba17d4b19a0f6ab025fa332bb964422c533d39162ef49e8e94b84a106a2236a3f9ca59d41250b7ef919ed5b1ddd1e5bfb5ae24a5291f#npm:5.1.4"]\ + ["vite", "virtual:209e0aec1ba389316de2c518b3bc888a3270710a469cf1ab3bb7a65335a4e787ef6a1c8d6b11b0c20b3fc71192f33c343379bf658c393073601d24c0d6666db9#npm:5.1.4"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["vitest", [\ - ["npm:1.3.1", {\ - "packageLocation": "./.yarn/cache/vitest-npm-1.3.1-f654c79bcc-6f760296d8.zip/node_modules/vitest/",\ + ["npm:1.4.0", {\ + "packageLocation": "./.yarn/cache/vitest-npm-1.4.0-465b7cb84c-e7141c0ecc.zip/node_modules/vitest/",\ "packageDependencies": [\ - ["vitest", "npm:1.3.1"]\ + ["vitest", "npm:1.4.0"]\ ],\ "linkType": "SOFT"\ }],\ - ["virtual:f37ad3099f3665d5bbc9ee71081416c8874087a5d9739472f56367e210ca9246356f462b31407a28e510bc022801edd4632f86364db715287d62bd50b42e2c00#npm:1.3.1", {\ - "packageLocation": "./.yarn/__virtual__/vitest-virtual-5e536b2e52/0/cache/vitest-npm-1.3.1-f654c79bcc-6f760296d8.zip/node_modules/vitest/",\ + ["virtual:f37ad3099f3665d5bbc9ee71081416c8874087a5d9739472f56367e210ca9246356f462b31407a28e510bc022801edd4632f86364db715287d62bd50b42e2c00#npm:1.4.0", {\ + "packageLocation": "./.yarn/__virtual__/vitest-virtual-e3e7286675/0/cache/vitest-npm-1.4.0-465b7cb84c-e7141c0ecc.zip/node_modules/vitest/",\ "packageDependencies": [\ - ["vitest", "virtual:f37ad3099f3665d5bbc9ee71081416c8874087a5d9739472f56367e210ca9246356f462b31407a28e510bc022801edd4632f86364db715287d62bd50b42e2c00#npm:1.3.1"],\ + ["vitest", "virtual:f37ad3099f3665d5bbc9ee71081416c8874087a5d9739472f56367e210ca9246356f462b31407a28e510bc022801edd4632f86364db715287d62bd50b42e2c00#npm:1.4.0"],\ ["@edge-runtime/vm", null],\ ["@types/edge-runtime__vm", null],\ ["@types/happy-dom", null],\ @@ -19513,12 +19520,12 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@types/vitest__browser", null],\ ["@types/vitest__ui", null],\ ["@vitest/browser", null],\ - ["@vitest/expect", "npm:1.3.1"],\ - ["@vitest/runner", "npm:1.3.1"],\ - ["@vitest/snapshot", "npm:1.3.1"],\ - ["@vitest/spy", "npm:1.3.1"],\ + ["@vitest/expect", "npm:1.4.0"],\ + ["@vitest/runner", "npm:1.4.0"],\ + ["@vitest/snapshot", "npm:1.4.0"],\ + ["@vitest/spy", "npm:1.4.0"],\ ["@vitest/ui", null],\ - ["@vitest/utils", "npm:1.3.1"],\ + ["@vitest/utils", "npm:1.4.0"],\ ["acorn-walk", "npm:8.3.2"],\ ["chai", "npm:4.4.1"],\ ["debug", "virtual:1ff4b5f90832ba0a9c93ba1223af226e44ba70c1126a3740d93562b97bc36544e896a5e95908196f7458713e6a6089a34bfc67362fc6df7fa093bd06c878be47#npm:4.3.4"],\ @@ -19534,7 +19541,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["tinybench", "npm:2.6.0"],\ ["tinypool", "npm:0.8.2"],\ ["vite", "virtual:f37ad3099f3665d5bbc9ee71081416c8874087a5d9739472f56367e210ca9246356f462b31407a28e510bc022801edd4632f86364db715287d62bd50b42e2c00#npm:5.1.4"],\ - ["vite-node", "npm:1.3.1"],\ + ["vite-node", "npm:1.4.0"],\ ["why-is-node-running", "npm:2.2.2"]\ ],\ "packagePeers": [\ diff --git a/.yarn/cache/@vitest-expect-npm-1.3.1-973071a540-3626b02f04.zip b/.yarn/cache/@vitest-expect-npm-1.3.1-973071a540-3626b02f04.zip deleted file mode 100644 index ad71ad90d..000000000 Binary files a/.yarn/cache/@vitest-expect-npm-1.3.1-973071a540-3626b02f04.zip and /dev/null differ diff --git a/.yarn/cache/@vitest-expect-npm-1.4.0-b2e1e5e1f9-aca8b0b592.zip b/.yarn/cache/@vitest-expect-npm-1.4.0-b2e1e5e1f9-aca8b0b592.zip new file mode 100644 index 000000000..85dce885f Binary files /dev/null and b/.yarn/cache/@vitest-expect-npm-1.4.0-b2e1e5e1f9-aca8b0b592.zip differ diff --git a/.yarn/cache/@vitest-runner-npm-1.3.1-944c525608-86dfb4d485.zip b/.yarn/cache/@vitest-runner-npm-1.3.1-944c525608-86dfb4d485.zip deleted file mode 100644 index c9e6037e0..000000000 Binary files a/.yarn/cache/@vitest-runner-npm-1.3.1-944c525608-86dfb4d485.zip and /dev/null differ diff --git a/.yarn/cache/@vitest-runner-npm-1.4.0-837c5e79ed-41a847d1ba.zip b/.yarn/cache/@vitest-runner-npm-1.4.0-837c5e79ed-41a847d1ba.zip new file mode 100644 index 000000000..c29942100 Binary files /dev/null and b/.yarn/cache/@vitest-runner-npm-1.4.0-837c5e79ed-41a847d1ba.zip differ diff --git a/.yarn/cache/@vitest-snapshot-npm-1.4.0-92303161af-fe495661d6.zip b/.yarn/cache/@vitest-snapshot-npm-1.4.0-92303161af-fe495661d6.zip new file mode 100644 index 000000000..b4f5762d8 Binary files /dev/null and b/.yarn/cache/@vitest-snapshot-npm-1.4.0-92303161af-fe495661d6.zip differ diff --git a/.yarn/cache/@vitest-spy-npm-1.3.1-6cf3de14ab-f52e4d2382.zip b/.yarn/cache/@vitest-spy-npm-1.4.0-477e8c3874-3b1c422760.zip similarity index 81% rename from .yarn/cache/@vitest-spy-npm-1.3.1-6cf3de14ab-f52e4d2382.zip rename to .yarn/cache/@vitest-spy-npm-1.4.0-477e8c3874-3b1c422760.zip index 1e86d9ee9..4dbc59a50 100644 Binary files a/.yarn/cache/@vitest-spy-npm-1.3.1-6cf3de14ab-f52e4d2382.zip and b/.yarn/cache/@vitest-spy-npm-1.4.0-477e8c3874-3b1c422760.zip differ diff --git a/.yarn/cache/@vitest-utils-npm-1.3.1-9057d8d83a-dab1f66c22.zip b/.yarn/cache/@vitest-utils-npm-1.4.0-156b258a0b-5b54e36e5a.zip similarity index 97% rename from .yarn/cache/@vitest-utils-npm-1.3.1-9057d8d83a-dab1f66c22.zip rename to .yarn/cache/@vitest-utils-npm-1.4.0-156b258a0b-5b54e36e5a.zip index d5138bf36..d780f500e 100644 Binary files a/.yarn/cache/@vitest-utils-npm-1.3.1-9057d8d83a-dab1f66c22.zip and b/.yarn/cache/@vitest-utils-npm-1.4.0-156b258a0b-5b54e36e5a.zip differ diff --git a/.yarn/cache/npm-run-all2-npm-5.0.2-26599fa7da-c52091478d.zip b/.yarn/cache/npm-run-all2-npm-5.0.2-26599fa7da-c52091478d.zip new file mode 100644 index 000000000..6e5dc0c2c Binary files /dev/null and b/.yarn/cache/npm-run-all2-npm-5.0.2-26599fa7da-c52091478d.zip differ diff --git a/.yarn/cache/pidtree-npm-0.5.0-ed08283e89-371cd14bbc.zip b/.yarn/cache/pidtree-npm-0.5.0-ed08283e89-371cd14bbc.zip new file mode 100644 index 000000000..9c767dd6d Binary files /dev/null and b/.yarn/cache/pidtree-npm-0.5.0-ed08283e89-371cd14bbc.zip differ diff --git a/.yarn/cache/read-pkg-npm-5.2.0-50426bd8dc-eb696e6052.zip b/.yarn/cache/read-pkg-npm-5.2.0-50426bd8dc-eb696e6052.zip new file mode 100644 index 000000000..9749e742a Binary files /dev/null and b/.yarn/cache/read-pkg-npm-5.2.0-50426bd8dc-eb696e6052.zip differ diff --git a/.yarn/cache/type-fest-npm-0.6.0-76b229965b-b2188e6e4b.zip b/.yarn/cache/type-fest-npm-0.6.0-76b229965b-b2188e6e4b.zip new file mode 100644 index 000000000..0456ef6d7 Binary files /dev/null and b/.yarn/cache/type-fest-npm-0.6.0-76b229965b-b2188e6e4b.zip differ diff --git a/.yarn/cache/vite-node-npm-1.3.1-d8d3f8afc1-62a0bd2cdb.zip b/.yarn/cache/vite-node-npm-1.4.0-209e0aec1b-1abbeac935.zip similarity index 60% rename from .yarn/cache/vite-node-npm-1.3.1-d8d3f8afc1-62a0bd2cdb.zip rename to .yarn/cache/vite-node-npm-1.4.0-209e0aec1b-1abbeac935.zip index 5ca6ea822..1c15c9f9c 100644 Binary files a/.yarn/cache/vite-node-npm-1.3.1-d8d3f8afc1-62a0bd2cdb.zip and b/.yarn/cache/vite-node-npm-1.4.0-209e0aec1b-1abbeac935.zip differ diff --git a/.yarn/cache/vitest-npm-1.3.1-f654c79bcc-6f760296d8.zip b/.yarn/cache/vitest-npm-1.3.1-f654c79bcc-6f760296d8.zip deleted file mode 100644 index 62d623295..000000000 Binary files a/.yarn/cache/vitest-npm-1.3.1-f654c79bcc-6f760296d8.zip and /dev/null differ diff --git a/.yarn/cache/vitest-npm-1.4.0-465b7cb84c-e7141c0ecc.zip b/.yarn/cache/vitest-npm-1.4.0-465b7cb84c-e7141c0ecc.zip new file mode 100644 index 000000000..6fb3e7c61 Binary files /dev/null and b/.yarn/cache/vitest-npm-1.4.0-465b7cb84c-e7141c0ecc.zip differ diff --git a/.yarn/versions/5bf69b03.yml b/.yarn/versions/5bf69b03.yml new file mode 100644 index 000000000..d1d3376af --- /dev/null +++ b/.yarn/versions/5bf69b03.yml @@ -0,0 +1,13 @@ +undecided: + - allure-js + - allure-codeceptjs + - allure-cucumberjs + - allure-cypress + - allure-decorators + - allure-jasmine + - allure-jest + - allure-js-commons + - allure-mocha + - allure-playwright + - allure-vitest + - hermione-allure diff --git a/package.json b/package.json index 9f876ce3d..d3abacdf6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "allure-js", - "version": "2.15.0", + "version": "2.15.1", "private": true, "workspaces": [ "packages/*" diff --git a/packages/allure-codeceptjs/package.json b/packages/allure-codeceptjs/package.json index c8f4578d0..6c6ec0cf7 100644 --- a/packages/allure-codeceptjs/package.json +++ b/packages/allure-codeceptjs/package.json @@ -1,6 +1,6 @@ { "name": "allure-codeceptjs", - "version": "2.15.0", + "version": "2.15.1", "description": "Allure codeceptjs integration", "keywords": [ "codeceptjs", diff --git a/packages/allure-cucumberjs/package.json b/packages/allure-cucumberjs/package.json index 9e27b4347..0613645c4 100644 --- a/packages/allure-cucumberjs/package.json +++ b/packages/allure-cucumberjs/package.json @@ -1,6 +1,6 @@ { "name": "allure-cucumberjs", - "version": "2.15.0", + "version": "2.15.1", "description": "Allure Cucumber.JS integration", "homepage": "https://allurereport.org/", "repository": { diff --git a/packages/allure-cypress/.gitignore b/packages/allure-cypress/.gitignore index 63d1828c7..8be5c353a 100644 --- a/packages/allure-cypress/.gitignore +++ b/packages/allure-cypress/.gitignore @@ -1 +1 @@ -cypress/screenshots/ +test/fixtures/ diff --git a/packages/allure-cypress/README.md b/packages/allure-cypress/README.md index 74596add1..ba58f4549 100644 --- a/packages/allure-cypress/README.md +++ b/packages/allure-cypress/README.md @@ -85,7 +85,7 @@ module.exports = { // ... e2e: { setupNodeEvents: (on, config) => { - allureCypress(on, { + const reporter = allureCypress(on, { + links: [ + { + type: "issue", @@ -102,6 +102,10 @@ module.exports = { + ], + }); + on("after:spec", (spec, result) => { + reporter.endSpec(spec, result); + }); + return config; }, }, @@ -156,3 +160,30 @@ it("test with strangeLabel @allure.label.strangeLabel=strangeValue", () => {}); > **Warning** > Note that changing title can cause creating new testcases in history. > To fix this please add `@allure.id={yourTestCaseId}` to the test name if you passing allure metadata from test title + +## Using custom `after:spec` hook + +If you want to use your own `after:spec` hook and keep the Allure reporter working, you should use `AllureCypress` class instead: + +```diff +const { AllureCypress } = require("allure-cypress/reporter"); + +module.exports = { + // ... + e2e: { + setupNodeEvents: (on, config) => { ++ const allureCypress = new AllureCypress({ ++ resultsDir: "./allure-results", ++ }); ++ ++ allureCypress.attachToCypress(on, config); ++ ++ on("after:spec", (spec, result) => { ++ allureCypress.endSpec(spec, result); ++ }); ++ ++ return config; ++ }, + }, +}; +``` diff --git a/packages/allure-cypress/cypress.config.js b/packages/allure-cypress/cypress.config.js deleted file mode 100644 index f2c6e042e..000000000 --- a/packages/allure-cypress/cypress.config.js +++ /dev/null @@ -1,78 +0,0 @@ -const { readFileSync, rmSync, existsSync } = require("node:fs"); -const { join, relative } = require("node:path"); -const { globSync } = require("glob"); -const { allureCypress } = require("allure-cypress/reporter"); - -module.exports = { - experimentalInteractiveRunEvents: true, - e2e: { - baseUrl: "https://allurereport.org", - viewportWidth: 1240, - video: false, - setupNodeEvents: (on, config) => { - allureCypress(on, { - links: [ - { - type: "issue", - urlTemplate: "https://allurereport.org/issues/%s" - }, - { - type: "tms", - urlTemplate: "https://allurereport.org/tasks/%s" - }, - ] - }); - - on("task", { - readFile: ({ path, encoding }) => { - const file = readFileSync(path, encoding); - - return file - }, - readLastTestResult: () => { - const result = { - tests: [], - groups: [], - attachments: {}, - }; - const rawTests = globSync([join(__dirname, "./allure-results/*-result.json")]); - const rawGroups = globSync([join(__dirname, "./allure-results/*-container.json")]); - const attachments = globSync([join(__dirname, "./allure-results/*-attachment.*")]); - const specFiles = [].concat(rawTests, rawGroups, attachments); - const tests = rawTests.map((item) => { - const test = readFileSync(item, "utf8"); - - return JSON.parse(test); - }); - const groups = rawGroups.map((item) => { - const group = readFileSync(item, "utf8"); - - return JSON.parse(group); - }); - - tests.forEach((item) => { - result.tests.push(item); - }); - groups.forEach((item) => { - result.groups.push(item); - }); - attachments.forEach((item) => { - const attachmentPath = relative(join(__dirname, "./allure-results"), item); - const attachmentContent = readFileSync(item, "base64"); - - result.attachments[attachmentPath] = attachmentContent; - }); - - - specFiles.forEach((item) => { - rmSync(item); - }); - - return result; - }, - }); - - return config; - }, - }, -}; diff --git a/packages/allure-cypress/cypress/e2e/attachments.cy.js b/packages/allure-cypress/cypress/e2e/attachments.cy.js deleted file mode 100644 index f2f6088eb..000000000 --- a/packages/allure-cypress/cypress/e2e/attachments.cy.js +++ /dev/null @@ -1,139 +0,0 @@ -import { attachment } from "allure-cypress" - -describe("primitive data", () => { - describe("text", () => { - after(() => { - cy.task("readLastTestResult").then((result) => { - cy.wrap(result.tests).as("tests"); - - cy.get("@tests").should("have.length", 1); - cy.wrap(Object.keys(result.attachments)).its(0).then((attachment) => { - cy.get("@tests").its(0).containsAttachment({ - name: "foo", - source: attachment, - type: "text/plain", - }); - }); - }); - }); - - it("text", () => { - attachment("foo", "bar", "text/plain") - }); - }) - - describe("json", () => { - after(() => { - cy.task("readLastTestResult").then((result) => { - cy.wrap(result.tests).as("tests"); - - cy.get("@tests").should("have.length", 1); - cy.wrap(Object.keys(result.attachments)).its(0).then((attachment) => { - cy.get("@tests").its(0).containsAttachment({ - name: "foo", - source: attachment, - type: "application/json", - }); - }); - }); - }); - - it("json", () => { - attachment("foo", JSON.stringify({ foo: "bar" }), "application/json") - }); - }) -}) - -describe("data from node", () => { - describe("buffer", () => { - after(() => { - cy.task("readLastTestResult").then((result) => { - cy.wrap(result.tests).as("tests"); - - cy.get("@tests").should("have.length", 1); - cy.wrap(Object.keys(result.attachments)).its(0).then((attachment) => { - cy.get("@tests").its(0).containsAttachment({ - name: "foo", - source: attachment, - type: "application/json", - }); - }); - }); - }); - - it("json", () => { - cy.task("readFile", { path: "package.json" }).then((content) => { - attachment("foo", content, "application/json") - }) - }); - }) - - describe("utf8 string", () => { - after(() => { - cy.task("readLastTestResult").then((result) => { - cy.wrap(result.tests).as("tests"); - - cy.get("@tests").should("have.length", 1); - cy.wrap(Object.keys(result.attachments)).its(0).then((attachment) => { - cy.get("@tests").its(0).containsAttachment({ - name: "foo", - source: attachment, - type: "application/json", - }); - }); - }); - }); - - it("json", () => { - cy.task("readFile", { path: "package.json", encoding: "utf8" }).then((content) => { - attachment("foo", JSON.stringify(content, null, 2), "application/json", "utf8") - }) - }); - }) - - describe("base64 string", () => { - after(() => { - cy.task("readLastTestResult").then((result) => { - cy.wrap(result.tests).as("tests"); - - cy.get("@tests").should("have.length", 1); - cy.wrap(Object.keys(result.attachments)).its(0).then((attachment) => { - cy.get("@tests").its(0).containsAttachment({ - name: "foo", - source: attachment, - type: "application/json", - }); - }); - }); - }); - - it("json", () => { - cy.task("readFile", { path: "package.json", encoding: "base64" }).then((content) => { - attachment("foo", content, "application/json", "base64") - }) - }); - }) -}) - -describe("cypress read file", () => { - after(() => { - cy.task("readLastTestResult").then((result) => { - cy.wrap(result.tests).as("tests"); - - cy.get("@tests").should("have.length", 1); - cy.wrap(Object.keys(result.attachments)).its(0).then((attachment) => { - cy.get("@tests").its(0).containsAttachment({ - name: "foo", - source: attachment, - type: "application/json", - }); - }); - }); - }); - - it("json", () => { - cy.readFile("package.json", null).then((content) => { - attachment("foo", content, "application/json") - }) - }); -}) diff --git a/packages/allure-cypress/cypress/e2e/description.cy.js b/packages/allure-cypress/cypress/e2e/description.cy.js deleted file mode 100644 index 39e9f0527..000000000 --- a/packages/allure-cypress/cypress/e2e/description.cy.js +++ /dev/null @@ -1,18 +0,0 @@ -import { description, descriptionHtml } from "allure-cypress"; - -after(() => { - cy.task("readLastTestResult").then((result) => { - cy.wrap(result.tests).as("tests"); - - cy.get("@tests").should("have.length", 1); - cy.get("@tests").its(0).matches({ - description: "foo", - descriptionHtml: "bar", - }); - }); -}); - -it("description", () => { - description("foo"); - descriptionHtml("bar"); -}); diff --git a/packages/allure-cypress/cypress/e2e/displayName.cy.js b/packages/allure-cypress/cypress/e2e/displayName.cy.js deleted file mode 100644 index 23ef2c8fb..000000000 --- a/packages/allure-cypress/cypress/e2e/displayName.cy.js +++ /dev/null @@ -1,16 +0,0 @@ -import { displayName } from "allure-cypress"; - -after(() => { - cy.task("readLastTestResult").then((result) => { - cy.wrap(result.tests).as("tests"); - - cy.get("@tests").should("have.length", 1); - cy.get("@tests").its(0).matches({ - name: "foo", - }); - }); -}); - -it("displayName", () => { - displayName("foo"); -}); diff --git a/packages/allure-cypress/cypress/e2e/historyId.cy.js b/packages/allure-cypress/cypress/e2e/historyId.cy.js deleted file mode 100644 index c0ecb95a6..000000000 --- a/packages/allure-cypress/cypress/e2e/historyId.cy.js +++ /dev/null @@ -1,16 +0,0 @@ -import { historyId } from "allure-cypress"; - -after(() => { - cy.task("readLastTestResult").then((result) => { - cy.wrap(result.tests).as("tests"); - - cy.get("@tests").should("have.length", 1); - cy.get("@tests").its(0).matches({ - historyId: "foo", - }); - }); -}); - -it("historyId", () => { - historyId("foo"); -}); diff --git a/packages/allure-cypress/cypress/e2e/labels.cy.js b/packages/allure-cypress/cypress/e2e/labels.cy.js deleted file mode 100644 index 1a3280562..000000000 --- a/packages/allure-cypress/cypress/e2e/labels.cy.js +++ /dev/null @@ -1,231 +0,0 @@ -import { - allureId, - epic, - feature, - label, - layer, - owner, - parentSuite, - severity, - story, - subSuite, - suite, - tag, -} from "allure-cypress"; - -describe("custom", () => { - after(() => { - cy.task("readLastTestResult").then((result) => { - cy.log(result) - cy.wrap(result.tests).as("tests"); - - cy.get("@tests").should("have.length", 1); - cy.get("@tests").its(0).containsLabel({ - name: "foo", - value: "bar", - }); - }); - }); - - it("custom", () => { - label("foo", "bar"); - }); -}); - -describe("allureId", () => { - after(() => { - cy.task("readLastTestResult").then((result) => { - cy.wrap(result.tests).as("tests"); - - cy.get("@tests").should("have.length", 1); - cy.get("@tests").its(0).containsLabel({ - name: "ALLURE_ID", - value: "foo", - }); - }); - }); - - it("allureId", () => { - allureId("foo"); - }); -}); - -describe("epic", () => { - after(() => { - cy.task("readLastTestResult").then((result) => { - cy.wrap(result.tests).as("tests"); - - cy.get("@tests").should("have.length", 1); - cy.get("@tests").its(0).containsLabel({ - name: "epic", - value: "foo", - }); - }); - }); - - it("epic", () => { - epic("foo"); - }); -}); - -describe("feature", () => { - after(() => { - cy.task("readLastTestResult").then((result) => { - cy.wrap(result.tests).as("tests"); - - cy.get("@tests").should("have.length", 1); - cy.get("@tests").its(0).containsLabel({ - name: "feature", - value: "foo", - }); - }); - }); - - it("feature", () => { - feature("foo"); - }); -}); - -describe("layer", () => { - after(() => { - cy.task("readLastTestResult").then((result) => { - cy.wrap(result.tests).as("tests"); - - cy.get("@tests").should("have.length", 1); - cy.get("@tests").its(0).containsLabel({ - name: "layer", - value: "foo", - }); - }); - }); - - it("layer", () => { - layer("foo"); - }); -}); - -describe("owner", () => { - after(() => { - cy.task("readLastTestResult").then((result) => { - cy.wrap(result.tests).as("tests"); - - cy.get("@tests").should("have.length", 1); - cy.get("@tests").its(0).containsLabel({ - name: "owner", - value: "foo", - }); - }); - }); - - it("owner", () => { - owner("foo"); - }); -}); - -describe("parentSuite", () => { - after(() => { - cy.task("readLastTestResult").then((result) => { - cy.wrap(result.tests).as("tests"); - - cy.get("@tests").should("have.length", 1); - cy.get("@tests").its(0).containsLabel({ - name: "parentSuite", - value: "foo", - }); - }); - }); - - it("parentSuite", () => { - parentSuite("foo"); - }); -}); - -describe("severity", () => { - after(() => { - cy.task("readLastTestResult").then((result) => { - cy.wrap(result.tests).as("tests"); - - cy.get("@tests").should("have.length", 1); - cy.get("@tests").its(0).containsLabel({ - name: "severity", - value: "foo", - }); - }); - }); - - it("severity", () => { - severity("foo"); - }); -}); - -describe("story", () => { - after(() => { - cy.task("readLastTestResult").then((result) => { - cy.wrap(result.tests).as("tests"); - - cy.get("@tests").should("have.length", 1); - cy.get("@tests").its(0).containsLabel({ - name: "story", - value: "foo", - }); - }); - }); - - it("story", () => { - story("foo"); - }); -}); - -describe("subSuite", () => { - after(() => { - cy.task("readLastTestResult").then((result) => { - cy.wrap(result.tests).as("tests"); - - cy.get("@tests").should("have.length", 1); - cy.get("@tests").its(0).containsLabel({ - name: "subSuite", - value: "foo", - }); - }); - }); - - it("subSuite", () => { - subSuite("foo"); - }); -}); - -describe("suite", () => { - after(() => { - cy.task("readLastTestResult").then((result) => { - cy.wrap(result.tests).as("tests"); - - cy.get("@tests").should("have.length", 1); - cy.get("@tests").its(0).containsLabel({ - name: "suite", - value: "foo", - }); - }); - }); - - it("suite", () => { - suite("foo"); - }); -}); - -describe("tag", () => { - after(() => { - cy.task("readLastTestResult").then((result) => { - cy.wrap(result.tests).as("tests"); - - cy.get("@tests").should("have.length", 1); - cy.get("@tests").its(0).containsLabel({ - name: "tag", - value: "foo", - }); - }); - }); - - it("tag", () => { - tag("foo"); - }); -}); diff --git a/packages/allure-cypress/cypress/e2e/links.cy.js b/packages/allure-cypress/cypress/e2e/links.cy.js deleted file mode 100644 index c7e92cecb..000000000 --- a/packages/allure-cypress/cypress/e2e/links.cy.js +++ /dev/null @@ -1,134 +0,0 @@ -import { link, issue, tms } from "allure-cypress"; - -describe("custom", () => { - after(() => { - cy.task("readLastTestResult").then((result) => { - cy.wrap(result.tests).as("tests"); - - cy.get("@tests").should("have.length", 1); - cy.get("@tests").its(0).containsLink({ - name: "foo", - type: "bar", - url: "https://allurereport.org", - }); - }); - }); - - it("custom", () => { - link("https://allurereport.org", "foo", "bar"); - }); -}) - -describe("issue", () => { - after(() => { - cy.task("readLastTestResult").then((result) => { - cy.wrap(result.tests).as("tests"); - - cy.get("@tests").should("have.length", 1); - cy.get("@tests").its(0).containsLink({ - type: "issue", - name: "foo", - url: "https://allurereport.org" - }); - }); - }); - - it("issue", () => { - issue("https://allurereport.org", "foo"); - }); -}) - -describe("short issue without name", () => { - after(() => { - cy.task("readLastTestResult").then((result) => { - cy.wrap(result.tests).as("tests"); - - cy.get("@tests").should("have.length", 1); - cy.get("@tests").its(0).containsLink({ - type: "issue", - name: "ISSUE-1", - url: "https://allurereport.org/issues/ISSUE-1" - }); - }); - }); - - it("issue", () => { - issue("ISSUE-1"); - }); -}) - -describe("short issue with name", () => { - after(() => { - cy.task("readLastTestResult").then((result) => { - cy.wrap(result.tests).as("tests"); - - cy.get("@tests").should("have.length", 1); - cy.get("@tests").its(0).containsLink({ - type: "issue", - name: "foo", - url: "https://allurereport.org/issues/ISSUE-1" - }); - }); - }); - - it("issue", () => { - issue("ISSUE-1", "foo"); - }); -}) - -describe("tms", () => { - after(() => { - cy.task("readLastTestResult").then((result) => { - cy.wrap(result.tests).as("tests"); - - cy.get("@tests").should("have.length", 1); - cy.get("@tests").its(0).containsLink({ - type: "tms", - name: "foo", - url: "https://allurereport.org" - }); - }); - }); - - it("tms", () => { - tms("https://allurereport.org", "foo"); - }); -}) - -describe("short tms without name", () => { - after(() => { - cy.task("readLastTestResult").then((result) => { - cy.wrap(result.tests).as("tests"); - - cy.get("@tests").should("have.length", 1); - cy.get("@tests").its(0).containsLink({ - type: "tms", - name: "TMS-1", - url: "https://allurereport.org/tasks/TMS-1" - }); - }); - }); - - it("tms", () => { - tms("TMS-1"); - }); -}) - -describe("short tms with name", () => { - after(() => { - cy.task("readLastTestResult").then((result) => { - cy.wrap(result.tests).as("tests"); - - cy.get("@tests").should("have.length", 1); - cy.get("@tests").its(0).containsLink({ - type: "tms", - name: "foo", - url: "https://allurereport.org/tasks/TMS-1" - }); - }); - }); - - it("tms", () => { - tms("TMS-1", "foo"); - }); -}) diff --git a/packages/allure-cypress/cypress/e2e/parameters.cy.js b/packages/allure-cypress/cypress/e2e/parameters.cy.js deleted file mode 100644 index d7fee968a..000000000 --- a/packages/allure-cypress/cypress/e2e/parameters.cy.js +++ /dev/null @@ -1,22 +0,0 @@ -import { parameter } from "allure-cypress"; - -after(() => { - cy.task("readLastTestResult").then((result) => { - cy.wrap(result.tests).as("tests"); - - cy.get("@tests").should("have.length", 1); - cy.get("@tests").its(0).containsParameter({ - name: "foo", - value: "bar", - mode: "hidden", - excluded: false, - }); - }); -}); - -it("parameter", () => { - parameter("foo", "bar", { - mode: "hidden", - excluded: false - }) -}); diff --git a/packages/allure-cypress/cypress/e2e/screenshots.cy.js b/packages/allure-cypress/cypress/e2e/screenshots.cy.js deleted file mode 100644 index ca2d5fad5..000000000 --- a/packages/allure-cypress/cypress/e2e/screenshots.cy.js +++ /dev/null @@ -1,41 +0,0 @@ -describe("unnamed", () => { - after(() => { - cy.task("readLastTestResult").then((result) => { - cy.wrap(result.tests).as("tests"); - - cy.get("@tests").should("have.length", 1); - cy.wrap(Object.keys(result.attachments)).its(0).then((attachment) => { - cy.get("@tests").its(0).containsAttachment({ - name: "Screenshot", - source: attachment, - type: "image/png", - }); - }); - }); - }); - - it("screenshot", () => { - cy.screenshot(); - }); -}) - -describe("named", () => { - after(() => { - cy.task("readLastTestResult").then((result) => { - cy.wrap(result.tests).as("tests"); - - cy.get("@tests").should("have.length", 1); - cy.wrap(Object.keys(result.attachments)).its(0).then((attachment) => { - cy.get("@tests").its(0).containsAttachment({ - name: "foo", - source: attachment, - type: "image/png", - }); - }); - }); - }); - - it("screenshot", () => { - cy.screenshot("foo"); - }); -}) diff --git a/packages/allure-cypress/cypress/e2e/steps.cy.js b/packages/allure-cypress/cypress/e2e/steps.cy.js deleted file mode 100644 index 1658dea7a..000000000 --- a/packages/allure-cypress/cypress/e2e/steps.cy.js +++ /dev/null @@ -1,163 +0,0 @@ -import { step } from "allure-cypress"; - -describe("single", () => { - after(() => { - cy.task("readLastTestResult").then((result) => { - cy.wrap(result.tests).as("tests"); - - cy.get("@tests").should("have.length", 1); - cy.get("@tests") - .its(0) - .its("steps") - .then((steps) => { - cy.wrap(steps).should("have.length", 2); - cy.wrap(steps).its(0).its("name").should("eq", "foo"); - cy.wrap(steps).its(0).its("status").should("eq", "passed"); - cy.wrap(steps).its(1).its("name").should("eq", "bar"); - cy.wrap(steps).its(1).its("status").should("eq", "passed"); - }); - }); - }); - - it("step", () => { - step("foo", () => { - cy.log("foo"); - }); - step("bar", () => { - cy.log("bar"); - }); - }); -}); - -describe("nested", () => { - after(() => { - cy.task("readLastTestResult").then((result) => { - cy.wrap(result.tests).as("tests"); - - cy.get("@tests").should("have.length", 1); - cy.get("@tests") - .its(0) - .its("steps") - .then((steps) => { - cy.wrap(steps).should("have.length", 2); - cy.wrap(steps).its(0).its("name").should("eq", "foo"); - cy.wrap(steps).its(1).its("name").should("eq", "baz"); - }); - cy.get("@tests").its(0).its("steps").its(0).its("steps").should("have.length", 1); - cy.get("@tests") - .its(0) - .its("steps") - .its(0) - .its("steps") - .then((steps) => { - cy.wrap(steps).should("have.length", 1); - cy.wrap(steps).its(0).its("name").should("eq", "bar"); - }); - }); - }); - - it("step", () => { - step("foo", () => { - step("bar", () => { - cy.log("hello"); - }); - }); - step("baz", () => { - cy.log("world"); - }) - }); -}); - -describe("with screenshot", () => { - after(() => { - cy.task("readLastTestResult").then((result) => { - cy.wrap(result.tests).as("tests"); - - cy.get("@tests").should("have.length", 1); - cy.get("@tests") - .its(0) - .its("steps") - .then((steps) => { - cy.wrap(steps).its(0).its("name").should("eq", "foo"); - }); - cy.get("@tests").its(0).its("steps").its(0).its("steps").should("have.length", 1); - cy.wrap(Object.keys(result.attachments)).its(0).then((attachment) => { - cy.get("@tests").its(0).its("steps").its(0).its("steps").its(0).as("lastStep"); - cy.get("@lastStep").containsAttachment({ - name: "Screenshot", - source: attachment, - type: "image/png", - }) - }); - }); - }); - - it("step", () => { - step("foo", () => { - step("bar", () => { - cy.screenshot(); - }); - }); - }); -}); - -// TODO: test specs with failed steps -// describe("with assertion error", () => { -// after(() => { -// cy.task("readLastTestResult").then((result) => { -// cy.wrap(result.tests).as("tests"); -// -// cy.get("@tests").should("have.length", 1); -// }); -// }); -// -// it("step @allure.label.keep_failed=1", () => { -// step("foo", () => { -// step("bar", () => { -// step("baz", () => { -// cy.wrap(1).should("eq", 2) -// }) -// }) -// }); -// }); -// }); -// -// describe("with cypress error", () => { -// after(() => { -// cy.task("readLastTestResult").then((result) => { -// cy.wrap(result.tests).as("tests"); -// -// cy.get("@tests").should("have.length", 1); -// }); -// }); -// -// it("step @allure.label.keep_failed=1", () => { -// step("foo", () => { -// step("bar", () => { -// step("baz", () => { -// cy.get(".foo") -// }) -// }) -// }); -// }); -// }); -// -// describe("with unexpected error", () => { -// after(() => { -// cy.task("readLastTestResult").then((result) => { -// cy.wrap(result.tests).as("tests"); -// -// cy.get("@tests").should("have.length", 1); -// }); -// }); -// -// it("step @allure.label.keep_failed=1", () => { -// step("foo", () => { -// step("bar", () => { -// step("baz", () => { -// throw new Error("foo") -// }) -// }) -// }); -// }); -// }); diff --git a/packages/allure-cypress/cypress/e2e/testCaseId.cy.js b/packages/allure-cypress/cypress/e2e/testCaseId.cy.js deleted file mode 100644 index ad8c35312..000000000 --- a/packages/allure-cypress/cypress/e2e/testCaseId.cy.js +++ /dev/null @@ -1,16 +0,0 @@ -import { testCaseId } from "allure-cypress"; - -after(() => { - cy.task("readLastTestResult").then((result) => { - cy.wrap(result.tests).as("tests"); - - cy.get("@tests").should("have.length", 1); - cy.get("@tests").its(0).matches({ - testCaseId: "foo", - }); - }); -}); - -it("testCaseId", () => { - testCaseId("foo"); -}); diff --git a/packages/allure-cypress/cypress/e2e/titleMetadata.cy.js b/packages/allure-cypress/cypress/e2e/titleMetadata.cy.js deleted file mode 100644 index 1c1570a25..000000000 --- a/packages/allure-cypress/cypress/e2e/titleMetadata.cy.js +++ /dev/null @@ -1,25 +0,0 @@ -import { label } from "allure-cypress"; - -after(() => { - cy.task("readLastTestResult").then((result) => { - cy.wrap(result.tests).as("tests"); - - cy.get("@tests").should("have.length", 1); - cy.get("@tests").its(0).containsLabel({ - name: "ALLURE_ID", - value: "1", - }); - cy.get("@tests").its(0).containsLabel({ - name: "foo", - value: "2", - }); - cy.get("@tests").its(0).containsLabel({ - name: "bar", - value: "3", - }); - }); -}); - -it("foo @allure.id=1 @allure.label.foo=2", () => { - label("bar", "3"); -}); diff --git a/packages/allure-cypress/cypress/support/e2e.js b/packages/allure-cypress/cypress/support/e2e.js deleted file mode 100644 index 066d54393..000000000 --- a/packages/allure-cypress/cypress/support/e2e.js +++ /dev/null @@ -1,21 +0,0 @@ -import "allure-cypress/commands"; - -Cypress.Commands.add("matches", { prevSubject: true }, (subject, object) => { - cy.wrap(subject).then((subject) => { - Object.keys(object).forEach((key) => { - expect(subject[key]).to.eql(object[key]); - }); - }); -}); -Cypress.Commands.add("containsLabel", { prevSubject: true }, (subject, label) => { - cy.wrap(subject.labels).should("deep.include", label); -}); -Cypress.Commands.add("containsLink", { prevSubject: true }, (subject, link) => { - cy.wrap(subject.links).should("deep.include", link); -}); -Cypress.Commands.add("containsAttachment", { prevSubject: true }, (subject, attachment) => { - cy.wrap(subject.attachments).should("deep.include", attachment) -}) -Cypress.Commands.add("containsParameter", { prevSubject: true }, (subject, parameter) => { - cy.wrap(subject.parameters).should("deep.include", parameter); -}); diff --git a/packages/allure-cypress/package.json b/packages/allure-cypress/package.json index d4f498c2f..92ce3ae13 100644 --- a/packages/allure-cypress/package.json +++ b/packages/allure-cypress/package.json @@ -1,6 +1,6 @@ { "name": "allure-cypress", - "version": "2.15.0", + "version": "2.15.1", "description": "Allure Cypress integration", "keywords": [ "cypress", @@ -52,24 +52,23 @@ "coverage": "codecov", "lint": "eslint ./src --ext .ts", "lint:fix": "eslint ./src --ext .ts --fix", - "test": "cypress run" + "pretest": "rimraf ./test/fixtures", + "test": "vitest run --dir ./test/spec" }, "dependencies": { "allure-js-commons": "workspace:*" }, "devDependencies": { - "@jest/globals": "^29.7.0", "@rollup/plugin-commonjs": "^25.0.7", "@rollup/plugin-node-resolve": "^15.2.3", "@rollup/plugin-typescript": "^11.1.6", "@types/eslint": "^8", "@types/glob": "^8.1.0", - "@types/jest": "^29.5.12", "@types/mocha": "^10.0.1", "@types/node": "^20.6.3", "@typescript-eslint/eslint-plugin": "^6.7.0", "@typescript-eslint/parser": "^6.7.0", - "allure-jest": "workspace:*", + "allure-vitest": "workspace:*", "cypress": "^13.6.0", "enquirer": "^2.3.6", "eslint": "^8.49.0", @@ -80,13 +79,12 @@ "eslint-plugin-no-null": "^1.0.2", "eslint-plugin-prefer-arrow": "^1.2.3", "glob": "^10.3.5", - "jest": "^29.7.0", - "npm-run-all": "^4.1.5", + "npm-run-all2": "^5.0.0", "rimraf": "^5.0.1", "rollup": "^4.13.0", - "ts-jest": "^29.1.2", "ts-node": "^10.9.2", "tslib": "^2.6.2", - "typescript": "^5.2.2" + "typescript": "^5.2.2", + "vitest": "^1.4.0" } } diff --git a/packages/allure-cypress/src/commands.ts b/packages/allure-cypress/src/commands.ts index 7e1d105b8..90e5377ac 100644 --- a/packages/allure-cypress/src/commands.ts +++ b/packages/allure-cypress/src/commands.ts @@ -1,12 +1,13 @@ import { Stage, Status } from "allure-js-commons/new"; import { MessageType, type ReportFinalMessage, type ReporterMessage } from "./model"; -const createFinalMesage = () => +const createFinalMesage = (testFileAbsolutePath: string) => // @ts-ignore ({ startMessage: undefined, endMessage: undefined, messages: [], + testFileAbsolutePath, }) as ReportFinalMessage; const { EVENT_TEST_BEGIN, EVENT_TEST_FAIL, EVENT_TEST_PASS } = Mocha.Runner.constants; @@ -52,7 +53,7 @@ const getStepsMessagesPair = (reportMessage: ReportFinalMessage) => Cypress.mocha .getRunner() .on(EVENT_TEST_BEGIN, (test: Mocha.Test) => { - const reportMessage = createFinalMesage(); + const reportMessage = createFinalMesage(Cypress.spec.absolute); reportMessage.startMessage = { specPath: getSuitePath(test).concat(test.title), @@ -157,5 +158,7 @@ Cypress.on("fail", (err) => { afterEach(() => { const reportMessage = Cypress.env("allure").reportMessage; + reportMessage.isInteractive = Cypress.config("isInteractive"); + cy.task("allureReportTest", reportMessage, { log: false }); }); diff --git a/packages/allure-cypress/src/model.ts b/packages/allure-cypress/src/model.ts index 39f58936a..cbabb5e5e 100644 --- a/packages/allure-cypress/src/model.ts +++ b/packages/allure-cypress/src/model.ts @@ -56,6 +56,8 @@ export type MetadataSentMessage = { export type ReporterMessage = StepStartMessage | StepEndMessage | MetadataSentMessage | ScreenshotMessage; export type ReportFinalMessage = { + testFileAbsolutePath: string; + isInteractive: boolean; startMessage: TestStartMessage; endMessage: TestEndMessage; messages: ReporterMessage[]; diff --git a/packages/allure-cypress/src/reporter.ts b/packages/allure-cypress/src/reporter.ts index 2f977929b..2f874872f 100644 --- a/packages/allure-cypress/src/reporter.ts +++ b/packages/allure-cypress/src/reporter.ts @@ -3,6 +3,7 @@ import { readFileSync } from "node:fs"; import { AllureStep, AllureTest, + ContentType, LabelName, Link, Stage, @@ -20,128 +21,188 @@ export type AllureCypressConfig = { }[]; }; -const startAllureTest = (runtime: AllureNodeRuntime, message: TestStartMessage) => { - const suiteLabels = getSuitesLabels(message.specPath.slice(0, -1)); - const testTitle = message.specPath[message.specPath.length - 1]; - const titleMetadata = extractMetadataFromString(testTitle); - const currentTest = new AllureTest(runtime, message.start); - - currentTest.name = titleMetadata.cleanTitle; - currentTest.fullName = `${message.filename}#${message.specPath.join(" ")}`; - currentTest.stage = Stage.RUNNING; +export class AllureCypress { + runtime: AllureNodeRuntime; + currentTestsByAbsolutePath = new Map(); + // need to keep the variable here because we recieve end-message and finish the current test separately + currentSteps: AllureStep[] = []; + constructor(private config?: AllureCypressConfig) { + this.runtime = new AllureNodeRuntime({ + writer: new FileSystemAllureWriter({ + resultsDir: config?.resultsDir || "./allure-results", + }), + }); + } + + private startAllureTest(message: TestStartMessage) { + const suiteLabels = getSuitesLabels(message.specPath.slice(0, -1)); + const testTitle = message.specPath[message.specPath.length - 1]; + const titleMetadata = extractMetadataFromString(testTitle); + const currentTest = new AllureTest(this.runtime, message.start); + + currentTest.name = titleMetadata.cleanTitle; + currentTest.fullName = `${message.filename}#${message.specPath.join(" ")}`; + currentTest.stage = Stage.RUNNING; + + currentTest.addLabel(LabelName.LANGUAGE, "javascript"); + currentTest.addLabel(LabelName.FRAMEWORK, "cypress"); + + suiteLabels.forEach((label) => { + currentTest.addLabel(label.name, label.value); + }); + + titleMetadata.labels.forEach((label) => { + currentTest.addLabel(label.name, label.value); + }); + + return currentTest; + } + + endSpec(spec: Cypress.Spec, results: CypressCommandLine.RunResult) { + const currentTests = this.currentTestsByAbsolutePath.get(spec.absolute); + + if (!currentTests?.length) { + return; + } + + const videoName = results.video ? this.runtime.writeAttachmentFromPath(results.video, ContentType.MP4) : undefined; + + currentTests.forEach(([test, stop]) => { + if (videoName) { + test.addAttachment("Video", ContentType.MP4, videoName); + } + + test.endTest(stop); + }); + + this.currentTestsByAbsolutePath.delete(spec.absolute); + } + + attachToCypress(on: Cypress.PluginEvents) { + on("task", { + allureReportTest: ({ + isInteractive, + testFileAbsolutePath, + startMessage, + endMessage, + messages, + }: ReportFinalMessage) => { + const currentTests = this.currentTestsByAbsolutePath.get(testFileAbsolutePath) || []; + const currentTest = this.startAllureTest(startMessage); + + messages.forEach(({ type, payload }) => { + if (!currentTest) { + return; + } - currentTest.addLabel(LabelName.LANGUAGE, "javascript"); - currentTest.addLabel(LabelName.FRAMEWORK, "cypress"); + if (type === MessageType.STEP_STARTED) { + const currentStep = this.currentSteps[this.currentSteps.length - 1]; + const newStep = (currentStep || currentTest).startStep(payload.name, payload.start); - suiteLabels.forEach((label) => { - currentTest.addLabel(label.name, label.value); - }); + this.currentSteps.push(newStep); + return; + } - titleMetadata.labels.forEach((label) => { - currentTest.addLabel(label.name, label.value); - }); + if (type === MessageType.STEP_ENDED) { + const currentStep = this.currentSteps.pop()!; - return currentTest; -}; + currentStep.status = payload.status; + currentStep.statusDetails = payload.statusDetails!; + currentStep.stage = payload.stage!; + currentStep.endStep(payload.stop); + return; + } -export const allureCypress = (on: Cypress.PluginEvents, config?: AllureCypressConfig) => { - const runtime = new AllureNodeRuntime({ - writer: new FileSystemAllureWriter({ - resultsDir: config?.resultsDir || "./allure-results", - }), - }); - const currentSteps: AllureStep[] = []; + if (type === MessageType.SCREENSHOT) { + const currentStep = this.currentSteps[this.currentSteps.length - 1]; + const attachmentName = payload.name; + const screenshotBody = readFileSync(payload.path); + const screenshotName = this.runtime.writeAttachment(screenshotBody, ContentType.PNG); - on("task", { - allureReportTest: ({ startMessage, endMessage, messages }: ReportFinalMessage) => { - const currentTest = startAllureTest(runtime, startMessage); + (currentStep || currentTest).addAttachment(attachmentName, ContentType.PNG, screenshotName); + return; + } - messages.forEach(({ type, payload }) => { - if (type === MessageType.STEP_STARTED) { - const currentStep = currentSteps[currentSteps.length - 1]; - const newStep = (currentStep || currentTest).startStep(payload.name, payload.start); + if (type === MessageType.METADATA) { + const { parameter = [], links = [], attachments, ...metadata } = payload; + const currentStep = this.currentSteps[this.currentSteps.length - 1]; - currentSteps.push(newStep); - return; - } - - if (type === MessageType.STEP_ENDED) { - const currentStep = currentSteps.pop()!; + parameter.forEach(({ name, value, excluded, mode }) => { + currentTest.parameter(name, value, { + excluded, + mode, + }); + }); + attachments?.forEach((attachment) => { + const attachmentName = this.runtime.writeAttachment( + attachment.content, + attachment.type, + attachment.encoding, + ); + + (currentStep || currentTest).addAttachment(attachment.name, attachment.type, attachmentName); + }); - currentStep.status = payload.status; - currentStep.statusDetails = payload.statusDetails!; - currentStep.stage = payload.stage!; - currentStep.endStep(payload.stop); - return; - } + if (!this.config?.links?.length) { + currentTest.applyMetadata({ + ...metadata, + links, + }); + return; + } - if (type === MessageType.SCREENSHOT) { - const currentStep = currentSteps[currentSteps.length - 1]; - const attachmentName = payload.name; - const screenshotBody = readFileSync(payload.path); - const screenshotName = runtime.writeAttachment(screenshotBody, "image/png"); + const formattedLinks: Link[] = links.map((link) => { + const matcher = this.config?.links?.find?.((item) => item.type === link.type); - (currentStep || currentTest).addAttachment(attachmentName, "image/png", screenshotName); - return; - } + if (!matcher || link.url.startsWith("http")) { + return link; + } - if (type === MessageType.METADATA) { - const { parameter = [], links = [], attachments, ...metadata } = payload; - const currentStep = currentSteps[currentSteps.length - 1]; + const url = matcher.urlTemplate.replace("%s", link.url); + const name = link.name || link.url; - parameter.forEach(({ name, value, excluded, mode }) => { - currentTest.parameter(name, value, { - excluded, - mode, + return { + ...link, + name, + url, + }; }); - }); - attachments?.forEach((attachment) => { - const attachmentName = runtime.writeAttachment(attachment.content, attachment.type, attachment.encoding); - - (currentStep || currentTest).addAttachment(attachment.name, attachment.type, attachmentName); - }); - if (!config?.links?.length) { currentTest.applyMetadata({ ...metadata, - links, + links: formattedLinks, }); return; } - - const formattedLinks: Link[] = links.map((link) => { - const matcher = config?.links?.find?.((item) => item.type === link.type); - - if (!matcher || link.url.startsWith("http")) { - return link; - } - - const url = matcher.urlTemplate.replace("%s", link.url); - const name = link.name || link.url; - - return { - ...link, - name, - url, - }; - }); - - currentTest.applyMetadata({ - ...metadata, - links: formattedLinks, - }); - return; + }); + + currentTest.stage = endMessage.stage; + currentTest.status = endMessage.status; + currentTest.statusDetails = endMessage.statusDetails!; + currentTest.calculateHistoryId(); + this.currentTestsByAbsolutePath.set( + testFileAbsolutePath, + currentTests.concat([[currentTest, endMessage.stop]]), + ); + + if (isInteractive) { + this.endSpec({ absolute: testFileAbsolutePath } as Cypress.Spec, {} as CypressCommandLine.RunResult); } - }); - currentTest.stage = endMessage.stage; - currentTest.status = endMessage.status; - currentTest.statusDetails = endMessage.statusDetails!; + return null; + }, + }); + } +} + +export const allureCypress = (on: Cypress.PluginEvents, allureConfig?: AllureCypressConfig) => { + const allureCypressReporter = new AllureCypress(allureConfig); - currentTest.calculateHistoryId(); - currentTest.endTest(endMessage.stop); + allureCypressReporter.attachToCypress(on); - return null; - }, + on("after:spec", (spec, result) => { + allureCypressReporter.endSpec(spec, result); }); + + return allureCypressReporter; }; diff --git a/packages/allure-cypress/test/spec/attachments.test.ts b/packages/allure-cypress/test/spec/attachments.test.ts new file mode 100644 index 000000000..88992b228 --- /dev/null +++ b/packages/allure-cypress/test/spec/attachments.test.ts @@ -0,0 +1,68 @@ +import { writeFile } from "node:fs/promises"; +import { join } from "node:path"; +import { expect, test } from "vitest"; +import { runCypressInlineTest } from "../utils"; + +test("text", async () => { + const { tests, attachments } = await runCypressInlineTest(` + import { attachment } from "allure-cypress"; + + it("text attachment", () => { + attachment("foo.txt", "bar", "text/plain"); + }); + `); + + expect(tests).toHaveLength(1); + expect(tests[0].attachments).toHaveLength(1); + + const [attachment] = tests[0].attachments; + + expect(attachment.name).toBe("foo.txt"); + expect(attachments[attachment.source] as string).toBe("bar"); +}); + +test("json", async () => { + const { tests, attachments } = await runCypressInlineTest(` + import { attachment } from "allure-cypress"; + + it("json attachment", () => { + attachment("foo", JSON.stringify({ foo: "bar" }), "application/json"); + }); + `); + + expect(tests).toHaveLength(1); + expect(tests[0].attachments).toHaveLength(1); + + const [attachment] = tests[0].attachments; + + expect(attachment.name).toBe("foo"); + expect(JSON.parse(attachments[attachment.source] as string)).toEqual({ + foo: "bar", + }); +}); + +test("cypress read file", async () => { + const { tests, attachments } = await runCypressInlineTest( + ` + import { attachment } from "allure-cypress"; + + it("json attachment", () => { + cy.readFile("foo.txt", null).then((content) => { + attachment("foo.txt", content, "text/plain") + }) + }); + `, + undefined, + async (testDir) => { + await writeFile(join(testDir, "foo.txt"), "bar", "utf8"); + }, + ); + + expect(tests).toHaveLength(1); + expect(tests[0].attachments).toHaveLength(1); + + const [attachment] = tests[0].attachments; + + expect(attachment.name).toBe("foo.txt"); + expect(attachments[attachment.source] as string).toBe("bar"); +}); diff --git a/packages/allure-cypress/test/spec/base.test.ts b/packages/allure-cypress/test/spec/base.test.ts new file mode 100644 index 000000000..1f69e1fc1 --- /dev/null +++ b/packages/allure-cypress/test/spec/base.test.ts @@ -0,0 +1,40 @@ +import { expect, it } from "vitest"; +import { Stage, Status } from "allure-js-commons"; +import { runCypressInlineTest } from "../utils"; + +it("passed test", async () => { + const { tests } = await runCypressInlineTest(` + it("passed", () => { + cy.wrap(1).should("eq", 1); + }); + `); + + expect(tests).toHaveLength(1); + expect(tests[0].status).toBe(Status.PASSED); + expect(tests[0].stage).toBe(Stage.FINISHED); +}); + +it("failed test", async () => { + const { tests } = await runCypressInlineTest(` + it("failed", () => { + cy.wrap(1).should("eq", 2); + }); + `); + + expect(tests).toHaveLength(1); + expect(tests[0].status).toBe(Status.FAILED); + expect(tests[0].stage).toBe(Stage.FINISHED); +}); + +it("broken test", async () => { + const { tests } = await runCypressInlineTest(` + it("broken", () => { + throw new Error("broken"); + }); + `); + + expect(tests).toHaveLength(1); + expect(tests[0].status).toBe(Status.BROKEN); + expect(tests[0].stage).toBe(Stage.FINISHED); + expect(tests[0].statusDetails).toHaveProperty("message", "broken"); +}); diff --git a/packages/allure-cypress/test/spec/description.test.ts b/packages/allure-cypress/test/spec/description.test.ts new file mode 100644 index 000000000..320d4db92 --- /dev/null +++ b/packages/allure-cypress/test/spec/description.test.ts @@ -0,0 +1,28 @@ +import { expect, it } from "vitest"; +import { runCypressInlineTest } from "../utils"; + +it("description", async () => { + const { tests } = await runCypressInlineTest(` + import { description } from "allure-cypress"; + + it("markdown", () => { + description("foo"); + }); + `); + + expect(tests).toHaveLength(1); + expect(tests[0].description).toBe("foo"); +}); + +it("descriptionHtml", async () => { + const { tests } = await runCypressInlineTest(` + import { descriptionHtml } from "allure-cypress"; + + it("html", () => { + descriptionHtml("foo"); + }); + `); + + expect(tests).toHaveLength(1); + expect(tests[0].descriptionHtml).toBe("foo"); +}); diff --git a/packages/allure-cypress/test/spec/displayName.test.ts b/packages/allure-cypress/test/spec/displayName.test.ts new file mode 100644 index 000000000..5ade44f27 --- /dev/null +++ b/packages/allure-cypress/test/spec/displayName.test.ts @@ -0,0 +1,15 @@ +import { expect, it } from "vitest"; +import { runCypressInlineTest } from "../utils"; + +it("displayName", async () => { + const { tests } = await runCypressInlineTest(` + import { displayName } from "allure-cypress"; + + it("sample", () => { + displayName("foo"); + }); + `); + + expect(tests).toHaveLength(1); + expect(tests[0].name).toBe("foo"); +}); diff --git a/packages/allure-cypress/test/spec/historyId.test.ts b/packages/allure-cypress/test/spec/historyId.test.ts new file mode 100644 index 000000000..e83192523 --- /dev/null +++ b/packages/allure-cypress/test/spec/historyId.test.ts @@ -0,0 +1,15 @@ +import { expect, it } from "vitest"; +import { runCypressInlineTest } from "../utils"; + +it("historyId", async () => { + const { tests } = await runCypressInlineTest(` + import { historyId } from "allure-cypress"; + + it("sample", () => { + historyId("foo"); + }); + `); + + expect(tests).toHaveLength(1); + expect(tests[0].historyId).toBe("foo"); +}); diff --git a/packages/allure-cypress/test/spec/labels.test.ts b/packages/allure-cypress/test/spec/labels.test.ts new file mode 100644 index 000000000..282eb75b2 --- /dev/null +++ b/packages/allure-cypress/test/spec/labels.test.ts @@ -0,0 +1,159 @@ +import { expect, it } from "vitest"; +import { LabelName } from "allure-js-commons"; +import { runCypressInlineTest } from "../utils"; + +it("custom", async () => { + const { tests } = await runCypressInlineTest(` + import { label } from "allure-cypress"; + + it("custom", () => { + label("foo", "bar"); + }); + `); + + expect(tests).toHaveLength(1); + expect(tests[0].labels).toContainEqual(expect.objectContaining({ name: "foo", value: "bar" })); +}); + +it("allureId", async () => { + const { tests } = await runCypressInlineTest(` + import { allureId } from "allure-cypress"; + + it("custom", () => { + allureId("foo"); + }); + `); + + expect(tests).toHaveLength(1); + expect(tests[0].labels).toContainEqual(expect.objectContaining({ name: LabelName.ALLURE_ID, value: "foo" })); +}); + +it("epic", async () => { + const { tests } = await runCypressInlineTest(` + import { epic } from "allure-cypress"; + + it("custom", () => { + epic("foo"); + }); + `); + + expect(tests).toHaveLength(1); + expect(tests[0].labels).toContainEqual(expect.objectContaining({ name: LabelName.EPIC, value: "foo" })); +}); + +it("feature", async () => { + const { tests } = await runCypressInlineTest(` + import { feature } from "allure-cypress"; + + it("custom", () => { + feature("foo"); + }); + `); + + expect(tests).toHaveLength(1); + expect(tests[0].labels).toContainEqual(expect.objectContaining({ name: LabelName.FEATURE, value: "foo" })); +}); + +it("layer", async () => { + const { tests } = await runCypressInlineTest(` + import { layer } from "allure-cypress"; + + it("custom", () => { + layer("foo"); + }); + `); + + expect(tests).toHaveLength(1); + expect(tests[0].labels).toContainEqual(expect.objectContaining({ name: LabelName.LAYER, value: "foo" })); +}); + +it("owner", async () => { + const { tests } = await runCypressInlineTest(` + import { owner } from "allure-cypress"; + + it("custom", () => { + owner("foo"); + }); + `); + + expect(tests).toHaveLength(1); + expect(tests[0].labels).toContainEqual(expect.objectContaining({ name: LabelName.OWNER, value: "foo" })); +}); + +it("parentSuite", async () => { + const { tests } = await runCypressInlineTest(` + import { parentSuite } from "allure-cypress"; + + it("custom", () => { + parentSuite("foo"); + }); + `); + + expect(tests).toHaveLength(1); + expect(tests[0].labels).toContainEqual(expect.objectContaining({ name: LabelName.PARENT_SUITE, value: "foo" })); +}); + +it("subSuite", async () => { + const { tests } = await runCypressInlineTest(` + import { subSuite } from "allure-cypress"; + + it("custom", () => { + subSuite("foo"); + }); + `); + + expect(tests).toHaveLength(1); + expect(tests[0].labels).toContainEqual(expect.objectContaining({ name: LabelName.SUB_SUITE, value: "foo" })); +}); + +it("suite", async () => { + const { tests } = await runCypressInlineTest(` + import { suite } from "allure-cypress"; + + it("custom", () => { + suite("foo"); + }); + `); + + expect(tests).toHaveLength(1); + expect(tests[0].labels).toContainEqual(expect.objectContaining({ name: LabelName.SUITE, value: "foo" })); +}); + +it("severity", async () => { + const { tests } = await runCypressInlineTest(` + import { severity } from "allure-cypress"; + + it("custom", () => { + severity("foo"); + }); + `); + + expect(tests).toHaveLength(1); + expect(tests[0].labels).toContainEqual(expect.objectContaining({ name: LabelName.SEVERITY, value: "foo" })); +}); + +it("story", async () => { + const { tests } = await runCypressInlineTest(` + import { story } from "allure-cypress"; + + it("custom", () => { + story("foo"); + }); + `); + + expect(tests).toHaveLength(1); + expect(tests[0].labels).toContainEqual(expect.objectContaining({ name: LabelName.STORY, value: "foo" })); +}); + +it("tag", async () => { + const { tests } = await runCypressInlineTest(` + import { tag } from "allure-cypress"; + + it("custom", () => { + tag("foo"); + }); + `); + + expect(tests).toHaveLength(1); + expect(tests[0].labels).toContainEqual(expect.objectContaining({ name: LabelName.TAG, value: "foo" })); +}); diff --git a/packages/allure-cypress/test/spec/links.test.ts b/packages/allure-cypress/test/spec/links.test.ts new file mode 100644 index 000000000..32cdaaf50 --- /dev/null +++ b/packages/allure-cypress/test/spec/links.test.ts @@ -0,0 +1,72 @@ +import { expect, it } from "vitest"; +import { LinkType } from "allure-js-commons"; +import { runCypressInlineTest } from "../utils"; + +it("link", async () => { + const { tests } = await runCypressInlineTest( + ` + import { link } from "allure-cypress"; + + it("link", () => { + link("https://allurereport.org", "bar", "foo"); + }); + `, + ); + + expect(tests).toHaveLength(1); + expect(tests[0].links).toContainEqual({ + name: "bar", + type: "foo", + url: "https://allurereport.org", + }); +}); + +it("issue", async () => { + const { tests } = await runCypressInlineTest( + ` + import { issue } from "allure-cypress"; + + it("issue", () => { + issue("https://allurereport.org/issues/1", "foo"); + issue("2", "bar"); + }); + `, + ); + + expect(tests).toHaveLength(1); + expect(tests[0].links).toContainEqual({ + name: "foo", + type: LinkType.ISSUE, + url: "https://allurereport.org/issues/1", + }); + expect(tests[0].links).toContainEqual({ + name: "bar", + type: LinkType.ISSUE, + url: "https://allurereport.org/issues/2", + }); +}); + +it("tms", async () => { + const { tests } = await runCypressInlineTest( + ` + import { tms } from "allure-cypress"; + + it("tms", () => { + tms("https://allurereport.org/tasks/1", "foo"); + tms("2", "bar"); + }); + `, + ); + + expect(tests).toHaveLength(1); + expect(tests[0].links).toContainEqual({ + name: "foo", + type: LinkType.TMS, + url: "https://allurereport.org/tasks/1", + }); + expect(tests[0].links).toContainEqual({ + name: "bar", + type: LinkType.TMS, + url: "https://allurereport.org/tasks/2", + }); +}); diff --git a/packages/allure-cypress/test/spec/parameters.test.ts b/packages/allure-cypress/test/spec/parameters.test.ts new file mode 100644 index 000000000..fba0c51e3 --- /dev/null +++ b/packages/allure-cypress/test/spec/parameters.test.ts @@ -0,0 +1,25 @@ +import { expect, it } from "vitest"; +import { runCypressInlineTest } from "../utils"; + +it("parameters", async () => { + const { tests } = await runCypressInlineTest( + ` + import { parameter } from "allure-cypress"; + + it("adds parameter", () => { + parameter("foo", "bar", { + mode: "hidden", + excluded: false + }) + }); + `, + ); + + expect(tests).toHaveLength(1); + expect(tests[0].parameters).toContainEqual({ + name: "foo", + value: "bar", + mode: "hidden", + excluded: false, + }); +}); diff --git a/packages/allure-cypress/test/spec/reporterInstance.test.ts b/packages/allure-cypress/test/spec/reporterInstance.test.ts new file mode 100644 index 000000000..7e7417f6c --- /dev/null +++ b/packages/allure-cypress/test/spec/reporterInstance.test.ts @@ -0,0 +1,39 @@ +import { expect, it } from "vitest"; +import { Stage, Status } from "allure-js-commons"; +import { runCypressInlineTest } from "../utils"; + +it("works with the reporter instance", async () => { + const { tests } = await runCypressInlineTest( + ` + it("passed", () => { + cy.wrap(1).should("eq", 1); + }); + `, + (testDir) => ` + const { AllureCypress } = require("allure-cypress/reporter"); + + module.exports = { + e2e: { + baseUrl: "https://allurereport.org", + viewportWidth: 1240, + video: true, + setupNodeEvents: (on, config) => { + const allureCypress = new AllureCypress(on); + + allureCypress.attachToCypress(on, config); + + on("after:spec", (spec, result) => { + allureCypress.endSpec(spec, result); + }); + + return config; + }, + }, + }; + `, + ); + + expect(tests).toHaveLength(1); + expect(tests[0].status).toBe(Status.PASSED); + expect(tests[0].stage).toBe(Stage.FINISHED); +}); diff --git a/packages/allure-cypress/test/spec/screenshots.test.ts b/packages/allure-cypress/test/spec/screenshots.test.ts new file mode 100644 index 000000000..a5cef83f0 --- /dev/null +++ b/packages/allure-cypress/test/spec/screenshots.test.ts @@ -0,0 +1,37 @@ +import { expect, it } from "vitest"; +import { ContentType } from "allure-js-commons"; +import { runCypressInlineTest } from "../utils"; + +it("attaches screenshots for failed specs", async () => { + const { tests, attachments } = await runCypressInlineTest(` + it("failed", () => { + cy.wrap(1).should("eq", 2); + }); + `); + + expect(tests).toHaveLength(1); + expect(tests[0].attachments).toHaveLength(1); + + const [attachment] = tests[0].attachments; + + expect(attachment.name).toBe("Screenshot"); + expect(attachment.type).toBe(ContentType.PNG); + expect(attachments).toHaveProperty(attachment.source); +}); + +it("attaches runtime screenshots", async () => { + const { tests, attachments } = await runCypressInlineTest(` + it("manual", () => { + cy.screenshot("foo"); + }); + `); + + expect(tests).toHaveLength(1); + expect(tests[0].attachments).toHaveLength(1); + + const [attachment] = tests[0].attachments; + + expect(attachment.name).toBe("foo"); + expect(attachment.type).toBe(ContentType.PNG); + expect(attachments).toHaveProperty(attachment.source); +}); diff --git a/packages/allure-cypress/test/spec/steps.test.ts b/packages/allure-cypress/test/spec/steps.test.ts new file mode 100644 index 000000000..3c1806047 --- /dev/null +++ b/packages/allure-cypress/test/spec/steps.test.ts @@ -0,0 +1,153 @@ +import { expect, it } from "vitest"; +import { ContentType, Status } from "allure-js-commons"; +import { runCypressInlineTest } from "../utils"; + +it("single step", async () => { + const { tests } = await runCypressInlineTest(` + import { label, step } from "allure-cypress"; + + it("step", () => { + step("foo", () => { + label("foo", "bar"); + }); + }); + `); + + expect(tests).toHaveLength(1); + expect(tests[0].labels).toContainEqual(expect.objectContaining({ name: "foo", value: "bar" })); + expect(tests[0].steps).toHaveLength(1); + expect(tests[0].steps).toContainEqual(expect.objectContaining({ name: "foo" })); +}); + +it("multiple steps", async () => { + const { tests } = await runCypressInlineTest(` + import { label, step } from "allure-cypress"; + + it("step", () => { + step("foo", () => { + label("foo", "1"); + }); + + step("bar", () => { + label("bar", "2"); + }); + + step("baz", () => { + label("baz", "3"); + }); + }); + `); + + expect(tests).toHaveLength(1); + expect(tests[0].labels).toContainEqual(expect.objectContaining({ name: "foo", value: "1" })); + expect(tests[0].labels).toContainEqual(expect.objectContaining({ name: "bar", value: "2" })); + expect(tests[0].labels).toContainEqual(expect.objectContaining({ name: "baz", value: "3" })); + expect(tests[0].steps).toHaveLength(3); + expect(tests[0].steps).toContainEqual(expect.objectContaining({ name: "foo" })); + expect(tests[0].steps).toContainEqual(expect.objectContaining({ name: "bar" })); + expect(tests[0].steps).toContainEqual(expect.objectContaining({ name: "baz" })); +}); + +it("nested steps", async () => { + const { tests } = await runCypressInlineTest(` + import { label, step } from "allure-cypress"; + + it("step", () => { + step("foo", () => { + step("bar", () => { + step("baz", () => { + label("foo", "bar"); + }); + }); + }); + }); + `); + + expect(tests).toHaveLength(1); + expect(tests[0].labels).toContainEqual(expect.objectContaining({ name: "foo", value: "bar" })); + expect(tests[0].steps).toHaveLength(1); + expect(tests[0].steps).toContainEqual(expect.objectContaining({ name: "foo" })); + expect(tests[0].steps[0].steps).toHaveLength(1); + expect(tests[0].steps[0].steps).toContainEqual(expect.objectContaining({ name: "bar" })); + expect(tests[0].steps[0].steps[0].steps).toHaveLength(1); + expect(tests[0].steps[0].steps[0].steps).toContainEqual(expect.objectContaining({ name: "baz" })); +}); + +it("step with attachments", async () => { + const { tests, attachments } = await runCypressInlineTest(` + import { attachment, step } from "allure-cypress"; + + it("text attachment", () => { + step("foo", () => { + attachment("foo.txt", "bar", "text/plain"); + }) + }); + `); + + expect(tests).toHaveLength(1); + expect(tests[0].attachments).toHaveLength(0); + expect(tests[0].steps).toHaveLength(1); + expect(tests[0].steps).toContainEqual(expect.objectContaining({ name: "foo" })); + + const [attachment] = tests[0].steps[0].attachments; + + expect(attachment.name).toBe("foo.txt"); + expect(attachments[attachment.source] as string).toBe("bar"); +}); + +it("step with screenshot", async () => { + const { tests, attachments } = await runCypressInlineTest(` + import { step } from "allure-cypress"; + + it("manual", () => { + step("foo", () => { + cy.screenshot("foo"); + }); + }); + `); + + expect(tests).toHaveLength(1); + expect(tests[0].attachments).toHaveLength(0); + expect(tests[0].steps).toHaveLength(1); + expect(tests[0].steps).toContainEqual(expect.objectContaining({ name: "foo" })); + + const [attachment] = tests[0].steps[0].attachments; + + expect(attachment.name).toBe("foo"); + expect(attachment.type).toBe(ContentType.PNG); + expect(attachments).toHaveProperty(attachment.source); +}); + +it("step with cypress assertion error", async () => { + const { tests } = await runCypressInlineTest(` + import { step } from "allure-cypress"; + + it("step", () => { + step("foo", () => { + cy.wrap(1).should("eq", 2); + }); + }); + `); + + expect(tests).toHaveLength(1); + expect(tests[0].status).toBe(Status.FAILED); + expect(tests[0].steps).toHaveLength(1); + expect(tests[0].steps).toContainEqual(expect.objectContaining({ name: "foo", status: Status.FAILED })); +}); + +it("step with unexpected error", async () => { + const { tests } = await runCypressInlineTest(` + import { step } from "allure-cypress"; + + it("step", () => { + step("foo", () => { + throw new Error("foo"); + }); + }); + `); + + expect(tests).toHaveLength(1); + expect(tests[0].status).toBe(Status.BROKEN); + expect(tests[0].steps).toHaveLength(1); + expect(tests[0].steps).toContainEqual(expect.objectContaining({ name: "foo", status: Status.BROKEN })); +}); diff --git a/packages/allure-cypress/test/spec/testCaseId.test.ts b/packages/allure-cypress/test/spec/testCaseId.test.ts new file mode 100644 index 000000000..bada8958d --- /dev/null +++ b/packages/allure-cypress/test/spec/testCaseId.test.ts @@ -0,0 +1,15 @@ +import { expect, it } from "vitest"; +import { runCypressInlineTest } from "../utils"; + +it("testCaseId", async () => { + const { tests } = await runCypressInlineTest(` + import { testCaseId } from "allure-cypress"; + + it("sample", () => { + testCaseId("foo"); + }); + `); + + expect(tests).toHaveLength(1); + expect(tests[0].testCaseId).toBe("foo"); +}); diff --git a/packages/allure-cypress/test/spec/titleMetadata.test.ts b/packages/allure-cypress/test/spec/titleMetadata.test.ts new file mode 100644 index 000000000..0e14f12a6 --- /dev/null +++ b/packages/allure-cypress/test/spec/titleMetadata.test.ts @@ -0,0 +1,33 @@ +import { expect, it } from "vitest"; +import { LabelName } from "allure-js-commons"; +import { runCypressInlineTest } from "../utils"; + +it("title metadata", async () => { + const { tests } = await runCypressInlineTest(` + import { label } from "allure-cypress"; + + it("foo @allure.id=1 @allure.label.foo=2", () => { + label("bar", "3"); + }); + `); + + expect(tests).toHaveLength(1); + expect(tests[0].labels).toContainEqual( + expect.objectContaining({ + name: LabelName.ALLURE_ID, + value: "1", + }), + ); + expect(tests[0].labels).toContainEqual( + expect.objectContaining({ + name: "foo", + value: "2", + }), + ); + expect(tests[0].labels).toContainEqual( + expect.objectContaining({ + name: "bar", + value: "3", + }), + ); +}); diff --git a/packages/allure-cypress/test/spec/video.test.ts b/packages/allure-cypress/test/spec/video.test.ts new file mode 100644 index 000000000..d0ce8589b --- /dev/null +++ b/packages/allure-cypress/test/spec/video.test.ts @@ -0,0 +1,56 @@ +import { expect, it } from "vitest"; +import { ContentType } from "allure-js-commons"; +import { runCypressInlineTest } from "../utils"; + +it("attaches same video to each spec in a test", async () => { + const { tests, attachments } = await runCypressInlineTest( + ` + import { historyId } from "allure-cypress"; + + it("foo", () => {}); + + it("bar", () => {}); + `, + () => + ` + const { allureCypress } = require("allure-cypress/reporter"); + + module.exports = { + e2e: { + baseUrl: "https://allurereport.org", + viewportWidth: 1240, + video: true, + setupNodeEvents: (on, config) => { + const reporter = allureCypress(on, { + links: [ + { + type: "issue", + urlTemplate: "https://allurereport.org/issues/%s" + }, + { + type: "tms", + urlTemplate: "https://allurereport.org/tasks/%s" + }, + ] + }); + + on("after:spec", (spec, result) => { + reporter.endSpec(spec, result); + }); + + return config; + }, + }, + }; + `, + ); + + expect(tests).toHaveLength(2); + + const [attachment] = tests[0].attachments; + + expect(attachment.name).toBe("Video"); + expect(attachment.type).toBe(ContentType.MP4); + expect(tests[1].attachments).toContainEqual(attachment); + expect(attachments).toHaveProperty(attachment.source); +}); diff --git a/packages/allure-cypress/test/utils.ts b/packages/allure-cypress/test/utils.ts new file mode 100644 index 000000000..e908e88c4 --- /dev/null +++ b/packages/allure-cypress/test/utils.ts @@ -0,0 +1,112 @@ +import { fork } from "node:child_process"; +import { randomUUID } from "node:crypto"; +import { mkdir, readFile, readdir, writeFile } from "node:fs/promises"; +import { join, resolve } from "node:path"; +import type { AllureResults } from "allure-js-commons"; + +export const runCypressInlineTest = async ( + test: string, + externalConfigFactory?: (tempDir: string) => string, + beforeTestCb?: (tempDir: string) => Promise, +): Promise => { + const res: AllureResults = { + tests: [], + groups: [], + attachments: {}, + }; + const testDir = join(__dirname, "fixtures", randomUUID()); + const cypressTestsDir = join(testDir, "cypress/e2e"); + const cypressSupportDir = join(testDir, "cypress/support"); + const configFilePath = join(testDir, "cypress.config.js"); + const supportFilePath = join(cypressSupportDir, "e2e.js"); + const testFilePath = join(cypressTestsDir, "sample.cy.js"); + const configContent = externalConfigFactory + ? externalConfigFactory(testDir) + : ` + const { allureCypress } = require("allure-cypress/reporter"); + + module.exports = { + e2e: { + baseUrl: "https://allurereport.org", + viewportWidth: 1240, + setupNodeEvents: (on, config) => { + const reporter = allureCypress(on, { + links: [ + { + type: "issue", + urlTemplate: "https://allurereport.org/issues/%s" + }, + { + type: "tms", + urlTemplate: "https://allurereport.org/tasks/%s" + }, + ] + }); + + on("after:spec", (spec, result) => { + reporter.endSpec(spec, result); + }); + + return config; + }, + }, + }; + `; + const supportContent = ` + import "allure-cypress/commands"; + `; + + await mkdir(cypressTestsDir, { recursive: true }); + await mkdir(cypressSupportDir, { recursive: true }); + await writeFile(configFilePath, configContent, "utf8"); + await writeFile(supportFilePath, supportContent, "utf8"); + await writeFile(testFilePath, test, "utf8"); + + if (beforeTestCb) { + await beforeTestCb(testDir); + } + + const moduleRootPath = require.resolve("cypress"); + const modulePath = resolve(moduleRootPath, "../bin/cypress"); + const args = ["run", "-s", testFilePath, "-q"]; + const testProcess = fork(modulePath, args, { + env: { + ...process.env, + }, + cwd: testDir, + stdio: "pipe", + }); + + testProcess.stdout?.setEncoding("utf8").on("data", (chunk) => { + process.stdout.write(String(chunk)); + }); + testProcess.stderr?.setEncoding("utf8").on("data", (chunk) => { + process.stderr.write(String(chunk)); + }); + + return new Promise((resolve, reject) => { + testProcess.on("exit", async () => { + const testResultsDir = join(testDir, "allure-results"); + const resultFiles = await readdir(testResultsDir); + + for (const resultFile of resultFiles) { + if (/-attachment\.\S+$/.test(resultFile)) { + res.attachments[resultFile] = await readFile(join(testResultsDir, resultFile), "utf8"); + continue; + } + + if (/-container\.json$/.test(resultFile)) { + res.groups.push(JSON.parse(await readFile(join(testResultsDir, resultFile), "utf8"))); + continue; + } + + if (/-result\.json$/.test(resultFile)) { + res.tests.push(JSON.parse(await readFile(join(testResultsDir, resultFile), "utf8"))); + continue; + } + } + + return resolve(res); + }); + }); +}; diff --git a/packages/allure-cypress/vitest.config.ts b/packages/allure-cypress/vitest.config.ts new file mode 100644 index 000000000..8f5ca52bf --- /dev/null +++ b/packages/allure-cypress/vitest.config.ts @@ -0,0 +1,11 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + fileParallelism: false, + testTimeout: 25000, + reporters: [ + "default", + ], + }, +}); diff --git a/packages/allure-decorators/package.json b/packages/allure-decorators/package.json index 5a0592ca2..b2ff419c4 100644 --- a/packages/allure-decorators/package.json +++ b/packages/allure-decorators/package.json @@ -1,6 +1,6 @@ { "name": "allure-decorators", - "version": "2.15.0", + "version": "2.15.1", "description": "Write your tests in a Java-like annotation-driven manner via JS decorators.", "keywords": [ "typescript", diff --git a/packages/allure-jasmine/package.json b/packages/allure-jasmine/package.json index e9c70b86a..ae47b8751 100644 --- a/packages/allure-jasmine/package.json +++ b/packages/allure-jasmine/package.json @@ -1,6 +1,6 @@ { "name": "allure-jasmine", - "version": "2.15.0", + "version": "2.15.1", "description": "Allure Jasmine integration", "homepage": "https://allurereport.org/", "repository": { diff --git a/packages/allure-jest/.gitignore b/packages/allure-jest/.gitignore new file mode 100644 index 000000000..8be5c353a --- /dev/null +++ b/packages/allure-jest/.gitignore @@ -0,0 +1 @@ +test/fixtures/ diff --git a/packages/allure-jest/package.json b/packages/allure-jest/package.json index baf5870c0..04696b8ac 100644 --- a/packages/allure-jest/package.json +++ b/packages/allure-jest/package.json @@ -1,6 +1,6 @@ { "name": "allure-jest", - "version": "2.15.0", + "version": "2.15.1", "description": "Allure Jest integration", "keywords": [ "jest", @@ -42,6 +42,7 @@ "coverage": "codecov", "lint": "eslint ./src --ext .ts", "lint:fix": "eslint ./src --ext .ts --fix", + "pretest": "rimraf ./test/fixtures", "test": "jest" }, "dependencies": { diff --git a/packages/allure-jest/test/utils.ts b/packages/allure-jest/test/utils.ts index f5ba2431a..a336f0829 100644 --- a/packages/allure-jest/test/utils.ts +++ b/packages/allure-jest/test/utils.ts @@ -1,6 +1,6 @@ import { fork } from "node:child_process"; import { randomUUID } from "node:crypto"; -import { mkdir, rm, writeFile } from "node:fs/promises"; +import { mkdir, writeFile } from "node:fs/promises"; import { join } from "node:path"; import type { AllureResults, TestResult, TestResultContainer } from "allure-js-commons"; @@ -79,10 +79,6 @@ export const runJestInlineTest = async (test: string): Promise => }); return new Promise((resolve) => { - testProcess.on("exit", async () => { - await rm(testDir, { recursive: true }); - - return resolve(res); - }); + testProcess.on("exit", () => resolve(res)); }); }; diff --git a/packages/allure-js-commons/package.json b/packages/allure-js-commons/package.json index 6e460bd81..70490f701 100644 --- a/packages/allure-js-commons/package.json +++ b/packages/allure-js-commons/package.json @@ -1,6 +1,6 @@ { "name": "allure-js-commons", - "version": "2.15.0", + "version": "2.15.1", "description": "Allure JS Commons", "homepage": "https://allurereport.org/", "repository": { diff --git a/packages/allure-mocha/package.json b/packages/allure-mocha/package.json index c48883901..a8a1550d0 100644 --- a/packages/allure-mocha/package.json +++ b/packages/allure-mocha/package.json @@ -1,6 +1,6 @@ { "name": "allure-mocha", - "version": "2.15.0", + "version": "2.15.1", "description": "Allure Mocha integration", "keywords": [ "mocha", diff --git a/packages/allure-playwright/package.json b/packages/allure-playwright/package.json index 1891292f2..19d44e5f6 100644 --- a/packages/allure-playwright/package.json +++ b/packages/allure-playwright/package.json @@ -1,6 +1,6 @@ { "name": "allure-playwright", - "version": "2.15.0", + "version": "2.15.1", "description": "Allure Playwright integration", "keywords": [ "playwright", diff --git a/packages/allure-vitest/package.json b/packages/allure-vitest/package.json index 650f97c1b..410dd4f1f 100644 --- a/packages/allure-vitest/package.json +++ b/packages/allure-vitest/package.json @@ -1,6 +1,6 @@ { "name": "allure-vitest", - "version": "2.15.0", + "version": "2.15.1", "description": "Allure Vitest integration", "keywords": [ "vitest", @@ -41,7 +41,7 @@ "compile": "tsc", "generate-report": "allure generate ./out/allure-results -o ./out/allure-report --clean", "allure-report": "allure serve ./out/allure-results", - "pretest": "run compile", + "pretest": "run compile && rimraf ./test/fixtures", "test": "vitest run --dir ./test/spec --config ./vitest.config.ts", "lint": "eslint ./src --ext .ts", "lint:fix": "eslint ./src --ext .ts --fix" @@ -65,6 +65,6 @@ "rimraf": "^5.0.1", "typescript": "^5.2.2", "vite": "^5.0.11", - "vitest": "^1.1.3" + "vitest": "^1.4.0" } } diff --git a/packages/allure-vitest/test/utils.ts b/packages/allure-vitest/test/utils.ts index 5e6fec861..3ac0c4464 100644 --- a/packages/allure-vitest/test/utils.ts +++ b/packages/allure-vitest/test/utils.ts @@ -1,6 +1,6 @@ import { fork } from "node:child_process"; import { randomUUID } from "node:crypto"; -import { mkdir, rm, writeFile } from "node:fs/promises"; +import { mkdir, writeFile } from "node:fs/promises"; import { dirname, join } from "node:path"; import { fileURLToPath } from "url"; import type { AllureResults, TestResult, TestResultContainer } from "allure-js-commons"; @@ -58,7 +58,7 @@ export const runVitestInlineTest = async ( await beforeTestCb(testDir); } - const modulePath = require.resolve("vitest/dist/cli-wrapper.js"); + const modulePath = require.resolve("vitest/vitest.mjs"); const args = ["run", "--config", configFilePath, "--dir", testDir]; const testProcess = fork(modulePath, args, { env: { @@ -96,10 +96,6 @@ export const runVitestInlineTest = async ( }); return new Promise((resolve, reject) => { - testProcess.on("exit", async () => { - await rm(testDir, { recursive: true }); - - return resolve(res); - }); + testProcess.on("exit", () => resolve(res)); }); }; diff --git a/packages/allure-vitest/vitest.config.ts b/packages/allure-vitest/vitest.config.ts index ed182e86f..cfd540a67 100644 --- a/packages/allure-vitest/vitest.config.ts +++ b/packages/allure-vitest/vitest.config.ts @@ -4,6 +4,7 @@ import AllureReporter from "allure-vitest/reporter"; export default defineConfig({ test: { testTimeout: 10000, + fileParallelism: false, setupFiles: ["allure-vitest/setup"], reporters: [ "default", diff --git a/packages/hermione-allure/.gitignore b/packages/hermione-allure/.gitignore new file mode 100644 index 000000000..8be5c353a --- /dev/null +++ b/packages/hermione-allure/.gitignore @@ -0,0 +1 @@ +test/fixtures/ diff --git a/packages/hermione-allure/package.json b/packages/hermione-allure/package.json index 17fd71152..a6430fcbb 100644 --- a/packages/hermione-allure/package.json +++ b/packages/hermione-allure/package.json @@ -1,6 +1,6 @@ { "name": "hermione-allure", - "version": "2.15.0", + "version": "2.15.1", "keywords": [ "hermione", "typescript", diff --git a/packages/hermione-allure/test/utils.ts b/packages/hermione-allure/test/utils.ts index 30f8e0da6..382e5bcd4 100644 --- a/packages/hermione-allure/test/utils.ts +++ b/packages/hermione-allure/test/utils.ts @@ -36,7 +36,7 @@ export const runHermioneInlineTest = async (test: string) => { // eslint-disable-next-line no-console console.error(err); } finally { - await rm(testDir, { recursive: true }); + // await rm(testDir, { recursive: true }); } return { diff --git a/packages/newman-reporter-allure/package.json b/packages/newman-reporter-allure/package.json index 3632af3c6..c6730bec9 100644 --- a/packages/newman-reporter-allure/package.json +++ b/packages/newman-reporter-allure/package.json @@ -1,6 +1,6 @@ { "name": "newman-reporter-allure", - "version": "2.15.0", + "version": "2.15.1", "description": "Allure Newman integration", "keywords": [ "allure", diff --git a/yarn.lock b/yarn.lock index a8d4c77fc..6d3790edd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2277,7 +2277,7 @@ __metadata: languageName: node linkType: hard -"@types/jest@npm:^29.5.11, @types/jest@npm:^29.5.12": +"@types/jest@npm:^29.5.11": version: 29.5.12 resolution: "@types/jest@npm:29.5.12" dependencies: @@ -2400,7 +2400,7 @@ __metadata: languageName: node linkType: hard -"@types/normalize-package-data@npm:^2.4.1": +"@types/normalize-package-data@npm:^2.4.0, @types/normalize-package-data@npm:^2.4.1": version: 2.4.4 resolution: "@types/normalize-package-data@npm:2.4.4" checksum: 65dff72b543997b7be8b0265eca7ace0e34b75c3e5fee31de11179d08fa7124a7a5587265d53d0409532ecb7f7fba662c2012807963e1f9b059653ec2c83ee05 @@ -2693,29 +2693,40 @@ __metadata: languageName: node linkType: hard -"@vitest/expect@npm:1.3.1": - version: 1.3.1 - resolution: "@vitest/expect@npm:1.3.1" +"@vitest/expect@npm:1.4.0": + version: 1.4.0 + resolution: "@vitest/expect@npm:1.4.0" dependencies: - "@vitest/spy": 1.3.1 - "@vitest/utils": 1.3.1 - chai: ^4.3.10 - checksum: 3626b02f0471c9be3a86f599cf8fcdeb3fc01f121390c5e4a2badfa3191052f7ea7b41f75991a08021ef96214e62c4750fbea58e32b48bf6132e03aee68d1f14 + "@vitest/spy": "npm:1.4.0" + "@vitest/utils": "npm:1.4.0" + chai: "npm:^4.3.10" + checksum: aca8b0b592bc020febb08767a230a2f4118453904972df06b2a34c76a669e8eb260ddfd8b0cdc152e93dbf21e0d7ae98bdf09fa80477b21145ac21c01fc5a0d3 languageName: node linkType: hard -"@vitest/runner@npm:1.3.1": - version: 1.3.1 - resolution: "@vitest/runner@npm:1.3.1" +"@vitest/runner@npm:1.4.0": + version: 1.4.0 + resolution: "@vitest/runner@npm:1.4.0" dependencies: - "@vitest/utils": 1.3.1 - p-limit: ^5.0.0 - pathe: ^1.1.1 - checksum: 86dfb4d485b2db4a120d853a93f017ab43001f18cdceba487f81b62bfbb26ea58cf9545e42a3bfed9c1181ca42547c5c6d5e5d580e299e841d70546b3db8f987 + "@vitest/utils": "npm:1.4.0" + p-limit: "npm:^5.0.0" + pathe: "npm:^1.1.1" + checksum: 41a847d1ba916c64e482a69342222a40b81014ad06da7ccb7d8cd4119c5718564c22b00367574803642e6ca6ab5678509073b5c460bedc2b385d4e990351012f languageName: node linkType: hard -"@vitest/snapshot@npm:1.3.1, @vitest/snapshot@npm:^1.2.2": +"@vitest/snapshot@npm:1.4.0": + version: 1.4.0 + resolution: "@vitest/snapshot@npm:1.4.0" + dependencies: + magic-string: "npm:^0.30.5" + pathe: "npm:^1.1.1" + pretty-format: "npm:^29.7.0" + checksum: fe495661d682534b41f3ac373c017ac84c04263087a715307715bb41a69c307d6f237b18cc8195bc22d82bf38a1a1a773b0c99715d5de5f40c6169e916b8f4a4 + languageName: node + linkType: hard + +"@vitest/snapshot@npm:^1.2.2": version: 1.3.1 resolution: "@vitest/snapshot@npm:1.3.1" dependencies: @@ -2726,24 +2737,24 @@ __metadata: languageName: node linkType: hard -"@vitest/spy@npm:1.3.1": - version: 1.3.1 - resolution: "@vitest/spy@npm:1.3.1" +"@vitest/spy@npm:1.4.0": + version: 1.4.0 + resolution: "@vitest/spy@npm:1.4.0" dependencies: - tinyspy: ^2.2.0 - checksum: f52e4d23822fe69369224327a33466dc373619ed239ff6142ed0abea857e9b102bb7630c3987d8493af7273eee579d9190d647a3e9f83774603ac7d29b849747 + tinyspy: "npm:^2.2.0" + checksum: 3b1c422760e5840e9e4aa804de7619f3d14e0b364b29f8f030df528206b84c5706792c5d680ac668077d5663f8648a17a783df11cd90ddf2a11000359f1a6286 languageName: node linkType: hard -"@vitest/utils@npm:1.3.1": - version: 1.3.1 - resolution: "@vitest/utils@npm:1.3.1" +"@vitest/utils@npm:1.4.0": + version: 1.4.0 + resolution: "@vitest/utils@npm:1.4.0" dependencies: - diff-sequences: ^29.6.3 - estree-walker: ^3.0.3 - loupe: ^2.3.7 - pretty-format: ^29.7.0 - checksum: dab1f66c223a4de90d01a9ba03a6110edd110794675a9e73a2b3af689bbaee2371a0a0afd93e6b9447bcf61659c60727ece343a3e04b734f178f542a53586ef0 + diff-sequences: "npm:^29.6.3" + estree-walker: "npm:^3.0.3" + loupe: "npm:^2.3.7" + pretty-format: "npm:^29.7.0" + checksum: 5b54e36e5ad236da1da548d31e3b080d1798179f787cfb9ac512d03e59401f8baaa96fec15b6de6b969ee0e057660289109a69a39bd988e89aa72625b5f78484 languageName: node linkType: hard @@ -3269,19 +3280,17 @@ __metadata: version: 0.0.0-use.local resolution: "allure-cypress@workspace:packages/allure-cypress" dependencies: - "@jest/globals": ^29.7.0 "@rollup/plugin-commonjs": ^25.0.7 "@rollup/plugin-node-resolve": ^15.2.3 "@rollup/plugin-typescript": ^11.1.6 "@types/eslint": ^8 "@types/glob": ^8.1.0 - "@types/jest": ^29.5.12 "@types/mocha": ^10.0.1 "@types/node": ^20.6.3 "@typescript-eslint/eslint-plugin": ^6.7.0 "@typescript-eslint/parser": ^6.7.0 - allure-jest: "workspace:*" allure-js-commons: "workspace:*" + allure-vitest: "workspace:*" cypress: ^13.6.0 enquirer: ^2.3.6 eslint: ^8.49.0 @@ -3292,14 +3301,13 @@ __metadata: eslint-plugin-no-null: ^1.0.2 eslint-plugin-prefer-arrow: ^1.2.3 glob: ^10.3.5 - jest: ^29.7.0 - npm-run-all: ^4.1.5 + npm-run-all2: ^5.0.0 rimraf: ^5.0.1 rollup: ^4.13.0 - ts-jest: ^29.1.2 ts-node: ^10.9.2 tslib: ^2.6.2 typescript: ^5.2.2 + vitest: ^1.4.0 languageName: unknown linkType: soft @@ -3360,7 +3368,7 @@ __metadata: languageName: unknown linkType: soft -"allure-jest@workspace:*, allure-jest@workspace:packages/allure-jest": +"allure-jest@workspace:packages/allure-jest": version: 0.0.0-use.local resolution: "allure-jest@workspace:packages/allure-jest" dependencies: @@ -3524,7 +3532,7 @@ __metadata: languageName: unknown linkType: soft -"allure-vitest@workspace:packages/allure-vitest": +"allure-vitest@workspace:*, allure-vitest@workspace:packages/allure-vitest": version: 0.0.0-use.local resolution: "allure-vitest@workspace:packages/allure-vitest" dependencies: @@ -3544,7 +3552,7 @@ __metadata: rimraf: ^5.0.1 typescript: ^5.2.2 vite: ^5.0.11 - vitest: ^1.1.3 + vitest: ^1.4.0 languageName: unknown linkType: soft @@ -12334,7 +12342,7 @@ __metadata: languageName: node linkType: hard -"normalize-package-data@npm:^2.3.2": +"normalize-package-data@npm:^2.3.2, normalize-package-data@npm:^2.5.0": version: 2.5.0 resolution: "normalize-package-data@npm:2.5.0" dependencies: @@ -12386,6 +12394,25 @@ __metadata: languageName: node linkType: hard +"npm-run-all2@npm:^5.0.0": + version: 5.0.2 + resolution: "npm-run-all2@npm:5.0.2" + dependencies: + ansi-styles: ^5.0.0 + cross-spawn: ^7.0.3 + memorystream: ^0.3.1 + minimatch: ^3.0.4 + pidtree: ^0.5.0 + read-pkg: ^5.2.0 + shell-quote: ^1.6.1 + bin: + npm-run-all: bin/npm-run-all/index.js + run-p: bin/run-p/index.js + run-s: bin/run-s/index.js + checksum: c52091478d5873a9f65132983459cc7f0869bbef0fd015e72f1ee1a78d50570e80c2239a8ba9a6c68c0c4898d749e3e8478df51abd9807b01c4ba461ee90aa2f + languageName: node + linkType: hard + "npm-run-all@npm:^4.1.5": version: 4.1.5 resolution: "npm-run-all@npm:4.1.5" @@ -12948,7 +12975,7 @@ __metadata: languageName: node linkType: hard -"parse-json@npm:^5.2.0": +"parse-json@npm:^5.0.0, parse-json@npm:^5.2.0": version: 5.2.0 resolution: "parse-json@npm:5.2.0" dependencies: @@ -13191,6 +13218,15 @@ __metadata: languageName: node linkType: hard +"pidtree@npm:^0.5.0": + version: 0.5.0 + resolution: "pidtree@npm:0.5.0" + bin: + pidtree: bin/pidtree.js + checksum: 371cd14bbc9bdee2a6a44596dd521dd3565e223481e0b1afffdca3f1c29831850bfa7784114dc30d245d37e7d186cec035e036256b39f75d878d19498fe0df6a + languageName: node + linkType: hard + "pify@npm:^2.2.0": version: 2.3.0 resolution: "pify@npm:2.3.0" @@ -13976,6 +14012,18 @@ __metadata: languageName: node linkType: hard +"read-pkg@npm:^5.2.0": + version: 5.2.0 + resolution: "read-pkg@npm:5.2.0" + dependencies: + "@types/normalize-package-data": ^2.4.0 + normalize-package-data: ^2.5.0 + parse-json: ^5.0.0 + type-fest: ^0.6.0 + checksum: eb696e60528b29aebe10e499ba93f44991908c57d70f2d26f369e46b8b9afc208ef11b4ba64f67630f31df8b6872129e0a8933c8c53b7b4daf0eace536901222 + languageName: node + linkType: hard + "read-pkg@npm:^8.1.0": version: 8.1.0 resolution: "read-pkg@npm:8.1.0" @@ -16283,6 +16331,13 @@ __metadata: languageName: node linkType: hard +"type-fest@npm:^0.6.0": + version: 0.6.0 + resolution: "type-fest@npm:0.6.0" + checksum: b2188e6e4b21557f6e92960ec496d28a51d68658018cba8b597bd3ef757721d1db309f120ae987abeeda874511d14b776157ff809f23c6d1ce8f83b9b2b7d60f + languageName: node + linkType: hard + "type-fest@npm:^2.12.2, type-fest@npm:^2.19.0": version: 2.19.0 resolution: "type-fest@npm:2.19.0" @@ -16823,18 +16878,18 @@ __metadata: languageName: node linkType: hard -"vite-node@npm:1.3.1": - version: 1.3.1 - resolution: "vite-node@npm:1.3.1" +"vite-node@npm:1.4.0": + version: 1.4.0 + resolution: "vite-node@npm:1.4.0" dependencies: - cac: ^6.7.14 - debug: ^4.3.4 - pathe: ^1.1.1 - picocolors: ^1.0.0 - vite: ^5.0.0 + cac: "npm:^6.7.14" + debug: "npm:^4.3.4" + pathe: "npm:^1.1.1" + picocolors: "npm:^1.0.0" + vite: "npm:^5.0.0" bin: vite-node: vite-node.mjs - checksum: 62a0bd2cdb70160b5107011d10f60d76e8ede6dbad1dcac99d57e4b4c0b21683e40a7e6088b7e221a4db0b70fb83ace8e13a0f1c5bf1c0d38e2bf9c0bab17b17 + checksum: 1abbeac935a5e1e3b6161974ae28b6a3ec88766b06bc082ab3f2883345ee74f5643f3004df1c7808c2b52d445ffbd067bb79a1a3920c2eaa7ca8084b11b7de46 languageName: node linkType: hard @@ -16878,35 +16933,35 @@ __metadata: languageName: node linkType: hard -"vitest@npm:^1.1.3": - version: 1.3.1 - resolution: "vitest@npm:1.3.1" - dependencies: - "@vitest/expect": 1.3.1 - "@vitest/runner": 1.3.1 - "@vitest/snapshot": 1.3.1 - "@vitest/spy": 1.3.1 - "@vitest/utils": 1.3.1 - acorn-walk: ^8.3.2 - chai: ^4.3.10 - debug: ^4.3.4 - execa: ^8.0.1 - local-pkg: ^0.5.0 - magic-string: ^0.30.5 - pathe: ^1.1.1 - picocolors: ^1.0.0 - std-env: ^3.5.0 - strip-literal: ^2.0.0 - tinybench: ^2.5.1 - tinypool: ^0.8.2 - vite: ^5.0.0 - vite-node: 1.3.1 - why-is-node-running: ^2.2.2 +"vitest@npm:^1.4.0": + version: 1.4.0 + resolution: "vitest@npm:1.4.0" + dependencies: + "@vitest/expect": "npm:1.4.0" + "@vitest/runner": "npm:1.4.0" + "@vitest/snapshot": "npm:1.4.0" + "@vitest/spy": "npm:1.4.0" + "@vitest/utils": "npm:1.4.0" + acorn-walk: "npm:^8.3.2" + chai: "npm:^4.3.10" + debug: "npm:^4.3.4" + execa: "npm:^8.0.1" + local-pkg: "npm:^0.5.0" + magic-string: "npm:^0.30.5" + pathe: "npm:^1.1.1" + picocolors: "npm:^1.0.0" + std-env: "npm:^3.5.0" + strip-literal: "npm:^2.0.0" + tinybench: "npm:^2.5.1" + tinypool: "npm:^0.8.2" + vite: "npm:^5.0.0" + vite-node: "npm:1.4.0" + why-is-node-running: "npm:^2.2.2" peerDependencies: "@edge-runtime/vm": "*" "@types/node": ^18.0.0 || >=20.0.0 - "@vitest/browser": 1.3.1 - "@vitest/ui": 1.3.1 + "@vitest/browser": 1.4.0 + "@vitest/ui": 1.4.0 happy-dom: "*" jsdom: "*" peerDependenciesMeta: @@ -16924,7 +16979,7 @@ __metadata: optional: true bin: vitest: vitest.mjs - checksum: 6f760296d825537ca69b7ff321ab839385d26336aefd7b52aac6e16cfcb3e5b3dfda31e51315f2be9f7aebdc87db5ce6739294ebc3f9c4ca256dff96ee0c06ed + checksum: e7141c0ecc629c350d8c718051fb19219ca88a100d335fedbe481c4320f285380e3235316a69a330514c34663fcafa37c801151162d0a538e92821e7faad71a6 languageName: node linkType: hard