diff --git a/e2e/ci-e2e/tests/basic.e2e.test.ts b/e2e/ci-e2e/tests/basic.e2e.test.ts index 45ad0dae3..47e46042b 100644 --- a/e2e/ci-e2e/tests/basic.e2e.test.ts +++ b/e2e/ci-e2e/tests/basic.e2e.test.ts @@ -1,7 +1,6 @@ import { readFile, rename } from 'node:fs/promises'; import path from 'node:path'; import type { SimpleGit } from 'simple-git'; -import { afterEach } from 'vitest'; import { type GitRefs, type Options, diff --git a/e2e/ci-e2e/tests/npm-workspaces.e2e.test.ts b/e2e/ci-e2e/tests/npm-workspaces.e2e.test.ts index f28ce458c..c063f08a2 100644 --- a/e2e/ci-e2e/tests/npm-workspaces.e2e.test.ts +++ b/e2e/ci-e2e/tests/npm-workspaces.e2e.test.ts @@ -1,7 +1,6 @@ import { readFile, rename } from 'node:fs/promises'; import path from 'node:path'; import type { SimpleGit } from 'simple-git'; -import { afterEach } from 'vitest'; import { type GitRefs, type Options, diff --git a/e2e/ci-e2e/tests/nx-monorepo.e2e.test.ts b/e2e/ci-e2e/tests/nx-monorepo.e2e.test.ts index a542703a6..4c6a7d579 100644 --- a/e2e/ci-e2e/tests/nx-monorepo.e2e.test.ts +++ b/e2e/ci-e2e/tests/nx-monorepo.e2e.test.ts @@ -1,7 +1,6 @@ import { readFile, rename, writeFile } from 'node:fs/promises'; import path from 'node:path'; import type { SimpleGit } from 'simple-git'; -import { afterEach } from 'vitest'; import { type GitRefs, type Options, diff --git a/e2e/ci-e2e/tsconfig.test.json b/e2e/ci-e2e/tsconfig.test.json index 307a55e79..e9dfc330f 100644 --- a/e2e/ci-e2e/tsconfig.test.json +++ b/e2e/ci-e2e/tsconfig.test.json @@ -8,6 +8,7 @@ "vitest.e2e.config.ts", "tests/**/*.e2e.test.ts", "tests/**/*.d.ts", - "mocks/**/*.ts" + "mocks/**/*.ts", + "../../testing/test-setup/src/vitest.d.ts" ] } diff --git a/e2e/cli-e2e/tests/collect.e2e.test.ts b/e2e/cli-e2e/tests/collect.e2e.test.ts index e20db01e6..ef883ec98 100644 --- a/e2e/cli-e2e/tests/collect.e2e.test.ts +++ b/e2e/cli-e2e/tests/collect.e2e.test.ts @@ -1,6 +1,5 @@ import { cp } from 'node:fs/promises'; import path from 'node:path'; -import { afterEach, beforeAll, describe, expect, it } from 'vitest'; import { nxTargetProject } from '@code-pushup/test-nx-utils'; import { E2E_ENVIRONMENTS_DIR, diff --git a/e2e/cli-e2e/tests/compare.e2e.test.ts b/e2e/cli-e2e/tests/compare.e2e.test.ts index 3869581f2..6ae87307f 100644 --- a/e2e/cli-e2e/tests/compare.e2e.test.ts +++ b/e2e/cli-e2e/tests/compare.e2e.test.ts @@ -1,6 +1,5 @@ import { cp } from 'node:fs/promises'; import path from 'node:path'; -import { beforeAll } from 'vitest'; import type { ReportsDiff } from '@code-pushup/models'; import { nxTargetProject } from '@code-pushup/test-nx-utils'; import { diff --git a/e2e/cli-e2e/tests/print-config.e2e.test.ts b/e2e/cli-e2e/tests/print-config.e2e.test.ts index 630d3bb2a..44b65419d 100644 --- a/e2e/cli-e2e/tests/print-config.e2e.test.ts +++ b/e2e/cli-e2e/tests/print-config.e2e.test.ts @@ -1,6 +1,5 @@ import { cp, readFile } from 'node:fs/promises'; import path from 'node:path'; -import { beforeAll, expect } from 'vitest'; import { nxTargetProject } from '@code-pushup/test-nx-utils'; import { E2E_ENVIRONMENTS_DIR, diff --git a/e2e/cli-e2e/tsconfig.test.json b/e2e/cli-e2e/tsconfig.test.json index 307a55e79..e9dfc330f 100644 --- a/e2e/cli-e2e/tsconfig.test.json +++ b/e2e/cli-e2e/tsconfig.test.json @@ -8,6 +8,7 @@ "vitest.e2e.config.ts", "tests/**/*.e2e.test.ts", "tests/**/*.d.ts", - "mocks/**/*.ts" + "mocks/**/*.ts", + "../../testing/test-setup/src/vitest.d.ts" ] } diff --git a/e2e/create-cli-e2e/tests/init.e2e.test.ts b/e2e/create-cli-e2e/tests/init.e2e.test.ts index a9752ef9c..b65960323 100644 --- a/e2e/create-cli-e2e/tests/init.e2e.test.ts +++ b/e2e/create-cli-e2e/tests/init.e2e.test.ts @@ -1,5 +1,4 @@ import path from 'node:path'; -import { afterEach, expect } from 'vitest'; import { nxTargetProject } from '@code-pushup/test-nx-utils'; import { E2E_ENVIRONMENTS_DIR, diff --git a/e2e/create-cli-e2e/tsconfig.test.json b/e2e/create-cli-e2e/tsconfig.test.json index 307a55e79..e9dfc330f 100644 --- a/e2e/create-cli-e2e/tsconfig.test.json +++ b/e2e/create-cli-e2e/tsconfig.test.json @@ -8,6 +8,7 @@ "vitest.e2e.config.ts", "tests/**/*.e2e.test.ts", "tests/**/*.d.ts", - "mocks/**/*.ts" + "mocks/**/*.ts", + "../../testing/test-setup/src/vitest.d.ts" ] } diff --git a/e2e/nx-plugin-e2e/tests/executor-cli.e2e.test.ts b/e2e/nx-plugin-e2e/tests/executor-cli.e2e.test.ts index a3827a20c..f8ece8c73 100644 --- a/e2e/nx-plugin-e2e/tests/executor-cli.e2e.test.ts +++ b/e2e/nx-plugin-e2e/tests/executor-cli.e2e.test.ts @@ -1,7 +1,6 @@ import { type Tree, updateProjectConfiguration } from '@nx/devkit'; import path from 'node:path'; import { readProjectConfiguration } from 'nx/src/generators/utils/project-configuration'; -import { afterAll, afterEach, beforeEach, expect } from 'vitest'; import { type AutorunCommandExecutorOptions, generateCodePushupConfig, diff --git a/e2e/nx-plugin-e2e/tests/generator-configuration.e2e.test.ts b/e2e/nx-plugin-e2e/tests/generator-configuration.e2e.test.ts index 1bf4e00b8..06b699e3b 100644 --- a/e2e/nx-plugin-e2e/tests/generator-configuration.e2e.test.ts +++ b/e2e/nx-plugin-e2e/tests/generator-configuration.e2e.test.ts @@ -1,7 +1,6 @@ import type { Tree } from '@nx/devkit'; import { readFile } from 'node:fs/promises'; import path from 'node:path'; -import { afterEach, expect } from 'vitest'; import { generateCodePushupConfig } from '@code-pushup/nx-plugin'; import { generateWorkspaceAndProject, diff --git a/e2e/nx-plugin-e2e/tests/generator-init.e2e.test.ts b/e2e/nx-plugin-e2e/tests/generator-init.e2e.test.ts index 3ad4b7645..3ba2a78b3 100644 --- a/e2e/nx-plugin-e2e/tests/generator-init.e2e.test.ts +++ b/e2e/nx-plugin-e2e/tests/generator-init.e2e.test.ts @@ -1,7 +1,6 @@ import type { Tree } from '@nx/devkit'; import { readFile } from 'node:fs/promises'; import path from 'node:path'; -import { afterEach, expect } from 'vitest'; import { generateWorkspaceAndProject, materializeTree, diff --git a/e2e/nx-plugin-e2e/tests/plugin-create-nodes.e2e.test.ts b/e2e/nx-plugin-e2e/tests/plugin-create-nodes.e2e.test.ts index 2b98174a1..a8512e4e3 100644 --- a/e2e/nx-plugin-e2e/tests/plugin-create-nodes.e2e.test.ts +++ b/e2e/nx-plugin-e2e/tests/plugin-create-nodes.e2e.test.ts @@ -1,7 +1,6 @@ import type { Tree } from '@nx/devkit'; import path from 'node:path'; import { readProjectConfiguration } from 'nx/src/generators/utils/project-configuration'; -import { afterEach, expect } from 'vitest'; import { generateCodePushupConfig } from '@code-pushup/nx-plugin'; import { generateWorkspaceAndProject, diff --git a/e2e/nx-plugin-e2e/tests/plugin-plugins-config.e2e.test.ts b/e2e/nx-plugin-e2e/tests/plugin-plugins-config.e2e.test.ts index 6aeb7bb29..549149dac 100644 --- a/e2e/nx-plugin-e2e/tests/plugin-plugins-config.e2e.test.ts +++ b/e2e/nx-plugin-e2e/tests/plugin-plugins-config.e2e.test.ts @@ -1,7 +1,6 @@ import type { Tree } from '@nx/devkit'; import path from 'node:path'; import { readProjectConfiguration } from 'nx/src/generators/utils/project-configuration'; -import { afterEach, expect } from 'vitest'; import { generateCodePushupConfig } from '@code-pushup/nx-plugin'; import { generateWorkspaceAndProject, diff --git a/e2e/nx-plugin-e2e/tsconfig.test.json b/e2e/nx-plugin-e2e/tsconfig.test.json index 307a55e79..e9dfc330f 100644 --- a/e2e/nx-plugin-e2e/tsconfig.test.json +++ b/e2e/nx-plugin-e2e/tsconfig.test.json @@ -8,6 +8,7 @@ "vitest.e2e.config.ts", "tests/**/*.e2e.test.ts", "tests/**/*.d.ts", - "mocks/**/*.ts" + "mocks/**/*.ts", + "../../testing/test-setup/src/vitest.d.ts" ] } diff --git a/e2e/plugin-axe-e2e/tests/collect.e2e.test.ts b/e2e/plugin-axe-e2e/tests/collect.e2e.test.ts index f8ff3e610..22063f187 100644 --- a/e2e/plugin-axe-e2e/tests/collect.e2e.test.ts +++ b/e2e/plugin-axe-e2e/tests/collect.e2e.test.ts @@ -1,6 +1,5 @@ import { cp } from 'node:fs/promises'; import path from 'node:path'; -import { afterAll, beforeAll, describe, expect, it } from 'vitest'; import { type Report, reportSchema } from '@code-pushup/models'; import { omitVariableReportData } from '@code-pushup/test-fixtures'; import { nxTargetProject } from '@code-pushup/test-nx-utils'; diff --git a/e2e/plugin-axe-e2e/tsconfig.test.json b/e2e/plugin-axe-e2e/tsconfig.test.json index c212b6893..a56a1a31f 100644 --- a/e2e/plugin-axe-e2e/tsconfig.test.json +++ b/e2e/plugin-axe-e2e/tsconfig.test.json @@ -9,6 +9,7 @@ "vitest.e2e.config.ts", "tests/**/*.e2e.test.ts", "tests/**/*.d.ts", - "mocks/**/*.ts" + "mocks/**/*.ts", + "../../testing/test-setup/src/vitest.d.ts" ] } diff --git a/e2e/plugin-coverage-e2e/mocks/fixtures/basic-setup/src/index.test.mjs b/e2e/plugin-coverage-e2e/mocks/fixtures/basic-setup/src/index.test.mjs index d02988166..ed302efb7 100644 --- a/e2e/plugin-coverage-e2e/mocks/fixtures/basic-setup/src/index.test.mjs +++ b/e2e/plugin-coverage-e2e/mocks/fixtures/basic-setup/src/index.test.mjs @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import { get42, isEven, untested } from './index.mjs'; describe('get42', () => { diff --git a/e2e/plugin-coverage-e2e/tests/collect.e2e.test.ts b/e2e/plugin-coverage-e2e/tests/collect.e2e.test.ts index 31bd9850f..16ff3631f 100644 --- a/e2e/plugin-coverage-e2e/tests/collect.e2e.test.ts +++ b/e2e/plugin-coverage-e2e/tests/collect.e2e.test.ts @@ -1,7 +1,6 @@ import { cp } from 'node:fs/promises'; import path from 'node:path'; import { simpleGit } from 'simple-git'; -import { afterAll, afterEach, beforeAll } from 'vitest'; import { type Report, reportSchema } from '@code-pushup/models'; import { omitVariableReportData } from '@code-pushup/test-fixtures'; import { nxTargetProject } from '@code-pushup/test-nx-utils'; diff --git a/e2e/plugin-coverage-e2e/tsconfig.test.json b/e2e/plugin-coverage-e2e/tsconfig.test.json index dd2036995..b197a2266 100644 --- a/e2e/plugin-coverage-e2e/tsconfig.test.json +++ b/e2e/plugin-coverage-e2e/tsconfig.test.json @@ -10,6 +10,7 @@ "vitest.e2e.config.ts", "tests/**/*.e2e.test.ts", "tests/**/*.d.ts", - "mocks/**/*.ts" + "mocks/**/*.ts", + "../../testing/test-setup/src/vitest.d.ts" ] } diff --git a/e2e/plugin-eslint-e2e/tests/collect.e2e.test.ts b/e2e/plugin-eslint-e2e/tests/collect.e2e.test.ts index e0931f92f..05a0be8e5 100644 --- a/e2e/plugin-eslint-e2e/tests/collect.e2e.test.ts +++ b/e2e/plugin-eslint-e2e/tests/collect.e2e.test.ts @@ -1,6 +1,5 @@ import { cp } from 'node:fs/promises'; import path from 'node:path'; -import { afterAll, afterEach, beforeAll, describe, expect, it } from 'vitest'; import { type Report, reportSchema } from '@code-pushup/models'; import { omitVariableReportData } from '@code-pushup/test-fixtures'; import { nxTargetProject } from '@code-pushup/test-nx-utils'; diff --git a/e2e/plugin-eslint-e2e/tsconfig.test.json b/e2e/plugin-eslint-e2e/tsconfig.test.json index 616740f36..b9d83abcb 100644 --- a/e2e/plugin-eslint-e2e/tsconfig.test.json +++ b/e2e/plugin-eslint-e2e/tsconfig.test.json @@ -10,6 +10,7 @@ "vitest.e2e.config.ts", "tests/**/*.e2e.test.ts", "tests/**/*.d.ts", - "mocks/**/*.ts" + "mocks/**/*.ts", + "../../testing/test-setup/src/vitest.d.ts" ] } diff --git a/e2e/plugin-js-packages-e2e/tests/plugin-js-packages.e2e.test.ts b/e2e/plugin-js-packages-e2e/tests/plugin-js-packages.e2e.test.ts index b5bd882ad..e26b7deaa 100644 --- a/e2e/plugin-js-packages-e2e/tests/plugin-js-packages.e2e.test.ts +++ b/e2e/plugin-js-packages-e2e/tests/plugin-js-packages.e2e.test.ts @@ -1,6 +1,5 @@ import { cp } from 'node:fs/promises'; import path from 'node:path'; -import { afterAll, beforeAll, expect, it } from 'vitest'; import { type AuditReport, type Report, diff --git a/e2e/plugin-js-packages-e2e/tsconfig.test.json b/e2e/plugin-js-packages-e2e/tsconfig.test.json index 616740f36..b9d83abcb 100644 --- a/e2e/plugin-js-packages-e2e/tsconfig.test.json +++ b/e2e/plugin-js-packages-e2e/tsconfig.test.json @@ -10,6 +10,7 @@ "vitest.e2e.config.ts", "tests/**/*.e2e.test.ts", "tests/**/*.d.ts", - "mocks/**/*.ts" + "mocks/**/*.ts", + "../../testing/test-setup/src/vitest.d.ts" ] } diff --git a/e2e/plugin-jsdocs-e2e/tests/collect.e2e.test.ts b/e2e/plugin-jsdocs-e2e/tests/collect.e2e.test.ts index 09c6f6113..5c27c2113 100644 --- a/e2e/plugin-jsdocs-e2e/tests/collect.e2e.test.ts +++ b/e2e/plugin-jsdocs-e2e/tests/collect.e2e.test.ts @@ -1,7 +1,6 @@ import { cp } from 'node:fs/promises'; import path from 'node:path'; import { simpleGit } from 'simple-git'; -import { afterAll, afterEach, beforeAll, describe, expect, it } from 'vitest'; import { type Report, reportSchema } from '@code-pushup/models'; import { omitVariableReportData } from '@code-pushup/test-fixtures'; import { nxTargetProject } from '@code-pushup/test-nx-utils'; diff --git a/e2e/plugin-jsdocs-e2e/tsconfig.test.json b/e2e/plugin-jsdocs-e2e/tsconfig.test.json index 616740f36..b9d83abcb 100644 --- a/e2e/plugin-jsdocs-e2e/tsconfig.test.json +++ b/e2e/plugin-jsdocs-e2e/tsconfig.test.json @@ -10,6 +10,7 @@ "vitest.e2e.config.ts", "tests/**/*.e2e.test.ts", "tests/**/*.d.ts", - "mocks/**/*.ts" + "mocks/**/*.ts", + "../../testing/test-setup/src/vitest.d.ts" ] } diff --git a/e2e/plugin-lighthouse-e2e/tests/collect.e2e.test.ts b/e2e/plugin-lighthouse-e2e/tests/collect.e2e.test.ts index 5bd1db014..620ac6868 100644 --- a/e2e/plugin-lighthouse-e2e/tests/collect.e2e.test.ts +++ b/e2e/plugin-lighthouse-e2e/tests/collect.e2e.test.ts @@ -1,6 +1,5 @@ import { cp } from 'node:fs/promises'; import path from 'node:path'; -import { afterAll, beforeAll, expect } from 'vitest'; import { type Report, reportSchema } from '@code-pushup/models'; import { omitVariableReportData } from '@code-pushup/test-fixtures'; import { nxTargetProject } from '@code-pushup/test-nx-utils'; diff --git a/e2e/plugin-lighthouse-e2e/tsconfig.test.json b/e2e/plugin-lighthouse-e2e/tsconfig.test.json index c212b6893..a56a1a31f 100644 --- a/e2e/plugin-lighthouse-e2e/tsconfig.test.json +++ b/e2e/plugin-lighthouse-e2e/tsconfig.test.json @@ -9,6 +9,7 @@ "vitest.e2e.config.ts", "tests/**/*.e2e.test.ts", "tests/**/*.d.ts", - "mocks/**/*.ts" + "mocks/**/*.ts", + "../../testing/test-setup/src/vitest.d.ts" ] } diff --git a/e2e/plugin-typescript-e2e/tests/collect.e2e.test.ts b/e2e/plugin-typescript-e2e/tests/collect.e2e.test.ts index 00df879ad..f2077392f 100644 --- a/e2e/plugin-typescript-e2e/tests/collect.e2e.test.ts +++ b/e2e/plugin-typescript-e2e/tests/collect.e2e.test.ts @@ -1,6 +1,5 @@ import { cp } from 'node:fs/promises'; import path from 'node:path'; -import { afterAll, beforeAll, expect } from 'vitest'; import { type Report, reportSchema } from '@code-pushup/models'; import { omitVariableReportData, diff --git a/e2e/plugin-typescript-e2e/tsconfig.test.json b/e2e/plugin-typescript-e2e/tsconfig.test.json index c212b6893..a56a1a31f 100644 --- a/e2e/plugin-typescript-e2e/tsconfig.test.json +++ b/e2e/plugin-typescript-e2e/tsconfig.test.json @@ -9,6 +9,7 @@ "vitest.e2e.config.ts", "tests/**/*.e2e.test.ts", "tests/**/*.d.ts", - "mocks/**/*.ts" + "mocks/**/*.ts", + "../../testing/test-setup/src/vitest.d.ts" ] } diff --git a/examples/plugins/tsconfig.test.json b/examples/plugins/tsconfig.test.json index b243bb3c5..54cacd82f 100644 --- a/examples/plugins/tsconfig.test.json +++ b/examples/plugins/tsconfig.test.json @@ -12,6 +12,7 @@ "src/**/*.test.tsx", "src/**/*.test.js", "src/**/*.test.jsx", - "src/**/*.d.ts" + "src/**/*.d.ts", + "../../testing/test-setup/src/vitest.d.ts" ] } diff --git a/packages/ci/src/lib/cli/context.unit.test.ts b/packages/ci/src/lib/cli/context.unit.test.ts index a95707361..1cfed37c7 100644 --- a/packages/ci/src/lib/cli/context.unit.test.ts +++ b/packages/ci/src/lib/cli/context.unit.test.ts @@ -1,4 +1,3 @@ -import { expect } from 'vitest'; import { DEFAULT_SETTINGS } from '../settings.js'; import { type CommandContext, createCommandContext } from './context.js'; diff --git a/packages/ci/src/lib/run.int.test.ts b/packages/ci/src/lib/run.int.test.ts index 6798ada8c..7cf5b6dad 100644 --- a/packages/ci/src/lib/run.int.test.ts +++ b/packages/ci/src/lib/run.int.test.ts @@ -9,7 +9,7 @@ import { import path from 'node:path'; import { fileURLToPath } from 'node:url'; import { type SimpleGit, simpleGit } from 'simple-git'; -import { type MockInstance, expect } from 'vitest'; +import type { MockInstance } from 'vitest'; import { type ReportFragment, downloadReportFromPortal, diff --git a/packages/ci/src/lib/schemas.unit.test.ts b/packages/ci/src/lib/schemas.unit.test.ts index f11074076..7f25ea917 100644 --- a/packages/ci/src/lib/schemas.unit.test.ts +++ b/packages/ci/src/lib/schemas.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import { ZodError } from 'zod'; import type { ConfigPatterns } from './models.js'; import { configPatternsSchema, interpolatedSlugSchema } from './schemas.js'; diff --git a/packages/cli/src/lib/autorun/autorun-command.unit.test.ts b/packages/cli/src/lib/autorun/autorun-command.unit.test.ts index a44d4a2bb..26f430aaa 100644 --- a/packages/cli/src/lib/autorun/autorun-command.unit.test.ts +++ b/packages/cli/src/lib/autorun/autorun-command.unit.test.ts @@ -1,5 +1,4 @@ import { vol } from 'memfs'; -import { describe, expect, it, vi } from 'vitest'; import { uploadReportToPortal } from '@code-pushup/portal-client'; import { collectAndPersistReports, readRcByPath } from '@code-pushup/core'; import { MINIMAL_REPORT_MOCK } from '@code-pushup/test-fixtures'; diff --git a/packages/cli/src/lib/collect/collect-command.unit.test.ts b/packages/cli/src/lib/collect/collect-command.unit.test.ts index 71dd50339..237531010 100644 --- a/packages/cli/src/lib/collect/collect-command.unit.test.ts +++ b/packages/cli/src/lib/collect/collect-command.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it, vi } from 'vitest'; import { collectAndPersistReports, readRcByPath } from '@code-pushup/core'; import { DEFAULT_PERSIST_FILENAME, diff --git a/packages/cli/src/lib/history/history-command.unit.test.ts b/packages/cli/src/lib/history/history-command.unit.test.ts index d7016526d..626bf556d 100644 --- a/packages/cli/src/lib/history/history-command.unit.test.ts +++ b/packages/cli/src/lib/history/history-command.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, vi } from 'vitest'; import { type HistoryOptions, history } from '@code-pushup/core'; import { safeCheckout } from '@code-pushup/utils'; import { DEFAULT_CLI_CONFIGURATION } from '../../../mocks/constants.js'; @@ -73,6 +72,6 @@ describe('history-command', () => { expect.any(Array), ); - expect(safeCheckout).toHaveBeenCalledTimes(1); + expect(safeCheckout).toHaveBeenCalledOnce(); }); }); diff --git a/packages/cli/src/lib/history/utils.unit.test.ts b/packages/cli/src/lib/history/utils.unit.test.ts index fe42bae77..df791fd63 100644 --- a/packages/cli/src/lib/history/utils.unit.test.ts +++ b/packages/cli/src/lib/history/utils.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, vi } from 'vitest'; import type { HistoryOptions } from '@code-pushup/core'; import type { HistoryCliOptions } from './history.model.js'; import { normalizeHashOptions } from './utils.js'; diff --git a/packages/cli/src/lib/implementation/core-config.int.test.ts b/packages/cli/src/lib/implementation/core-config.int.test.ts index c933eccfe..a805fb9f7 100644 --- a/packages/cli/src/lib/implementation/core-config.int.test.ts +++ b/packages/cli/src/lib/implementation/core-config.int.test.ts @@ -1,5 +1,4 @@ import ansis from 'ansis'; -import { describe, expect, vi } from 'vitest'; import { type CoreConfig, DEFAULT_PERSIST_FILENAME, diff --git a/packages/cli/src/lib/implementation/core-config.middleware.int.test.ts b/packages/cli/src/lib/implementation/core-config.middleware.int.test.ts index 9b37cceb4..4aeba1175 100644 --- a/packages/cli/src/lib/implementation/core-config.middleware.int.test.ts +++ b/packages/cli/src/lib/implementation/core-config.middleware.int.test.ts @@ -1,6 +1,5 @@ import path from 'node:path'; import { fileURLToPath } from 'node:url'; -import { describe, expect } from 'vitest'; import { coreConfigMiddleware } from './core-config.middleware.js'; const configDirPath = path.join( diff --git a/packages/cli/src/lib/implementation/core-config.middleware.unit.test.ts b/packages/cli/src/lib/implementation/core-config.middleware.unit.test.ts index 11e2e1e96..ed0724e72 100644 --- a/packages/cli/src/lib/implementation/core-config.middleware.unit.test.ts +++ b/packages/cli/src/lib/implementation/core-config.middleware.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, vi } from 'vitest'; import { autoloadRc, readRcByPath } from '@code-pushup/core'; import { coreConfigMiddleware, diff --git a/packages/cli/src/lib/implementation/filter.middleware.utils.unit.test.ts b/packages/cli/src/lib/implementation/filter.middleware.utils.unit.test.ts index 692b5c689..69cc2c88c 100644 --- a/packages/cli/src/lib/implementation/filter.middleware.utils.unit.test.ts +++ b/packages/cli/src/lib/implementation/filter.middleware.utils.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect } from 'vitest'; import type { CategoryRef } from '@code-pushup/models'; import { extractSkippedItems, @@ -22,7 +21,7 @@ describe('isValidCategoryRef', () => { plugin: 'p1', weight: 1, } satisfies CategoryRef; - expect(isValidCategoryRef(ref, plugins)).toBe(true); + expect(isValidCategoryRef(ref, plugins)).toBeTrue(); }); it('should return false for skipped audit ref', () => { @@ -32,7 +31,7 @@ describe('isValidCategoryRef', () => { plugin: 'p1', weight: 1, } satisfies CategoryRef; - expect(isValidCategoryRef(ref, plugins)).toBe(false); + expect(isValidCategoryRef(ref, plugins)).toBeFalse(); }); it('should return true for valid group ref', () => { @@ -42,7 +41,7 @@ describe('isValidCategoryRef', () => { plugin: 'p1', weight: 1, } satisfies CategoryRef; - expect(isValidCategoryRef(ref, plugins)).toBe(true); + expect(isValidCategoryRef(ref, plugins)).toBeTrue(); }); it('should return false for skipped group ref', () => { @@ -52,7 +51,7 @@ describe('isValidCategoryRef', () => { plugin: 'p1', weight: 1, } satisfies CategoryRef; - expect(isValidCategoryRef(ref, plugins)).toBe(false); + expect(isValidCategoryRef(ref, plugins)).toBeFalse(); }); it('should return false for nonexistent plugin', () => { @@ -62,7 +61,7 @@ describe('isValidCategoryRef', () => { plugin: 'nonexistent', weight: 1, } satisfies CategoryRef; - expect(isValidCategoryRef(ref, plugins)).toBe(false); + expect(isValidCategoryRef(ref, plugins)).toBeFalse(); }); }); diff --git a/packages/cli/src/lib/implementation/formatting.unit.test.ts b/packages/cli/src/lib/implementation/formatting.unit.test.ts index c1b9fc943..363b80a7a 100644 --- a/packages/cli/src/lib/implementation/formatting.unit.test.ts +++ b/packages/cli/src/lib/implementation/formatting.unit.test.ts @@ -1,5 +1,4 @@ import ansis from 'ansis'; -import { describe, expect } from 'vitest'; import { descriptionStyle, formatNestedValues, diff --git a/packages/cli/src/lib/implementation/global.utils.unit.test.ts b/packages/cli/src/lib/implementation/global.utils.unit.test.ts index 7d538096a..b44e68ba7 100644 --- a/packages/cli/src/lib/implementation/global.utils.unit.test.ts +++ b/packages/cli/src/lib/implementation/global.utils.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it, vi } from 'vitest'; import { logger } from '@code-pushup/utils'; import { filterKebabCaseKeys, logErrorBeforeThrow } from './global.utils.js'; import { OptionValidationError } from './validate-filter-options.utils.js'; diff --git a/packages/cli/src/lib/implementation/set-verbose.middleware.unit.test.ts b/packages/cli/src/lib/implementation/set-verbose.middleware.unit.test.ts index 26ce8845a..5e1164a6e 100644 --- a/packages/cli/src/lib/implementation/set-verbose.middleware.unit.test.ts +++ b/packages/cli/src/lib/implementation/set-verbose.middleware.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import { logger } from '@code-pushup/utils'; import { setVerboseMiddleware } from './set-verbose.middleware.js'; diff --git a/packages/cli/src/lib/implementation/validate-filter-options.utils.unit.test.ts b/packages/cli/src/lib/implementation/validate-filter-options.utils.unit.test.ts index cbb5f0eb4..ed6b83ffe 100644 --- a/packages/cli/src/lib/implementation/validate-filter-options.utils.unit.test.ts +++ b/packages/cli/src/lib/implementation/validate-filter-options.utils.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect } from 'vitest'; import type { CategoryConfig, PluginConfig } from '@code-pushup/models'; import { logger } from '@code-pushup/utils'; import type { FilterOptionType, Filterables } from './filter.model.js'; @@ -131,7 +130,7 @@ describe('validateFilterOption', () => { { itemsToFilter: ['p1'], skippedItems: [] }, ); expect(logger.warn).not.toHaveBeenCalled(); - expect(logger.info).toHaveBeenCalledTimes(1); + expect(logger.info).toHaveBeenCalledOnce(); expect(logger.info).toHaveBeenCalledWith( 'The --onlyPlugins argument removed the following categories: c1, c3.', ); @@ -499,7 +498,7 @@ describe('pluginHasZeroWeightRefs', () => { }, ], } as PluginConfig), - ).toBe(true); + ).toBeTrue(); }); it('should return false if any ref has non-zero weight', () => { @@ -522,12 +521,12 @@ describe('pluginHasZeroWeightRefs', () => { }, ], } as PluginConfig), - ).toBe(false); + ).toBeFalse(); }); it('should return false if there are no groups', () => { - expect(pluginHasZeroWeightRefs({ groups: undefined } as PluginConfig)).toBe( - false, - ); + expect( + pluginHasZeroWeightRefs({ groups: undefined } as PluginConfig), + ).toBeFalse(); }); }); diff --git a/packages/cli/src/lib/print-config/print-config-command.unit.test.ts b/packages/cli/src/lib/print-config/print-config-command.unit.test.ts index 789b7f7fd..7264b0703 100644 --- a/packages/cli/src/lib/print-config/print-config-command.unit.test.ts +++ b/packages/cli/src/lib/print-config/print-config-command.unit.test.ts @@ -1,7 +1,6 @@ import ansis from 'ansis'; import { readFile } from 'node:fs/promises'; import path from 'node:path'; -import { describe, expect, vi } from 'vitest'; import { MEMFS_VOLUME } from '@code-pushup/test-utils'; import { logger } from '@code-pushup/utils'; import { DEFAULT_CLI_CONFIGURATION } from '../../../mocks/constants.js'; diff --git a/packages/cli/src/lib/upload/upload-command.unit.test.ts b/packages/cli/src/lib/upload/upload-command.unit.test.ts index 13a54c83a..867ed936f 100644 --- a/packages/cli/src/lib/upload/upload-command.unit.test.ts +++ b/packages/cli/src/lib/upload/upload-command.unit.test.ts @@ -1,5 +1,4 @@ import { vol } from 'memfs'; -import { describe, expect, it } from 'vitest'; import { uploadReportToPortal } from '@code-pushup/portal-client'; import { readRcByPath } from '@code-pushup/core'; import { MINIMAL_REPORT_MOCK } from '@code-pushup/test-fixtures'; diff --git a/packages/cli/src/lib/yargs-cli.int.test.ts b/packages/cli/src/lib/yargs-cli.int.test.ts index e34a04b8b..bc3c03030 100644 --- a/packages/cli/src/lib/yargs-cli.int.test.ts +++ b/packages/cli/src/lib/yargs-cli.int.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import type { CompareOptions } from '@code-pushup/core'; import type { CoreConfig, Format } from '@code-pushup/models'; import { yargsHistoryOptionsDefinition } from './history/history.options.js'; @@ -51,7 +50,7 @@ describe('yargsCli', () => { const parsedArgv = await yargsCli(['--no-verbose'], { options, }).parseAsync(); - expect(parsedArgv.verbose).toBe(false); + expect(parsedArgv.verbose).toBeFalse(); }); it('should parse a single config argument as a string', async () => { @@ -84,7 +83,7 @@ describe('yargsCli', () => { ['--verbose', '--tsconfig', 'tsconfig.json'], { options }, ).parseAsync(); - expect(parsedArgv.verbose).toBe(true); + expect(parsedArgv.verbose).toBeTrue(); expect(parsedArgv.tsconfig).toBe('tsconfig.json'); }); @@ -109,7 +108,7 @@ describe('yargsCli', () => { ['--no-progress', '--verbose'], { options }, ).parseAsync(); - expect(parsedArgv.verbose).toBe(true); + expect(parsedArgv.verbose).toBeTrue(); }); it('should handle global options and middleware argument overrides correctly', async () => { diff --git a/packages/core/src/lib/collect-and-persist.unit.test.ts b/packages/core/src/lib/collect-and-persist.unit.test.ts index 256275d62..4aaf2f50f 100644 --- a/packages/core/src/lib/collect-and-persist.unit.test.ts +++ b/packages/core/src/lib/collect-and-persist.unit.test.ts @@ -1,4 +1,4 @@ -import { type MockInstance, describe } from 'vitest'; +import type { MockInstance } from 'vitest'; import { MINIMAL_CONFIG_MOCK, MINIMAL_REPORT_MOCK, diff --git a/packages/core/src/lib/history.unit.test.ts b/packages/core/src/lib/history.unit.test.ts index b1d964d03..b39a49752 100644 --- a/packages/core/src/lib/history.unit.test.ts +++ b/packages/core/src/lib/history.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, vi } from 'vitest'; import { MINIMAL_PLUGIN_CONFIG_MOCK } from '@code-pushup/test-fixtures'; import { getCurrentBranchOrTag, safeCheckout } from '@code-pushup/utils'; import { collectAndPersistReports } from './collect-and-persist.js'; @@ -28,6 +27,11 @@ describe('history', () => { outputDir: '.code-pushup', filename: 'history-report', format: ['json'], + skipReports: false, + }, + cache: { + read: false, + write: false, }, plugins: [MINIMAL_PLUGIN_CONFIG_MOCK], }; @@ -35,7 +39,7 @@ describe('history', () => { it('should check out all passed commits and reset to initial branch or tag', async () => { await history(historyBaseOptions, ['abc', 'def']); - expect(getCurrentBranchOrTag).toHaveBeenCalledTimes(1); + expect(getCurrentBranchOrTag).toHaveBeenCalledOnce(); expect(safeCheckout).toHaveBeenCalledTimes(3); // walk commit history @@ -53,7 +57,7 @@ describe('history', () => { it('should call collect with correct filename and format', async () => { await history(historyBaseOptions, ['abc']); - expect(collectAndPersistReports).toHaveBeenCalledTimes(1); + expect(collectAndPersistReports).toHaveBeenCalledOnce(); expect(collectAndPersistReports).toHaveBeenNthCalledWith( 1, expect.objectContaining({ @@ -78,7 +82,7 @@ describe('history', () => { }; await history(historyOptions, ['abc']); - expect(upload).toHaveBeenCalledTimes(1); + expect(upload).toHaveBeenCalledOnce(); expect(upload).toHaveBeenCalledWith( expect.objectContaining({ persist: expect.objectContaining({ filename: 'abc-report' }), diff --git a/packages/core/src/lib/implementation/collect.int.test.ts b/packages/core/src/lib/implementation/collect.int.test.ts index 929ca8304..bdc2ae500 100644 --- a/packages/core/src/lib/implementation/collect.int.test.ts +++ b/packages/core/src/lib/implementation/collect.int.test.ts @@ -1,6 +1,5 @@ import { writeFile } from 'node:fs/promises'; import path from 'node:path'; -import { describe, expect, it } from 'vitest'; import { commitSchema } from '@code-pushup/models'; import { MINIMAL_CONFIG_MOCK } from '@code-pushup/test-fixtures'; import { cleanTestFolder } from '@code-pushup/test-utils'; diff --git a/packages/core/src/lib/implementation/execute-plugin.unit.test.ts b/packages/core/src/lib/implementation/execute-plugin.unit.test.ts index aa5dcfdb1..ffab30b2f 100644 --- a/packages/core/src/lib/implementation/execute-plugin.unit.test.ts +++ b/packages/core/src/lib/implementation/execute-plugin.unit.test.ts @@ -1,6 +1,6 @@ import ansis from 'ansis'; import { vol } from 'memfs'; -import { type MockInstance, describe, expect, it, vi } from 'vitest'; +import type { MockInstance } from 'vitest'; import { type AuditOutputs, DEFAULT_PERSIST_CONFIG, diff --git a/packages/core/src/lib/implementation/persist.unit.test.ts b/packages/core/src/lib/implementation/persist.unit.test.ts index d7fe2f6d0..17e26281e 100644 --- a/packages/core/src/lib/implementation/persist.unit.test.ts +++ b/packages/core/src/lib/implementation/persist.unit.test.ts @@ -2,7 +2,6 @@ import ansis from 'ansis'; import { vol } from 'memfs'; import { readFile } from 'node:fs/promises'; import path from 'node:path'; -import { beforeEach, describe, expect, it } from 'vitest'; import type { Report } from '@code-pushup/models'; import { MINIMAL_REPORT_MOCK, REPORT_MOCK } from '@code-pushup/test-fixtures'; import { MEMFS_VOLUME } from '@code-pushup/test-utils'; diff --git a/packages/core/src/lib/implementation/read-rc-file.int.test.ts b/packages/core/src/lib/implementation/read-rc-file.int.test.ts index 006ea0a7a..59a520175 100644 --- a/packages/core/src/lib/implementation/read-rc-file.int.test.ts +++ b/packages/core/src/lib/implementation/read-rc-file.int.test.ts @@ -1,6 +1,5 @@ import path from 'node:path'; import { fileURLToPath } from 'node:url'; -import { describe, expect } from 'vitest'; import { readRcByPath } from './read-rc-file.js'; describe('readRcByPath', () => { diff --git a/packages/core/src/lib/implementation/read-rc-file.unit.test.ts b/packages/core/src/lib/implementation/read-rc-file.unit.test.ts index 54387069b..9f72ca34b 100644 --- a/packages/core/src/lib/implementation/read-rc-file.unit.test.ts +++ b/packages/core/src/lib/implementation/read-rc-file.unit.test.ts @@ -1,5 +1,4 @@ import { vol } from 'memfs'; -import { describe, expect, vi } from 'vitest'; import { CONFIG_FILE_NAME, type CoreConfig } from '@code-pushup/models'; import { MEMFS_VOLUME } from '@code-pushup/test-utils'; import { autoloadRc } from './read-rc-file.js'; diff --git a/packages/core/src/lib/implementation/report-to-gql.unit.test.ts b/packages/core/src/lib/implementation/report-to-gql.unit.test.ts index 1de787cbe..a78bd6878 100644 --- a/packages/core/src/lib/implementation/report-to-gql.unit.test.ts +++ b/packages/core/src/lib/implementation/report-to-gql.unit.test.ts @@ -1,4 +1,3 @@ -import { describe } from 'vitest'; import { type AuditReportTree, TreeType } from '@code-pushup/portal-client'; import { issueToGQL, tableToGQL, treeToGQL } from './report-to-gql.js'; diff --git a/packages/core/src/lib/normalize.unit.test.ts b/packages/core/src/lib/normalize.unit.test.ts index 05333203d..c9c2cb62e 100644 --- a/packages/core/src/lib/normalize.unit.test.ts +++ b/packages/core/src/lib/normalize.unit.test.ts @@ -1,5 +1,4 @@ import path from 'node:path'; -import { describe, expect } from 'vitest'; import type { AuditOutput, Issue } from '@code-pushup/models'; import { normalizeAuditOutputs, normalizeIssue } from './normalize.js'; diff --git a/packages/core/src/lib/upload.unit.test.ts b/packages/core/src/lib/upload.unit.test.ts index 9615cb8cb..800f5edae 100644 --- a/packages/core/src/lib/upload.unit.test.ts +++ b/packages/core/src/lib/upload.unit.test.ts @@ -1,5 +1,4 @@ import { vol } from 'memfs'; -import { describe, expect } from 'vitest'; import { uploadReportToPortal } from '@code-pushup/portal-client'; import { MINIMAL_REPORT_MOCK } from '@code-pushup/test-fixtures'; import { ISO_STRING_REGEXP, MEMFS_VOLUME } from '@code-pushup/test-utils'; diff --git a/packages/create-cli/src/lib/init.unit.test.ts b/packages/create-cli/src/lib/init.unit.test.ts index 2ad9a52fc..854eef638 100644 --- a/packages/create-cli/src/lib/init.unit.test.ts +++ b/packages/create-cli/src/lib/init.unit.test.ts @@ -1,5 +1,4 @@ import { vol } from 'memfs'; -import { afterEach, beforeEach, describe, expect } from 'vitest'; import { MEMFS_VOLUME } from '@code-pushup/test-utils'; import type { ProcessResult } from '@code-pushup/utils'; import * as utils from '@code-pushup/utils'; @@ -54,7 +53,7 @@ describe('initCodePushup', () => { await initCodePushup(); - expect(spySetupNxContext).toHaveBeenCalledTimes(1); + expect(spySetupNxContext).toHaveBeenCalledOnce(); expect(spyExecuteProcess).toHaveBeenNthCalledWith(1, { command: 'npx', @@ -74,7 +73,7 @@ describe('initCodePushup', () => { expect(spyParseNxProcessOutput).toHaveBeenNthCalledWith(1, 'stdout-mock'); expect(spyParseNxProcessOutput).toHaveBeenCalledTimes(2); expect(spyExecuteProcess).toHaveBeenCalledTimes(2); - expect(spyTeardownNxContext).toHaveBeenCalledTimes(1); + expect(spyTeardownNxContext).toHaveBeenCalledOnce(); expect(spyTeardownNxContext).toHaveBeenNthCalledWith(1, { projectName: projectJson.name, nxJsonTeardown: false, @@ -93,8 +92,8 @@ describe('initCodePushup', () => { await initCodePushup(); - expect(spySetupNxContext).toHaveBeenCalledTimes(1); - expect(spyTeardownNxContext).toHaveBeenCalledTimes(1); + expect(spySetupNxContext).toHaveBeenCalledOnce(); + expect(spyTeardownNxContext).toHaveBeenCalledOnce(); expect(spyTeardownNxContext).toHaveBeenNthCalledWith(1, { projectName: projectJson.name, nxJsonTeardown: true, @@ -117,8 +116,8 @@ describe('initCodePushup', () => { await initCodePushup(); - expect(spySetupNxContext).toHaveBeenCalledTimes(1); - expect(spyTeardownNxContext).toHaveBeenCalledTimes(1); + expect(spySetupNxContext).toHaveBeenCalledOnce(); + expect(spyTeardownNxContext).toHaveBeenCalledOnce(); expect(spyTeardownNxContext).toHaveBeenNthCalledWith(1, { projectName: 'source-root', nxJsonTeardown: false, diff --git a/packages/create-cli/src/lib/utils.unit.test.ts b/packages/create-cli/src/lib/utils.unit.test.ts index f3c0ae24d..f44355076 100644 --- a/packages/create-cli/src/lib/utils.unit.test.ts +++ b/packages/create-cli/src/lib/utils.unit.test.ts @@ -1,6 +1,5 @@ import { vol } from 'memfs'; import { rm } from 'node:fs/promises'; -import { beforeEach, describe, expect } from 'vitest'; import { parseNxProcessOutput, setupNxContext, diff --git a/packages/create-cli/tsconfig.test.json b/packages/create-cli/tsconfig.test.json index 7f9c54833..1be2e51b9 100644 --- a/packages/create-cli/tsconfig.test.json +++ b/packages/create-cli/tsconfig.test.json @@ -11,6 +11,7 @@ "src/**/*.test.tsx", "src/**/*.test.js", "src/**/*.test.jsx", - "src/**/*.d.ts" + "src/**/*.d.ts", + "../../testing/test-setup/src/vitest.d.ts" ] } diff --git a/packages/models/src/lib/audit-output.unit.test.ts b/packages/models/src/lib/audit-output.unit.test.ts index 09baf066a..cbe8efe11 100644 --- a/packages/models/src/lib/audit-output.unit.test.ts +++ b/packages/models/src/lib/audit-output.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import { type AuditOutput, type AuditOutputs, diff --git a/packages/models/src/lib/audit.unit.test.ts b/packages/models/src/lib/audit.unit.test.ts index a681f6041..10b0bfc72 100644 --- a/packages/models/src/lib/audit.unit.test.ts +++ b/packages/models/src/lib/audit.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import { type Audit, auditSchema, pluginAuditsSchema } from './audit.js'; describe('auditSchema', () => { diff --git a/packages/models/src/lib/category-config.unit.test.ts b/packages/models/src/lib/category-config.unit.test.ts index a24b40de6..8ceb38499 100644 --- a/packages/models/src/lib/category-config.unit.test.ts +++ b/packages/models/src/lib/category-config.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import { type CategoryConfig, type CategoryRef, diff --git a/packages/models/src/lib/configuration.unit.test.ts b/packages/models/src/lib/configuration.unit.test.ts index 8e66e2820..83601c5bd 100644 --- a/packages/models/src/lib/configuration.unit.test.ts +++ b/packages/models/src/lib/configuration.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import { artifactGenerationCommandSchema, pluginArtifactOptionsSchema, @@ -23,17 +22,17 @@ describe('artifactGenerationCommandSchema', () => { it('should fail if command is missing', () => { const data = { args: ['eslint', 'src/'] }; - expect(artifactGenerationCommandSchema.safeParse(data).success).toBe(false); + expect(artifactGenerationCommandSchema.safeParse(data).success).toBeFalse(); }); it('should fail if command is empty', () => { const data = { command: '' }; - expect(artifactGenerationCommandSchema.safeParse(data).success).toBe(false); + expect(artifactGenerationCommandSchema.safeParse(data).success).toBeFalse(); }); it('should fail if args is not an array of strings', () => { const data = { command: 'npx', args: [123, true] }; - expect(artifactGenerationCommandSchema.safeParse(data).success).toBe(false); + expect(artifactGenerationCommandSchema.safeParse(data).success).toBeFalse(); }); }); @@ -60,7 +59,7 @@ describe('pluginArtifactOptionsSchema', () => { it('should fail if artifactsPaths is an empty array', () => { const data = { artifactsPaths: [] }; - expect(pluginArtifactOptionsSchema.safeParse(data).success).toBe(false); + expect(pluginArtifactOptionsSchema.safeParse(data).success).toBeFalse(); }); it('should validate with generateArtifactsCommand and artifactsPaths', () => { @@ -79,12 +78,12 @@ describe('pluginArtifactOptionsSchema', () => { it('should fail if artifactsPaths is missing', () => { const data = { generateArtifactsCommand: { command: 'npm' } }; - expect(pluginArtifactOptionsSchema.safeParse(data).success).toBe(false); + expect(pluginArtifactOptionsSchema.safeParse(data).success).toBeFalse(); }); it('should fail if artifactsPaths is not string or array of strings', () => { const data = { artifactsPaths: 123 }; - expect(pluginArtifactOptionsSchema.safeParse(data).success).toBe(false); + expect(pluginArtifactOptionsSchema.safeParse(data).success).toBeFalse(); }); it('should fail if generateArtifactsCommand is invalid', () => { @@ -92,7 +91,7 @@ describe('pluginArtifactOptionsSchema', () => { generateArtifactsCommand: { command: '' }, artifactsPaths: 'dist/report.json', }; - expect(pluginArtifactOptionsSchema.safeParse(data).success).toBe(false); + expect(pluginArtifactOptionsSchema.safeParse(data).success).toBeFalse(); }); it('should validate with generateArtifactsCommand as a string', () => { @@ -114,7 +113,7 @@ describe('pluginArtifactOptionsSchema', () => { generateArtifactsCommand: '', artifactsPaths: 'coverage/lcov.info', }; - expect(pluginArtifactOptionsSchema.safeParse(data).success).toBe(false); + expect(pluginArtifactOptionsSchema.safeParse(data).success).toBeFalse(); }); it('should fail if generateArtifactsCommand is a number', () => { @@ -122,6 +121,6 @@ describe('pluginArtifactOptionsSchema', () => { generateArtifactsCommand: 123, artifactsPaths: 'coverage/lcov.info', }; - expect(pluginArtifactOptionsSchema.safeParse(data).success).toBe(false); + expect(pluginArtifactOptionsSchema.safeParse(data).success).toBeFalse(); }); }); diff --git a/packages/models/src/lib/core-config.unit.test.ts b/packages/models/src/lib/core-config.unit.test.ts index 8561ae575..74cfdfbd7 100644 --- a/packages/models/src/lib/core-config.unit.test.ts +++ b/packages/models/src/lib/core-config.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import { type CoreConfig, coreConfigSchema } from './core-config.js'; describe('coreConfigSchema', () => { diff --git a/packages/models/src/lib/group.unit.test.ts b/packages/models/src/lib/group.unit.test.ts index baef00fd1..5af5ff580 100644 --- a/packages/models/src/lib/group.unit.test.ts +++ b/packages/models/src/lib/group.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import { type Group, type GroupRef, diff --git a/packages/models/src/lib/implementation/schemas.unit.test.ts b/packages/models/src/lib/implementation/schemas.unit.test.ts index 49cfa355d..5c0b0412c 100644 --- a/packages/models/src/lib/implementation/schemas.unit.test.ts +++ b/packages/models/src/lib/implementation/schemas.unit.test.ts @@ -1,4 +1,3 @@ -import { beforeAll, describe, expect, it, vi } from 'vitest'; import { type TableCellValue, docsUrlSchema, diff --git a/packages/models/src/lib/implementation/utils.unit.test.ts b/packages/models/src/lib/implementation/utils.unit.test.ts index 345a5cd36..6a22e84cd 100644 --- a/packages/models/src/lib/implementation/utils.unit.test.ts +++ b/packages/models/src/lib/implementation/utils.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import { filenameRegex, hasDuplicateStrings, @@ -61,7 +60,7 @@ describe('filenameRegex', () => { describe('hasDuplicateStrings', () => { it('should return false for a list of unique strings', () => { - expect(hasDuplicateStrings(['a', 'b'])).toBe(false); + expect(hasDuplicateStrings(['a', 'b'])).toBeFalse(); }); it('should return a list of duplicates for a list with duplicates', () => { @@ -73,21 +72,21 @@ describe('hasDuplicateStrings', () => { }); it('should return false for a list with 1 item', () => { - expect(hasDuplicateStrings(['a'])).toBe(false); + expect(hasDuplicateStrings(['a'])).toBeFalse(); }); }); describe('hasMissingStrings', () => { it('should return false for two identical arrays', () => { - expect(hasMissingStrings(['a', 'b'], ['a', 'b'])).toBe(false); + expect(hasMissingStrings(['a', 'b'], ['a', 'b'])).toBeFalse(); }); it('should return false for an array subset', () => { - expect(hasMissingStrings(['b'], ['a', 'b'])).toBe(false); + expect(hasMissingStrings(['b'], ['a', 'b'])).toBeFalse(); }); it('should return false for two empty arrays', () => { - expect(hasMissingStrings([], [])).toBe(false); + expect(hasMissingStrings([], [])).toBeFalse(); }); it('should return a list of strings from source that are missing in target', () => { diff --git a/packages/models/src/lib/issue.unit.test.ts b/packages/models/src/lib/issue.unit.test.ts index 4a71f9250..e1b87a845 100644 --- a/packages/models/src/lib/issue.unit.test.ts +++ b/packages/models/src/lib/issue.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import { type Issue, issueSchema } from './issue.js'; describe('issueSchema', () => { diff --git a/packages/models/src/lib/persist-config.unit.test.ts b/packages/models/src/lib/persist-config.unit.test.ts index b39cc71e2..ce44724a0 100644 --- a/packages/models/src/lib/persist-config.unit.test.ts +++ b/packages/models/src/lib/persist-config.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import { type PersistConfig, persistConfigSchema } from './persist-config.js'; describe('persistConfigSchema', () => { diff --git a/packages/models/src/lib/plugin-config.unit.test.ts b/packages/models/src/lib/plugin-config.unit.test.ts index 4ff7de38a..5ec0d26f9 100644 --- a/packages/models/src/lib/plugin-config.unit.test.ts +++ b/packages/models/src/lib/plugin-config.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import { ZodError } from 'zod'; import { type PluginConfig, diff --git a/packages/models/src/lib/report.unit.test.ts b/packages/models/src/lib/report.unit.test.ts index eff7fbf83..2998985c1 100644 --- a/packages/models/src/lib/report.unit.test.ts +++ b/packages/models/src/lib/report.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import { type AuditReport, type PluginReport, diff --git a/packages/models/src/lib/runner-config.unit.test.ts b/packages/models/src/lib/runner-config.unit.test.ts index 705628d44..a54e9ba30 100644 --- a/packages/models/src/lib/runner-config.unit.test.ts +++ b/packages/models/src/lib/runner-config.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import { type OutputTransform, type RunnerConfig, diff --git a/packages/models/src/lib/table.unit.test.ts b/packages/models/src/lib/table.unit.test.ts index 53974888f..0f6642960 100644 --- a/packages/models/src/lib/table.unit.test.ts +++ b/packages/models/src/lib/table.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import { type Table, type TableAlignment, diff --git a/packages/models/src/lib/upload-config.unit.test.ts b/packages/models/src/lib/upload-config.unit.test.ts index 38fd95cb5..b6363fe24 100644 --- a/packages/models/src/lib/upload-config.unit.test.ts +++ b/packages/models/src/lib/upload-config.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import { type UploadConfig, uploadConfigSchema } from './upload-config.js'; describe('uploadConfigSchema', () => { diff --git a/packages/models/tsconfig.test.json b/packages/models/tsconfig.test.json index 67645f7d5..c590b8068 100644 --- a/packages/models/tsconfig.test.json +++ b/packages/models/tsconfig.test.json @@ -13,6 +13,7 @@ "src/**/*.test.tsx", "src/**/*.test.js", "src/**/*.test.jsx", - "src/**/*.d.ts" + "src/**/*.d.ts", + "../../testing/test-setup/src/vitest.d.ts" ] } diff --git a/packages/nx-plugin/src/executors/cli/executor.int.test.ts b/packages/nx-plugin/src/executors/cli/executor.int.test.ts index 4bde33d79..aa5b4329d 100644 --- a/packages/nx-plugin/src/executors/cli/executor.int.test.ts +++ b/packages/nx-plugin/src/executors/cli/executor.int.test.ts @@ -1,4 +1,3 @@ -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import { executorContext } from '@code-pushup/test-nx-utils'; import * as executeProcessModule from '../../internal/execute-process.js'; import runCliExecutor from './executor.js'; @@ -29,9 +28,9 @@ describe('runCliExecutor', () => { { verbose: true }, executorContext('utils'), ); - expect(output.success).toBe(true); + expect(output.success).toBeTrue(); - expect(parseCliExecutorOptionsSpy).toHaveBeenCalledTimes(1); + expect(parseCliExecutorOptionsSpy).toHaveBeenCalledOnce(); //is context normalized expect(parseCliExecutorOptionsSpy).toHaveBeenCalledWith( @@ -40,7 +39,7 @@ describe('runCliExecutor', () => { projectConfig: expect.objectContaining({ name: 'utils' }), }), ); - expect(executeProcessSpy).toHaveBeenCalledTimes(1); + expect(executeProcessSpy).toHaveBeenCalledOnce(); expect(executeProcessSpy).toHaveBeenCalledWith({ command: 'npx', args: expect.arrayContaining(['@code-pushup/cli']), @@ -56,8 +55,8 @@ describe('runCliExecutor', () => { }, executorContext('utils'), ); - expect(output.success).toBe(true); - expect(executeProcessSpy).toHaveBeenCalledTimes(1); + expect(output.success).toBeTrue(); + expect(executeProcessSpy).toHaveBeenCalledOnce(); expect(executeProcessSpy).toHaveBeenCalledWith( expect.objectContaining({ env: expect.objectContaining({ diff --git a/packages/nx-plugin/src/executors/cli/executor.unit.test.ts b/packages/nx-plugin/src/executors/cli/executor.unit.test.ts index 120b4bbfd..c03550126 100644 --- a/packages/nx-plugin/src/executors/cli/executor.unit.test.ts +++ b/packages/nx-plugin/src/executors/cli/executor.unit.test.ts @@ -1,13 +1,3 @@ -import { - afterAll, - afterEach, - beforeAll, - beforeEach, - describe, - expect, - it, - vi, -} from 'vitest'; import { executorContext } from '@code-pushup/test-nx-utils'; import { MEMFS_VOLUME } from '@code-pushup/test-utils'; import * as executeProcessModule from '../../internal/execute-process.js'; @@ -51,7 +41,7 @@ describe('runCliExecutor', () => { it('should call executeProcess with return result', async () => { const output = await runCliExecutor({}, executorContext('utils')); - expect(output.success).toBe(true); + expect(output.success).toBeTrue(); expect(output.command).toMatch('npx @code-pushup/cli'); expect(executeProcessSpy).toHaveBeenCalledWith({ command: 'npx', @@ -68,7 +58,7 @@ describe('runCliExecutor', () => { cwd: 'cwd-form-context', }, ); - expect(output.success).toBe(true); + expect(output.success).toBeTrue(); expect(output.command).toMatch('npx @code-pushup/cli'); expect(output.command).toContain('cwd-form-context'); expect(executeProcessSpy).toHaveBeenCalledWith({ @@ -83,7 +73,7 @@ describe('runCliExecutor', () => { { output: 'code-pushup.config.json', persist: { filename: 'REPORT' } }, executorContext('testing-utils'), ); - expect(output.success).toBe(true); + expect(output.success).toBeTrue(); expect(output.command).toContain('--output="code-pushup.config.json"'); expect(output.command).toContain('--persist.filename="REPORT"'); }); @@ -124,7 +114,7 @@ describe('runCliExecutor', () => { { ...executorContext('github-action'), cwd: '' }, ); - expect(executeProcessSpy).toHaveBeenCalledTimes(1); + expect(executeProcessSpy).toHaveBeenCalledOnce(); expect(executeProcessSpy).toHaveBeenCalledWith({ command: 'npx', args: expect.arrayContaining(['@code-pushup/cli']), @@ -153,7 +143,7 @@ describe('runCliExecutor', () => { expect(executeProcessSpy).toHaveBeenCalledTimes(0); expect(output.command).not.toContain('--verbose'); - expect(logger.warn).toHaveBeenCalledTimes(1); + expect(logger.warn).toHaveBeenCalledOnce(); expect(logger.warn).toHaveBeenCalledWith( expect.stringContaining('CP_VERBOSE="true"'), ); @@ -163,7 +153,7 @@ describe('runCliExecutor', () => { await runCliExecutor({ dryRun: true }, executorContext('utils')); expect(logger.command).toHaveBeenCalledTimes(0); - expect(logger.warn).toHaveBeenCalledTimes(1); + expect(logger.warn).toHaveBeenCalledOnce(); expect(logger.warn).toHaveBeenCalledWith( expect.stringContaining('DryRun execution of'), ); diff --git a/packages/nx-plugin/src/executors/cli/utils.int.test.ts b/packages/nx-plugin/src/executors/cli/utils.int.test.ts index cecff0afc..5cee9d9ff 100644 --- a/packages/nx-plugin/src/executors/cli/utils.int.test.ts +++ b/packages/nx-plugin/src/executors/cli/utils.int.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it, vi } from 'vitest'; import type { UploadConfig } from '@code-pushup/models'; import { normalizedExecutorContext } from '../../../mock/utils/executor.js'; import * as config from '../internal/config.js'; diff --git a/packages/nx-plugin/src/executors/cli/utils.unit.test.ts b/packages/nx-plugin/src/executors/cli/utils.unit.test.ts index a20b28160..631fd04b9 100644 --- a/packages/nx-plugin/src/executors/cli/utils.unit.test.ts +++ b/packages/nx-plugin/src/executors/cli/utils.unit.test.ts @@ -1,13 +1,5 @@ import { vol } from 'memfs'; -import { - type MockInstance, - afterAll, - beforeAll, - describe, - expect, - it, - vi, -} from 'vitest'; +import type { MockInstance } from 'vitest'; import { createNodesV2Context } from '@code-pushup/test-nx-utils'; import { MEMFS_VOLUME, osAgnosticPath } from '@code-pushup/test-utils'; import { normalizedCreateNodesV2Context } from '../../plugin/utils.js'; diff --git a/packages/nx-plugin/src/executors/internal/config.int.test.ts b/packages/nx-plugin/src/executors/internal/config.int.test.ts index 54b2e32dc..83804f35a 100644 --- a/packages/nx-plugin/src/executors/internal/config.int.test.ts +++ b/packages/nx-plugin/src/executors/internal/config.int.test.ts @@ -1,4 +1,3 @@ -import { describe, expect } from 'vitest'; import { ENV } from '../../../mock/fixtures/env.js'; import { uploadConfig } from './config.js'; import * as env from './env.js'; @@ -22,7 +21,7 @@ describe('uploadConfig', () => { ), ).toBeDefined(); - expect(parseEnvSpy).toHaveBeenCalledTimes(1); + expect(parseEnvSpy).toHaveBeenCalledOnce(); expect(parseEnvSpy).toHaveBeenCalledWith(ENV); }); }); diff --git a/packages/nx-plugin/src/executors/internal/config.unit.test.ts b/packages/nx-plugin/src/executors/internal/config.unit.test.ts index c9d948bdd..e993a12d0 100644 --- a/packages/nx-plugin/src/executors/internal/config.unit.test.ts +++ b/packages/nx-plugin/src/executors/internal/config.unit.test.ts @@ -1,4 +1,4 @@ -import { type MockInstance, describe, expect } from 'vitest'; +import type { MockInstance } from 'vitest'; import { osAgnosticPath } from '@code-pushup/test-utils'; import { ENV } from '../../../mock/fixtures/env.js'; import { globalConfig, persistConfig, uploadConfig } from './config.js'; diff --git a/packages/nx-plugin/src/executors/internal/context.unit.test.ts b/packages/nx-plugin/src/executors/internal/context.unit.test.ts index 9be17d2a9..a56d5b49e 100644 --- a/packages/nx-plugin/src/executors/internal/context.unit.test.ts +++ b/packages/nx-plugin/src/executors/internal/context.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import { normalizeContext } from './context.js'; describe('normalizeContext', () => { diff --git a/packages/nx-plugin/src/executors/internal/env.unit.test.ts b/packages/nx-plugin/src/executors/internal/env.unit.test.ts index c7d623901..3f6a90c72 100644 --- a/packages/nx-plugin/src/executors/internal/env.unit.test.ts +++ b/packages/nx-plugin/src/executors/internal/env.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect } from 'vitest'; import { parseEnv } from './env.js'; describe('parseEnv', () => { diff --git a/packages/nx-plugin/src/generators/configuration/code-pushup-config.int.test.ts b/packages/nx-plugin/src/generators/configuration/code-pushup-config.int.test.ts index 38238ff50..122774134 100644 --- a/packages/nx-plugin/src/generators/configuration/code-pushup-config.int.test.ts +++ b/packages/nx-plugin/src/generators/configuration/code-pushup-config.int.test.ts @@ -2,7 +2,6 @@ import * as devKit from '@nx/devkit'; import { formatFiles } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import * as path from 'node:path'; -import { describe, expect, it } from 'vitest'; import { generateCodePushupConfig } from './code-pushup-config.js'; describe('generateCodePushupConfig options', () => { diff --git a/packages/nx-plugin/src/generators/configuration/code-pushup-config.unit.test.ts b/packages/nx-plugin/src/generators/configuration/code-pushup-config.unit.test.ts index 4cd74d681..4933c78de 100644 --- a/packages/nx-plugin/src/generators/configuration/code-pushup-config.unit.test.ts +++ b/packages/nx-plugin/src/generators/configuration/code-pushup-config.unit.test.ts @@ -1,7 +1,6 @@ import * as devKit from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import * as path from 'node:path'; -import { afterEach, describe, expect, it } from 'vitest'; import { removeColorCodes } from '@code-pushup/test-utils'; import { DEFAULT_IMPORTS, @@ -70,14 +69,14 @@ describe('generateCodePushupConfig options', () => { it('should call generateFilesSpy', () => { generateCodePushupConfig(tree, testProjectName); - expect(generateFilesSpy).toHaveBeenCalledTimes(1); + expect(generateFilesSpy).toHaveBeenCalledOnce(); }); it('should skip creation if config already exists', () => { tree.write(path.join(testProjectName, 'code-pushup.config.js'), ''); generateCodePushupConfig(tree, testProjectName); expect(generateFilesSpy).toHaveBeenCalledTimes(0); - expect(loggerWarnSpy).toHaveBeenCalledTimes(1); + expect(loggerWarnSpy).toHaveBeenCalledOnce(); expect(loggerWarnSpy).toHaveBeenCalledWith( removeColorCodes( 'NOTE: No config file created as code-pushup.config.js file already exists.', diff --git a/packages/nx-plugin/src/generators/configuration/generator.int.test.ts b/packages/nx-plugin/src/generators/configuration/generator.int.test.ts index ba779c955..67d5a564e 100644 --- a/packages/nx-plugin/src/generators/configuration/generator.int.test.ts +++ b/packages/nx-plugin/src/generators/configuration/generator.int.test.ts @@ -6,7 +6,6 @@ import { } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import * as path from 'node:path'; -import { afterEach, describe, expect, it, vi } from 'vitest'; import { configurationGenerator } from './generator.js'; describe('configurationGenerator', () => { diff --git a/packages/nx-plugin/src/generators/configuration/utils.unit.test.ts b/packages/nx-plugin/src/generators/configuration/utils.unit.test.ts index 3a140c8ff..ccbd0d130 100644 --- a/packages/nx-plugin/src/generators/configuration/utils.unit.test.ts +++ b/packages/nx-plugin/src/generators/configuration/utils.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import { formatArrayToJSArray, formatArrayToLinesOfJsString, diff --git a/packages/nx-plugin/src/generators/init/generator.int.test.ts b/packages/nx-plugin/src/generators/init/generator.int.test.ts index 5ab890bd1..edf22c648 100644 --- a/packages/nx-plugin/src/generators/init/generator.int.test.ts +++ b/packages/nx-plugin/src/generators/init/generator.int.test.ts @@ -1,6 +1,5 @@ import { type Tree, logger, readJson, readNxJson } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; -import { describe, expect, it, vi } from 'vitest'; import { initGenerator } from './generator.js'; type PackageJson = { diff --git a/packages/nx-plugin/src/plugin/plugin.unit.test.ts b/packages/nx-plugin/src/plugin/plugin.unit.test.ts index b6a2b03ff..0fe654935 100644 --- a/packages/nx-plugin/src/plugin/plugin.unit.test.ts +++ b/packages/nx-plugin/src/plugin/plugin.unit.test.ts @@ -1,6 +1,5 @@ import type { CreateNodesContextV2, CreateNodesResultV2 } from '@nx/devkit'; import { vol } from 'memfs'; -import { afterEach, beforeEach, describe, expect, it } from 'vitest'; import { MEMFS_VOLUME } from '@code-pushup/test-utils'; import { PACKAGE_NAME, PROJECT_JSON_FILE_NAME } from '../internal/constants.js'; import { CP_TARGET_NAME } from './constants.js'; diff --git a/packages/nx-plugin/src/plugin/target/configuration.target.unit.test.ts b/packages/nx-plugin/src/plugin/target/configuration.target.unit.test.ts index 6753135f1..2b8c8d8e8 100644 --- a/packages/nx-plugin/src/plugin/target/configuration.target.unit.test.ts +++ b/packages/nx-plugin/src/plugin/target/configuration.target.unit.test.ts @@ -1,4 +1,3 @@ -import { expect } from 'vitest'; import { PACKAGE_NAME } from '../../internal/constants.js'; import { createConfigurationTarget } from './configuration-target.js'; diff --git a/packages/nx-plugin/src/plugin/target/executor.target.unit.test.ts b/packages/nx-plugin/src/plugin/target/executor.target.unit.test.ts index baec99a6d..6134f7b89 100644 --- a/packages/nx-plugin/src/plugin/target/executor.target.unit.test.ts +++ b/packages/nx-plugin/src/plugin/target/executor.target.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import { createExecutorTarget } from './executor-target.js'; describe('createExecutorTarget', () => { diff --git a/packages/nx-plugin/src/plugin/target/targets.unit.test.ts b/packages/nx-plugin/src/plugin/target/targets.unit.test.ts index 3157bfef8..3a76f2381 100644 --- a/packages/nx-plugin/src/plugin/target/targets.unit.test.ts +++ b/packages/nx-plugin/src/plugin/target/targets.unit.test.ts @@ -1,6 +1,5 @@ import { vol } from 'memfs'; import { rm } from 'node:fs/promises'; -import { afterEach, beforeEach, expect } from 'vitest'; import { MEMFS_VOLUME } from '@code-pushup/test-utils'; import { DEFAULT_TARGET_NAME, PACKAGE_NAME } from '../../internal/constants.js'; import { CP_TARGET_NAME } from '../constants.js'; diff --git a/packages/nx-plugin/src/plugin/utils.unit.test.ts b/packages/nx-plugin/src/plugin/utils.unit.test.ts index 86daed082..270dffed5 100644 --- a/packages/nx-plugin/src/plugin/utils.unit.test.ts +++ b/packages/nx-plugin/src/plugin/utils.unit.test.ts @@ -1,5 +1,4 @@ import { vol } from 'memfs'; -import { describe, expect, it } from 'vitest'; import { createNodesV2Context } from '@code-pushup/test-nx-utils'; import { MEMFS_VOLUME } from '@code-pushup/test-utils'; import { normalizedCreateNodesV2Context } from './utils.js'; diff --git a/packages/plugin-axe/src/lib/categories.unit.test.ts b/packages/plugin-axe/src/lib/categories.unit.test.ts index 8fe5ea0a4..5c7e628bb 100644 --- a/packages/plugin-axe/src/lib/categories.unit.test.ts +++ b/packages/plugin-axe/src/lib/categories.unit.test.ts @@ -1,5 +1,4 @@ import ansis from 'ansis'; -import { describe, expect, it } from 'vitest'; import type { CategoryConfig, PluginConfig } from '@code-pushup/models'; import { axeCategories } from './categories.js'; import { AXE_PLUGIN_SLUG } from './constants.js'; diff --git a/packages/plugin-axe/src/lib/config.unit.test.ts b/packages/plugin-axe/src/lib/config.unit.test.ts index b52481633..f75e4367a 100644 --- a/packages/plugin-axe/src/lib/config.unit.test.ts +++ b/packages/plugin-axe/src/lib/config.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import { ZodError } from 'zod'; import { axePluginOptionsSchema } from './config.js'; diff --git a/packages/plugin-axe/src/lib/groups.int.test.ts b/packages/plugin-axe/src/lib/groups.int.test.ts index f344da177..acf24e541 100644 --- a/packages/plugin-axe/src/lib/groups.int.test.ts +++ b/packages/plugin-axe/src/lib/groups.int.test.ts @@ -1,5 +1,4 @@ import axe from 'axe-core'; -import { describe, expect, it } from 'vitest'; import { axeCategoryGroupSlugSchema, axeWcagTagSchema } from './groups.js'; describe('axeCategoryGroupSlugSchema', () => { diff --git a/packages/plugin-axe/src/lib/meta/audits.unit.test.ts b/packages/plugin-axe/src/lib/meta/audits.unit.test.ts index 95bd88189..a1eae3f4e 100644 --- a/packages/plugin-axe/src/lib/meta/audits.unit.test.ts +++ b/packages/plugin-axe/src/lib/meta/audits.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import type { AxePreset } from '../config.js'; import { loadAxeRules, transformRulesToAudits } from './transform.js'; diff --git a/packages/plugin-axe/src/lib/meta/groups.unit.test.ts b/packages/plugin-axe/src/lib/meta/groups.unit.test.ts index 788a31108..227646a89 100644 --- a/packages/plugin-axe/src/lib/meta/groups.unit.test.ts +++ b/packages/plugin-axe/src/lib/meta/groups.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import type { Group } from '@code-pushup/models'; import { loadAxeRules, transformRulesToGroups } from './transform.js'; diff --git a/packages/plugin-axe/src/lib/meta/processing.unit.test.ts b/packages/plugin-axe/src/lib/meta/processing.unit.test.ts index 5fd66d810..206882a06 100644 --- a/packages/plugin-axe/src/lib/meta/processing.unit.test.ts +++ b/packages/plugin-axe/src/lib/meta/processing.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import { processAuditsAndGroups } from './processing.js'; describe('processAuditsAndGroups', () => { diff --git a/packages/plugin-axe/src/lib/runner/runner.unit.test.ts b/packages/plugin-axe/src/lib/runner/runner.unit.test.ts index b161b9796..cf742b512 100644 --- a/packages/plugin-axe/src/lib/runner/runner.unit.test.ts +++ b/packages/plugin-axe/src/lib/runner/runner.unit.test.ts @@ -1,5 +1,4 @@ import type { AxeResults, IncompleteResult, Result } from 'axe-core'; -import { beforeEach, describe, expect, it, vi } from 'vitest'; import { type AuditOutput, DEFAULT_PERSIST_CONFIG } from '@code-pushup/models'; import type { AxeUrlResult } from './run-axe.js'; import { createRunnerFunction } from './runner.js'; diff --git a/packages/plugin-axe/src/lib/runner/transform.unit.test.ts b/packages/plugin-axe/src/lib/runner/transform.unit.test.ts index 61eb32e67..5f28e09a7 100644 --- a/packages/plugin-axe/src/lib/runner/transform.unit.test.ts +++ b/packages/plugin-axe/src/lib/runner/transform.unit.test.ts @@ -1,5 +1,4 @@ import type { AxeResults, NodeResult, Result } from 'axe-core'; -import { describe, expect, it } from 'vitest'; import type { AuditOutput } from '@code-pushup/models'; import { createUrlSuffix, toAuditOutputs } from './transform.js'; diff --git a/packages/plugin-axe/src/lib/utils.unit.test.ts b/packages/plugin-axe/src/lib/utils.unit.test.ts index 41794d6b2..a61aed320 100644 --- a/packages/plugin-axe/src/lib/utils.unit.test.ts +++ b/packages/plugin-axe/src/lib/utils.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import { AXE_PLUGIN_SLUG } from './constants.js'; import { axeAuditRef, diff --git a/packages/plugin-coverage/src/lib/config.unit.test.ts b/packages/plugin-coverage/src/lib/config.unit.test.ts index 765ab447e..9a39d5423 100644 --- a/packages/plugin-coverage/src/lib/config.unit.test.ts +++ b/packages/plugin-coverage/src/lib/config.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import { type CoveragePluginConfig, type CoverageType, diff --git a/packages/plugin-coverage/src/lib/runner/lcov/lcov-runner.int.test.ts b/packages/plugin-coverage/src/lib/runner/lcov/lcov-runner.int.test.ts index 412bffa1f..4f2846187 100644 --- a/packages/plugin-coverage/src/lib/runner/lcov/lcov-runner.int.test.ts +++ b/packages/plugin-coverage/src/lib/runner/lcov/lcov-runner.int.test.ts @@ -1,6 +1,5 @@ import path from 'node:path'; import { fileURLToPath } from 'node:url'; -import { describe, expect, it } from 'vitest'; import { osAgnosticAuditOutputs } from '@code-pushup/test-fixtures'; import { lcovResultsToAuditOutputs } from './lcov-runner.js'; diff --git a/packages/plugin-coverage/src/lib/runner/lcov/lcov-runner.unit.test.ts b/packages/plugin-coverage/src/lib/runner/lcov/lcov-runner.unit.test.ts index ffc970f10..28a7db053 100644 --- a/packages/plugin-coverage/src/lib/runner/lcov/lcov-runner.unit.test.ts +++ b/packages/plugin-coverage/src/lib/runner/lcov/lcov-runner.unit.test.ts @@ -1,6 +1,5 @@ import { vol } from 'memfs'; import path from 'node:path'; -import { beforeEach, describe, expect, it, vi } from 'vitest'; import { getGitRoot, logger } from '@code-pushup/utils'; import type { CoverageResult, CoverageType } from '../../config.js'; import { lcovResultsToAuditOutputs, parseLcovFiles } from './lcov-runner.js'; diff --git a/packages/plugin-coverage/src/lib/runner/lcov/merge-lcov.unit.test.ts b/packages/plugin-coverage/src/lib/runner/lcov/merge-lcov.unit.test.ts index 6bdf1fa01..83ae8b2e7 100644 --- a/packages/plugin-coverage/src/lib/runner/lcov/merge-lcov.unit.test.ts +++ b/packages/plugin-coverage/src/lib/runner/lcov/merge-lcov.unit.test.ts @@ -4,7 +4,6 @@ import type { LCOVRecord, LinesDetails, } from 'parse-lcov'; -import { describe, expect, it } from 'vitest'; import { mergeDuplicateLcovRecords, mergeLcovBranchesDetails, diff --git a/packages/plugin-coverage/src/lib/runner/lcov/transform.unit.test.ts b/packages/plugin-coverage/src/lib/runner/lcov/transform.unit.test.ts index 864e36597..be04dc316 100644 --- a/packages/plugin-coverage/src/lib/runner/lcov/transform.unit.test.ts +++ b/packages/plugin-coverage/src/lib/runner/lcov/transform.unit.test.ts @@ -1,6 +1,5 @@ import path from 'node:path'; import type { LCOVRecord } from 'parse-lcov'; -import { describe, it } from 'vitest'; import type { AuditOutput } from '@code-pushup/models'; import type { FileCoverage } from '@code-pushup/utils'; import { INVALID_FUNCTION_NAME } from '../constants.js'; diff --git a/packages/plugin-coverage/src/lib/runner/lcov/utils.unit.test.ts b/packages/plugin-coverage/src/lib/runner/lcov/utils.unit.test.ts index 15f8d71ed..ee079071b 100644 --- a/packages/plugin-coverage/src/lib/runner/lcov/utils.unit.test.ts +++ b/packages/plugin-coverage/src/lib/runner/lcov/utils.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import { calculateCoverage, mergeConsecutiveNumbers } from './utils.js'; describe('calculateCoverage', () => { diff --git a/packages/plugin-coverage/src/lib/runner/runner.int.test.ts b/packages/plugin-coverage/src/lib/runner/runner.int.test.ts index bea671b5b..6ccdf361b 100644 --- a/packages/plugin-coverage/src/lib/runner/runner.int.test.ts +++ b/packages/plugin-coverage/src/lib/runner/runner.int.test.ts @@ -1,6 +1,5 @@ import path from 'node:path'; import { fileURLToPath } from 'node:url'; -import { expect } from 'vitest'; import { type AuditOutputs, DEFAULT_PERSIST_CONFIG } from '@code-pushup/models'; import { createRunnerFunction } from './runner.js'; diff --git a/packages/plugin-eslint/src/lib/config.unit.test.ts b/packages/plugin-eslint/src/lib/config.unit.test.ts index 3d08289ee..0ac2789de 100644 --- a/packages/plugin-eslint/src/lib/config.unit.test.ts +++ b/packages/plugin-eslint/src/lib/config.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import { eslintPluginConfigSchema, eslintTargetSchema } from './config.js'; describe('eslintTargetSchema', () => { diff --git a/packages/plugin-eslint/src/lib/eslint-plugin.int.test.ts b/packages/plugin-eslint/src/lib/eslint-plugin.int.test.ts index 322df5d7d..b92d97030 100644 --- a/packages/plugin-eslint/src/lib/eslint-plugin.int.test.ts +++ b/packages/plugin-eslint/src/lib/eslint-plugin.int.test.ts @@ -4,15 +4,7 @@ import os from 'node:os'; import path from 'node:path'; import process from 'node:process'; import { fileURLToPath } from 'node:url'; -import { - type MockInstance, - afterAll, - beforeAll, - describe, - expect, - it, - vi, -} from 'vitest'; +import type { MockInstance } from 'vitest'; import type { Audit } from '@code-pushup/models'; import { restoreNxIgnoredFiles, diff --git a/packages/plugin-eslint/src/lib/nx/filter-project-graph.unit.test.ts b/packages/plugin-eslint/src/lib/nx/filter-project-graph.unit.test.ts index 5501a02ca..11e0aeb85 100644 --- a/packages/plugin-eslint/src/lib/nx/filter-project-graph.unit.test.ts +++ b/packages/plugin-eslint/src/lib/nx/filter-project-graph.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import { toProjectGraph } from '@code-pushup/test-utils'; import { filterProjectGraph } from './filter-project-graph.js'; diff --git a/packages/plugin-eslint/src/lib/runner/runner.int.test.ts b/packages/plugin-eslint/src/lib/runner/runner.int.test.ts index 3a6e240f0..cb166034d 100644 --- a/packages/plugin-eslint/src/lib/runner/runner.int.test.ts +++ b/packages/plugin-eslint/src/lib/runner/runner.int.test.ts @@ -3,7 +3,7 @@ import os from 'node:os'; import path from 'node:path'; import process from 'node:process'; import { fileURLToPath } from 'node:url'; -import { type MockInstance, describe, expect, it } from 'vitest'; +import type { MockInstance } from 'vitest'; import { type Audit, type AuditOutput, diff --git a/packages/plugin-eslint/src/lib/runner/runner.unit.test.ts b/packages/plugin-eslint/src/lib/runner/runner.unit.test.ts index f500a6509..ec9842b30 100644 --- a/packages/plugin-eslint/src/lib/runner/runner.unit.test.ts +++ b/packages/plugin-eslint/src/lib/runner/runner.unit.test.ts @@ -1,4 +1,3 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest'; import type { z } from 'zod'; import { type Audit, diff --git a/packages/plugin-eslint/src/lib/runner/utils.unit.test.ts b/packages/plugin-eslint/src/lib/runner/utils.unit.test.ts index 04b868a16..2b910a99e 100644 --- a/packages/plugin-eslint/src/lib/runner/utils.unit.test.ts +++ b/packages/plugin-eslint/src/lib/runner/utils.unit.test.ts @@ -1,6 +1,5 @@ import type { ESLint } from 'eslint'; import * as globModule from 'glob'; -import { beforeEach, describe, expect, it, vi } from 'vitest'; import * as utilsModule from '@code-pushup/utils'; import type { LinterOutput } from './types.js'; import { loadArtifacts } from './utils.js'; @@ -79,7 +78,7 @@ describe('loadArtifacts', () => { loadArtifacts({ artifactsPaths: artifactsPaths.at(0)! }), ).resolves.toStrictEqual([expectedLinterOutput1]); expect(executeProcessSpy).not.toHaveBeenCalled(); - expect(readJsonFileSpy).toHaveBeenCalledTimes(1); + expect(readJsonFileSpy).toHaveBeenCalledOnce(); expect(readJsonFileSpy).toHaveBeenNthCalledWith(1, artifactsPaths.at(0)); }); @@ -94,7 +93,7 @@ describe('loadArtifacts', () => { expectedLinterOutput2, ]); - expect(globSpy).toHaveBeenCalledTimes(1); + expect(globSpy).toHaveBeenCalledOnce(); expect(globSpy).toHaveBeenCalledWith(artifactsPaths); expect(readJsonFileSpy).toHaveBeenCalledTimes(2); expect(readJsonFileSpy).toHaveBeenNthCalledWith(1, artifactsPaths.at(0)); @@ -119,7 +118,7 @@ describe('loadArtifacts', () => { command: generateArtifactsCommand, ignoreExitCode: true, }); - expect(globSpy).toHaveBeenCalledTimes(1); + expect(globSpy).toHaveBeenCalledOnce(); expect(globSpy).toHaveBeenCalledWith(artifactsPaths); }); @@ -142,7 +141,7 @@ describe('loadArtifacts', () => { ...generateArtifactsCommand, ignoreExitCode: true, }); - expect(globSpy).toHaveBeenCalledTimes(1); + expect(globSpy).toHaveBeenCalledOnce(); expect(globSpy).toHaveBeenCalledWith(artifactsPaths); }); }); diff --git a/packages/plugin-js-packages/src/lib/config.unit.test.ts b/packages/plugin-js-packages/src/lib/config.unit.test.ts index 9ea26f3b3..b251259d0 100644 --- a/packages/plugin-js-packages/src/lib/config.unit.test.ts +++ b/packages/plugin-js-packages/src/lib/config.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import { type AuditSeverity, type FinalJSPackagesPluginConfig, diff --git a/packages/plugin-js-packages/src/lib/js-packages-plugin.unit.test.ts b/packages/plugin-js-packages/src/lib/js-packages-plugin.unit.test.ts index 21afeb02c..5b302bfc0 100644 --- a/packages/plugin-js-packages/src/lib/js-packages-plugin.unit.test.ts +++ b/packages/plugin-js-packages/src/lib/js-packages-plugin.unit.test.ts @@ -1,5 +1,4 @@ import { vol } from 'memfs'; -import { describe, expect, it } from 'vitest'; import { type Group, type PluginConfig, diff --git a/packages/plugin-js-packages/src/lib/package-managers/derive-package-manager.unit.test.ts b/packages/plugin-js-packages/src/lib/package-managers/derive-package-manager.unit.test.ts index ab4dc90fd..9d4860ca3 100644 --- a/packages/plugin-js-packages/src/lib/package-managers/derive-package-manager.unit.test.ts +++ b/packages/plugin-js-packages/src/lib/package-managers/derive-package-manager.unit.test.ts @@ -1,5 +1,4 @@ import { vol } from 'memfs'; -import { beforeEach, describe, expect, it, vi } from 'vitest'; import { MEMFS_VOLUME } from '@code-pushup/test-utils'; import * as utils from '@code-pushup/utils'; import { @@ -171,7 +170,7 @@ describe('derivePackageManager', () => { expect(fileExistsSpy).toHaveBeenCalledWith( expect.stringContaining('yarn.lock'), ); - expect(deriveYarnVersionSpy).toHaveBeenCalledTimes(1); + expect(deriveYarnVersionSpy).toHaveBeenCalledOnce(); expect(deriveYarnVersionSpy).toHaveBeenCalledWith(); }); diff --git a/packages/plugin-js-packages/src/lib/package-managers/derive-yarn.unit.test.ts b/packages/plugin-js-packages/src/lib/package-managers/derive-yarn.unit.test.ts index b8ee0bc88..4787a3e1c 100644 --- a/packages/plugin-js-packages/src/lib/package-managers/derive-yarn.unit.test.ts +++ b/packages/plugin-js-packages/src/lib/package-managers/derive-yarn.unit.test.ts @@ -1,4 +1,3 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest'; import * as utils from '@code-pushup/utils'; import type { ProcessResult } from '@code-pushup/utils'; import { deriveYarnVersion } from './derive-yarn.js'; @@ -18,7 +17,7 @@ describe('deriveYarnVersion', () => { executeProcessSpy.mockResolvedValue({ stdout: '1.22.2' } as ProcessResult); await expect(deriveYarnVersion()).resolves.toBe('yarn-classic'); - expect(executeProcessSpy).toHaveBeenCalledTimes(1); + expect(executeProcessSpy).toHaveBeenCalledOnce(); expect(executeProcessSpy).toHaveBeenCalledWith({ command: 'yarn', args: ['-v'], @@ -29,7 +28,7 @@ describe('deriveYarnVersion', () => { executeProcessSpy.mockResolvedValue({ stdout: '2.22.2' } as ProcessResult); await expect(deriveYarnVersion()).resolves.toBe('yarn-modern'); - expect(executeProcessSpy).toHaveBeenCalledTimes(1); + expect(executeProcessSpy).toHaveBeenCalledOnce(); expect(executeProcessSpy).toHaveBeenCalledWith({ command: 'yarn', args: ['-v'], @@ -41,8 +40,8 @@ describe('deriveYarnVersion', () => { stdout: 'not-installed', } as ProcessResult); - await expect(deriveYarnVersion()).resolves.toBe(false); - expect(executeProcessSpy).toHaveBeenCalledTimes(1); + await expect(deriveYarnVersion()).resolves.toBeFalse(); + expect(executeProcessSpy).toHaveBeenCalledOnce(); expect(executeProcessSpy).toHaveBeenCalledWith({ command: 'yarn', args: ['-v'], diff --git a/packages/plugin-js-packages/src/lib/package-managers/npm/audit-result.unit.test.ts b/packages/plugin-js-packages/src/lib/package-managers/npm/audit-result.unit.test.ts index 92e123582..9db7165ee 100644 --- a/packages/plugin-js-packages/src/lib/package-managers/npm/audit-result.unit.test.ts +++ b/packages/plugin-js-packages/src/lib/package-managers/npm/audit-result.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import type { AuditResult } from '../../runner/audit/types.js'; import { npmToAdvisory, diff --git a/packages/plugin-js-packages/src/lib/package-managers/npm/outdated-result.unit.test.ts b/packages/plugin-js-packages/src/lib/package-managers/npm/outdated-result.unit.test.ts index d67a40103..c3f16e8df 100644 --- a/packages/plugin-js-packages/src/lib/package-managers/npm/outdated-result.unit.test.ts +++ b/packages/plugin-js-packages/src/lib/package-managers/npm/outdated-result.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import type { OutdatedResult } from '../../runner/outdated/types.js'; import { npmToOutdatedResult } from './outdated-result.js'; diff --git a/packages/plugin-js-packages/src/lib/package-managers/pnpm/audit-result.unit.test.ts b/packages/plugin-js-packages/src/lib/package-managers/pnpm/audit-result.unit.test.ts index f550a7c39..fb44617c5 100644 --- a/packages/plugin-js-packages/src/lib/package-managers/pnpm/audit-result.unit.test.ts +++ b/packages/plugin-js-packages/src/lib/package-managers/pnpm/audit-result.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import type { AuditResult } from '../../runner/audit/types.js'; import { pnpmToAuditResult, pnpmToDirectDependency } from './audit-result.js'; import type { PnpmAuditResultJson } from './types.js'; @@ -136,7 +135,7 @@ describe('pnpmToAuditResult', () => { describe('pnpmToDirectDependency', () => { it('should identify a direct dependency', () => { - expect(pnpmToDirectDependency('. > semver@7.0.0')).toBe(true); + expect(pnpmToDirectDependency('. > semver@7.0.0')).toBeTrue(); }); it('should return a direct dependency name', () => { diff --git a/packages/plugin-js-packages/src/lib/package-managers/pnpm/outdated-result.unit.test.ts b/packages/plugin-js-packages/src/lib/package-managers/pnpm/outdated-result.unit.test.ts index 53ba20a44..a5cda02a5 100644 --- a/packages/plugin-js-packages/src/lib/package-managers/pnpm/outdated-result.unit.test.ts +++ b/packages/plugin-js-packages/src/lib/package-managers/pnpm/outdated-result.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import type { OutdatedResult } from '../../runner/outdated/types.js'; import { pnpmToOutdatedResult } from './outdated-result.js'; import type { PnpmOutdatedResultJson } from './types.js'; diff --git a/packages/plugin-js-packages/src/lib/package-managers/yarn-classic/audit-result.unit.test.ts b/packages/plugin-js-packages/src/lib/package-managers/yarn-classic/audit-result.unit.test.ts index bb25b0c5d..4008eae3f 100644 --- a/packages/plugin-js-packages/src/lib/package-managers/yarn-classic/audit-result.unit.test.ts +++ b/packages/plugin-js-packages/src/lib/package-managers/yarn-classic/audit-result.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import { toJsonLines } from '@code-pushup/utils'; import type { AuditResult } from '../../runner/audit/types.js'; import { yarnClassicToAuditResult } from './audit-result.js'; diff --git a/packages/plugin-js-packages/src/lib/package-managers/yarn-classic/outdated-result.unit.test.ts b/packages/plugin-js-packages/src/lib/package-managers/yarn-classic/outdated-result.unit.test.ts index 25355e4ec..ca25528c0 100644 --- a/packages/plugin-js-packages/src/lib/package-managers/yarn-classic/outdated-result.unit.test.ts +++ b/packages/plugin-js-packages/src/lib/package-managers/yarn-classic/outdated-result.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import { toJsonLines } from '@code-pushup/utils'; import type { OutdatedDependency, @@ -84,13 +83,13 @@ describe('yarnClassicToOutdatedResult', () => { describe('validateOutdatedFields', () => { it('should consider all required fields as valid', () => { - expect(validateOutdatedFields(REQUIRED_OUTDATED_FIELDS)).toBe(true); + expect(validateOutdatedFields(REQUIRED_OUTDATED_FIELDS)).toBeTrue(); }); it('should consider optional fields valid', () => { - expect(validateOutdatedFields([...REQUIRED_OUTDATED_FIELDS, 'URL'])).toBe( - true, - ); + expect( + validateOutdatedFields([...REQUIRED_OUTDATED_FIELDS, 'URL']), + ).toBeTrue(); }); it('should throw for missing required fields', () => { diff --git a/packages/plugin-js-packages/src/lib/package-managers/yarn-modern/audit-result.unit.test.ts b/packages/plugin-js-packages/src/lib/package-managers/yarn-modern/audit-result.unit.test.ts index a466157f9..e9f90d761 100644 --- a/packages/plugin-js-packages/src/lib/package-managers/yarn-modern/audit-result.unit.test.ts +++ b/packages/plugin-js-packages/src/lib/package-managers/yarn-modern/audit-result.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import type { AuditResult } from '../../runner/audit/types.js'; import { yarnBerryToAuditResult } from './audit-result.js'; import type { diff --git a/packages/plugin-js-packages/src/lib/package-managers/yarn-modern/outdated-result.unit.test.ts b/packages/plugin-js-packages/src/lib/package-managers/yarn-modern/outdated-result.unit.test.ts index 88bfcc094..625c64810 100644 --- a/packages/plugin-js-packages/src/lib/package-managers/yarn-modern/outdated-result.unit.test.ts +++ b/packages/plugin-js-packages/src/lib/package-managers/yarn-modern/outdated-result.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import { yarnBerryToOutdatedResult } from './outdated-result.js'; import type { YarnBerryOutdatedResultJson } from './types.js'; diff --git a/packages/plugin-js-packages/src/lib/runner/audit/transform.unit.test.ts b/packages/plugin-js-packages/src/lib/runner/audit/transform.unit.test.ts index 3d839ff2c..1dd25e8d6 100644 --- a/packages/plugin-js-packages/src/lib/runner/audit/transform.unit.test.ts +++ b/packages/plugin-js-packages/src/lib/runner/audit/transform.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import type { AuditOutput, Issue } from '@code-pushup/models'; import { defaultAuditLevelMapping } from '../../constants.js'; import { diff --git a/packages/plugin-js-packages/src/lib/runner/outdated/transform.unit.test.ts b/packages/plugin-js-packages/src/lib/runner/outdated/transform.unit.test.ts index 352836adc..89e4fb245 100644 --- a/packages/plugin-js-packages/src/lib/runner/outdated/transform.unit.test.ts +++ b/packages/plugin-js-packages/src/lib/runner/outdated/transform.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import type { AuditOutput, Issue } from '@code-pushup/models'; import { objectFromEntries } from '@code-pushup/utils'; import { RELEASE_TYPES } from './constants.js'; diff --git a/packages/plugin-js-packages/src/lib/runner/utils.unit.test.ts b/packages/plugin-js-packages/src/lib/runner/utils.unit.test.ts index f695a5ff7..57b44c9b9 100644 --- a/packages/plugin-js-packages/src/lib/runner/utils.unit.test.ts +++ b/packages/plugin-js-packages/src/lib/runner/utils.unit.test.ts @@ -1,6 +1,5 @@ import { vol } from 'memfs'; import path from 'node:path'; -import { describe, expect, it } from 'vitest'; import { MEMFS_VOLUME } from '@code-pushup/test-utils'; import type { AuditResult, Vulnerability } from './audit/types.js'; import type { DependencyTotals, PackageJson } from './outdated/types.js'; diff --git a/packages/plugin-js-packages/src/lib/utils.unit.test.ts b/packages/plugin-js-packages/src/lib/utils.unit.test.ts index 6e47568df..8cb029c51 100644 --- a/packages/plugin-js-packages/src/lib/utils.unit.test.ts +++ b/packages/plugin-js-packages/src/lib/utils.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import { normalizeConfig } from './utils.js'; describe('normalizeConfig', () => { diff --git a/packages/plugin-js-packages/tsconfig.test.json b/packages/plugin-js-packages/tsconfig.test.json index 74520418f..492b6afca 100644 --- a/packages/plugin-js-packages/tsconfig.test.json +++ b/packages/plugin-js-packages/tsconfig.test.json @@ -8,6 +8,7 @@ "vitest.unit.config.ts", "vitest.int.config.ts", "mocks/**/*.ts", - "src/**/*.test.ts" + "src/**/*.test.ts", + "../../testing/test-setup/src/vitest.d.ts" ] } diff --git a/packages/plugin-jsdocs/src/lib/config.unit.test.ts b/packages/plugin-jsdocs/src/lib/config.unit.test.ts index 6f90ac5d5..8e6565a6e 100644 --- a/packages/plugin-jsdocs/src/lib/config.unit.test.ts +++ b/packages/plugin-jsdocs/src/lib/config.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import { type JsDocsPluginConfig, jsDocsPluginConfigSchema } from './config.js'; describe('JsDocsPlugin Configuration', () => { diff --git a/packages/plugin-jsdocs/src/lib/jsdocs-plugin.unit.test.ts b/packages/plugin-jsdocs/src/lib/jsdocs-plugin.unit.test.ts index 6b768f5ed..f45f05a8b 100644 --- a/packages/plugin-jsdocs/src/lib/jsdocs-plugin.unit.test.ts +++ b/packages/plugin-jsdocs/src/lib/jsdocs-plugin.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it, vi } from 'vitest'; import { pluginConfigSchema } from '@code-pushup/models'; import { GROUPS, diff --git a/packages/plugin-jsdocs/src/lib/runner/runner.int.test.ts b/packages/plugin-jsdocs/src/lib/runner/runner.int.test.ts index 8afdecd95..a51d888a2 100644 --- a/packages/plugin-jsdocs/src/lib/runner/runner.int.test.ts +++ b/packages/plugin-jsdocs/src/lib/runner/runner.int.test.ts @@ -1,6 +1,5 @@ import path from 'node:path'; import { fileURLToPath } from 'node:url'; -import { describe, expect, it } from 'vitest'; import type { AuditOutput, CoverageTree } from '@code-pushup/models'; import { AUDITS_MAP } from '../constants.js'; import { createRunnerFunction } from './runner.js'; diff --git a/packages/plugin-lighthouse/src/lib/categories.unit.test.ts b/packages/plugin-lighthouse/src/lib/categories.unit.test.ts index 5ef7f44cb..5c38aaa98 100644 --- a/packages/plugin-lighthouse/src/lib/categories.unit.test.ts +++ b/packages/plugin-lighthouse/src/lib/categories.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import type { CategoryConfig } from '@code-pushup/models'; import { createAggregatedCategory, diff --git a/packages/plugin-lighthouse/src/lib/lighthouse-plugin.unit.test.ts b/packages/plugin-lighthouse/src/lib/lighthouse-plugin.unit.test.ts index 753630bf8..df9aae37e 100644 --- a/packages/plugin-lighthouse/src/lib/lighthouse-plugin.unit.test.ts +++ b/packages/plugin-lighthouse/src/lib/lighthouse-plugin.unit.test.ts @@ -1,4 +1,3 @@ -import { expect } from 'vitest'; import { pluginConfigSchema } from '@code-pushup/models'; import { lighthousePlugin } from './lighthouse-plugin.js'; import type { LighthouseOptions } from './types.js'; diff --git a/packages/plugin-lighthouse/src/lib/normalize-flags.unit.test.ts b/packages/plugin-lighthouse/src/lib/normalize-flags.unit.test.ts index e0f71c201..9a4c4ea50 100644 --- a/packages/plugin-lighthouse/src/lib/normalize-flags.unit.test.ts +++ b/packages/plugin-lighthouse/src/lib/normalize-flags.unit.test.ts @@ -1,6 +1,5 @@ import ansis from 'ansis'; import path from 'node:path'; -import { describe, expect, it } from 'vitest'; import { logger } from '@code-pushup/utils'; import { DEFAULT_CHROME_FLAGS, LIGHTHOUSE_OUTPUT_PATH } from './constants.js'; import { logUnsupportedFlagsInUse, normalizeFlags } from './normalize-flags.js'; @@ -10,7 +9,7 @@ import type { LighthouseOptions } from './types.js'; describe('logUnsupportedFlagsInUse', () => { it('should log unsupported entries', () => { logUnsupportedFlagsInUse({ 'list-all-audits': true } as LighthouseOptions); - expect(logger.warn).toHaveBeenCalledTimes(1); + expect(logger.warn).toHaveBeenCalledOnce(); expect(logger.warn).toHaveBeenCalledWith( `Used unsupported flags: ${ansis.bold('list-all-audits')}`, ); @@ -29,7 +28,7 @@ describe('logUnsupportedFlagsInUse', () => { // unsupported ...unsupportedFlags, } as unknown as LighthouseOptions); - expect(logger.warn).toHaveBeenCalledTimes(1); + expect(logger.warn).toHaveBeenCalledOnce(); expect(logger.warn).toHaveBeenCalledWith( `Used unsupported flags: ${ansis.bold( 'list-all-audits, list-locales, list-trace-categories', @@ -113,7 +112,7 @@ describe('normalizeFlags', () => { ...supportedFlags, } as unknown as LighthouseOptions), ).toEqual(expect.not.objectContaining({ 'list-all-audits': true })); - expect(logger.warn).toHaveBeenCalledTimes(1); + expect(logger.warn).toHaveBeenCalledOnce(); }); it('should remove any flag with an empty array as a value', () => { diff --git a/packages/plugin-lighthouse/src/lib/processing.unit.test.ts b/packages/plugin-lighthouse/src/lib/processing.unit.test.ts index eb21a3763..5b7886d11 100644 --- a/packages/plugin-lighthouse/src/lib/processing.unit.test.ts +++ b/packages/plugin-lighthouse/src/lib/processing.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import { expandOptionsForUrls, processAuditsAndGroups } from './processing.js'; describe('expandOptionsForUrls', () => { @@ -78,8 +77,8 @@ describe('processAuditsAndGroups', () => { expect(result.audits).toBeDefined(); expect(result.groups).toBeDefined(); - expect(result.audits.some(({ slug }) => slug.includes('-1'))).toBe(false); - expect(result.groups.some(({ slug }) => slug.includes('-1'))).toBe(false); + expect(result.audits.some(({ slug }) => slug.includes('-1'))).toBeFalse(); + expect(result.groups.some(({ slug }) => slug.includes('-1'))).toBeFalse(); }); it('should expand audits and groups for multiple URLs', () => { @@ -89,8 +88,8 @@ describe('processAuditsAndGroups', () => { expect(result.audits).toBeDefined(); expect(result.groups).toBeDefined(); - expect(result.audits.every(({ slug }) => /-[12]$/.test(slug))).toBe(true); - expect(result.groups.every(({ slug }) => /-[12]$/.test(slug))).toBe(true); + expect(result.audits.every(({ slug }) => /-[12]$/.test(slug))).toBeTrue(); + expect(result.groups.every(({ slug }) => /-[12]$/.test(slug))).toBeTrue(); }); it('should apply filter options for multiple URLs', () => { @@ -109,8 +108,8 @@ describe('processAuditsAndGroups', () => { 'performance-1', 'performance-2', ]); - expect(performanceGroups.every(({ isSkipped }) => !isSkipped)).toBe(true); - expect(nonPerformanceGroups.every(({ isSkipped }) => isSkipped)).toBe(true); + expect(performanceGroups.every(({ isSkipped }) => !isSkipped)).toBeTrue(); + expect(nonPerformanceGroups.every(({ isSkipped }) => isSkipped)).toBeTrue(); }); it('should handle empty options', () => { diff --git a/packages/plugin-lighthouse/src/lib/runner/constants.unit.test.ts b/packages/plugin-lighthouse/src/lib/runner/constants.unit.test.ts index b316b36b6..4eebd948d 100644 --- a/packages/plugin-lighthouse/src/lib/runner/constants.unit.test.ts +++ b/packages/plugin-lighthouse/src/lib/runner/constants.unit.test.ts @@ -1,4 +1,3 @@ -import { expect } from 'vitest'; import { auditSchema, groupSchema } from '@code-pushup/models'; import { LIGHTHOUSE_GROUPS, @@ -23,7 +22,7 @@ describe('constants', () => { invalidSlug => { expect( LIGHTHOUSE_NAVIGATION_AUDITS.every(({ slug }) => slug !== invalidSlug), - ).toBe(true); + ).toBeTrue(); }, ); diff --git a/packages/plugin-lighthouse/src/lib/runner/details/details.unit.test.ts b/packages/plugin-lighthouse/src/lib/runner/details/details.unit.test.ts index 30a2bd794..a8b67d10a 100644 --- a/packages/plugin-lighthouse/src/lib/runner/details/details.unit.test.ts +++ b/packages/plugin-lighthouse/src/lib/runner/details/details.unit.test.ts @@ -2,7 +2,6 @@ import ansis from 'ansis'; import type { FormattedIcu } from 'lighthouse'; import type Details from 'lighthouse/types/lhr/audit-details'; import type { Result } from 'lighthouse/types/lhr/audit-result'; -import { describe, expect, it } from 'vitest'; import type { AuditDetails } from '@code-pushup/models'; import { logger } from '@code-pushup/utils'; import { logUnsupportedDetails, toAuditDetails } from './details.js'; @@ -10,7 +9,7 @@ import { logUnsupportedDetails, toAuditDetails } from './details.js'; describe('logUnsupportedDetails', () => { it('should log unsupported entries', () => { logUnsupportedDetails([{ details: { type: 'screenshot' } }] as Result[]); - expect(logger.warn).toHaveBeenCalledTimes(1); + expect(logger.warn).toHaveBeenCalledOnce(); expect(logger.warn).toHaveBeenCalledWith( `Skipped parsing of unsupported audit details: ${ansis.bold('screenshot')}.`, ); @@ -26,7 +25,7 @@ describe('logUnsupportedDetails', () => { { details: { type: 'treemap-data' } }, { details: { type: 'criticalrequestchain' } }, ] as Result[]); - expect(logger.warn).toHaveBeenCalledTimes(1); + expect(logger.warn).toHaveBeenCalledOnce(); expect(logger.warn).toHaveBeenCalledWith( `Skipped parsing of unsupported audit details: ${ansis.bold( 'filmstrip, screenshot, debugdata', diff --git a/packages/plugin-lighthouse/src/lib/runner/details/item-value.unit.test.ts b/packages/plugin-lighthouse/src/lib/runner/details/item-value.unit.test.ts index 41957d3ff..7952ed5cd 100644 --- a/packages/plugin-lighthouse/src/lib/runner/details/item-value.unit.test.ts +++ b/packages/plugin-lighthouse/src/lib/runner/details/item-value.unit.test.ts @@ -1,6 +1,5 @@ import ansis from 'ansis'; import type Details from 'lighthouse/types/lhr/audit-details'; -import { describe, expect, it } from 'vitest'; import { logger } from '@code-pushup/utils'; import { type SimpleItemValue, @@ -32,7 +31,7 @@ describe('parseSimpleItemValue', () => { }); it('should parse primitive ItemValue type boolean', () => { - expect(parseSimpleItemValue(false)).toBe(false); + expect(parseSimpleItemValue(false)).toBeFalse(); }); it('should parse ObjectItemValue ItemValue type boolean', () => { @@ -66,7 +65,7 @@ describe('parseTableItemPropertyValue', () => { }); it('should parse primitive boolean value', () => { - expect(parseTableItemPropertyValue(false)).toBe(false); + expect(parseTableItemPropertyValue(false)).toBeFalse(); }); it('should parse value item code', () => { @@ -197,7 +196,7 @@ describe('formatTableItemPropertyValue', () => { }); it('should format primitive boolean value', () => { - expect(formatTableItemPropertyValue(false)).toBe(false); + expect(formatTableItemPropertyValue(false)).toBeFalse(); }); it('should forward non primitive value directly if no format is provided', () => { diff --git a/packages/plugin-lighthouse/src/lib/runner/details/opportunity.type.unit.test.ts b/packages/plugin-lighthouse/src/lib/runner/details/opportunity.type.unit.test.ts index 37dc625e3..1ae3e1792 100644 --- a/packages/plugin-lighthouse/src/lib/runner/details/opportunity.type.unit.test.ts +++ b/packages/plugin-lighthouse/src/lib/runner/details/opportunity.type.unit.test.ts @@ -1,5 +1,4 @@ import type Details from 'lighthouse/types/lhr/audit-details'; -import { describe, expect, it } from 'vitest'; import type { Table } from '@code-pushup/models'; import { parseOpportunityToAuditDetailsTable } from './opportunity.type.js'; import { LighthouseAuditDetailsParsingError } from './utils.js'; diff --git a/packages/plugin-lighthouse/src/lib/runner/details/table.type.unit.test.ts b/packages/plugin-lighthouse/src/lib/runner/details/table.type.unit.test.ts index 65ff2b5bd..8a6b7b9c6 100644 --- a/packages/plugin-lighthouse/src/lib/runner/details/table.type.unit.test.ts +++ b/packages/plugin-lighthouse/src/lib/runner/details/table.type.unit.test.ts @@ -1,5 +1,4 @@ import type Details from 'lighthouse/types/lhr/audit-details'; -import { describe, expect, it } from 'vitest'; import type { Table } from '@code-pushup/models'; import { parseTableColumns, diff --git a/packages/plugin-lighthouse/src/lib/runner/runner.unit.test.ts b/packages/plugin-lighthouse/src/lib/runner/runner.unit.test.ts index 9c0ca0a04..5eaa644fe 100644 --- a/packages/plugin-lighthouse/src/lib/runner/runner.unit.test.ts +++ b/packages/plugin-lighthouse/src/lib/runner/runner.unit.test.ts @@ -1,7 +1,6 @@ import type { Config } from 'lighthouse'; import { runLighthouse } from 'lighthouse/cli/run.js'; import type { Result } from 'lighthouse/types/lhr/audit-result'; -import { expect, vi } from 'vitest'; import { DEFAULT_PERSIST_CONFIG } from '@code-pushup/models'; import { logger } from '@code-pushup/utils'; import { DEFAULT_CLI_FLAGS } from './constants.js'; diff --git a/packages/plugin-lighthouse/src/lib/runner/utils.unit.test.ts b/packages/plugin-lighthouse/src/lib/runner/utils.unit.test.ts index 458efe97d..a5dfee309 100644 --- a/packages/plugin-lighthouse/src/lib/runner/utils.unit.test.ts +++ b/packages/plugin-lighthouse/src/lib/runner/utils.unit.test.ts @@ -6,7 +6,6 @@ import type { Result } from 'lighthouse/types/lhr/audit-result'; import { vol } from 'memfs'; import os from 'node:os'; import path from 'node:path'; -import { beforeEach, describe, expect, it, vi } from 'vitest'; import { type AuditOutput, type CoreConfig, @@ -265,7 +264,7 @@ describe('toAuditOutputs', () => { ), { verbose: true }, ); - expect(logger.warn).toHaveBeenCalledTimes(1); + expect(logger.warn).toHaveBeenCalledOnce(); }); it('should not parse empty audit details', () => { @@ -412,33 +411,33 @@ describe('determineAndSetLogLevel', () => { it('should set log level to info and return "info" as level if no options are given', () => { expect(determineAndSetLogLevel()).toBe('info'); - expect(log.isVerbose()).toBe(false); - expect(debugLib.enabled('LH:*')).toBe(false); - expect(debugLib.enabled('LH:*:verbose')).toBe(false); + expect(log.isVerbose()).toBeFalse(); + expect(debugLib.enabled('LH:*')).toBeFalse(); + expect(debugLib.enabled('LH:*:verbose')).toBeFalse(); }); it('should set log level to verbose and return "verbose" as level', () => { expect(determineAndSetLogLevel({ verbose: true })).toBe('verbose'); - expect(log.isVerbose()).toBe(true); - expect(debugLib.enabled('LH:*')).toBe(false); - expect(debugLib.enabled('LH:*:verbose')).toBe(false); + expect(log.isVerbose()).toBeTrue(); + expect(debugLib.enabled('LH:*')).toBeFalse(); + expect(debugLib.enabled('LH:*:verbose')).toBeFalse(); }); it('should set log level to quiet and return "silent" as level', () => { expect(determineAndSetLogLevel({ quiet: true })).toBe('silent'); - expect(log.isVerbose()).toBe(false); - expect(debugLib.enabled('LH:*')).toBe(false); - expect(debugLib.enabled('-LH:*')).toBe(false); - expect(debugLib.enabled('LH:*:verbose')).toBe(false); + expect(log.isVerbose()).toBeFalse(); + expect(debugLib.enabled('LH:*')).toBeFalse(); + expect(debugLib.enabled('-LH:*')).toBeFalse(); + expect(debugLib.enabled('LH:*:verbose')).toBeFalse(); }); it('should set log level to verbose if verbose and quiet are given and return "verbose" as level', () => { expect(determineAndSetLogLevel({ verbose: true, quiet: true })).toBe( 'verbose', ); - expect(log.isVerbose()).toBe(true); - expect(debugLib.enabled('LH:*')).toBe(false); - expect(debugLib.enabled('LH:*:verbose')).toBe(false); + expect(log.isVerbose()).toBeTrue(); + expect(debugLib.enabled('LH:*')).toBeFalse(); + expect(debugLib.enabled('LH:*:verbose')).toBeFalse(); }); }); diff --git a/packages/plugin-lighthouse/src/lib/utils.unit.test.ts b/packages/plugin-lighthouse/src/lib/utils.unit.test.ts index ec5ff5619..78378f607 100644 --- a/packages/plugin-lighthouse/src/lib/utils.unit.test.ts +++ b/packages/plugin-lighthouse/src/lib/utils.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import { type Audit, type Group, diff --git a/packages/plugin-typescript/src/lib/runner/runner.int.test.ts b/packages/plugin-typescript/src/lib/runner/runner.int.test.ts index 167cae7ef..d2d9d7a4d 100644 --- a/packages/plugin-typescript/src/lib/runner/runner.int.test.ts +++ b/packages/plugin-typescript/src/lib/runner/runner.int.test.ts @@ -1,4 +1,3 @@ -import { describe, expect } from 'vitest'; import { type AuditOutputs, DEFAULT_PERSIST_CONFIG } from '@code-pushup/models'; import { osAgnosticAuditOutputs } from '@code-pushup/test-fixtures'; import { getAudits } from '../utils.js'; diff --git a/packages/plugin-typescript/src/lib/runner/runner.unit.test.ts b/packages/plugin-typescript/src/lib/runner/runner.unit.test.ts index 79d1bbb3c..dddefb78d 100644 --- a/packages/plugin-typescript/src/lib/runner/runner.unit.test.ts +++ b/packages/plugin-typescript/src/lib/runner/runner.unit.test.ts @@ -3,7 +3,6 @@ import { DiagnosticCategory, type SourceFile, } from 'typescript'; -import { beforeEach, describe, expect } from 'vitest'; import { DEFAULT_PERSIST_CONFIG, type RunnerArgs, @@ -78,7 +77,7 @@ describe('createRunnerFunction', () => { expectedAudits: [], }); expect(runner(runnerArgs)).toStrictEqual([]); - expect(tSCodeToAuditSlugSpy).toHaveBeenCalledTimes(1); + expect(tSCodeToAuditSlugSpy).toHaveBeenCalledOnce(); expect(tSCodeToAuditSlugSpy).toHaveBeenCalledWith(semanticTsCode); }); @@ -89,7 +88,7 @@ describe('createRunnerFunction', () => { expectedAudits: [], }); expect(runner(runnerArgs)).toStrictEqual([]); - expect(getIssueFromDiagnosticSpy).toHaveBeenCalledTimes(1); + expect(getIssueFromDiagnosticSpy).toHaveBeenCalledOnce(); expect(getIssueFromDiagnosticSpy).toHaveBeenCalledWith( mockSemanticDiagnostic, ); diff --git a/packages/plugin-typescript/src/lib/runner/ts-runner.int.test.ts b/packages/plugin-typescript/src/lib/runner/ts-runner.int.test.ts index 53b00ac6d..bd0279041 100644 --- a/packages/plugin-typescript/src/lib/runner/ts-runner.int.test.ts +++ b/packages/plugin-typescript/src/lib/runner/ts-runner.int.test.ts @@ -1,4 +1,3 @@ -import { describe, expect } from 'vitest'; import { getTypeScriptDiagnostics } from './ts-runner.js'; describe('getTypeScriptDiagnostics', () => { diff --git a/packages/plugin-typescript/src/lib/runner/utils.int.test.ts b/packages/plugin-typescript/src/lib/runner/utils.int.test.ts index c202d59be..e79593845 100644 --- a/packages/plugin-typescript/src/lib/runner/utils.int.test.ts +++ b/packages/plugin-typescript/src/lib/runner/utils.int.test.ts @@ -1,5 +1,4 @@ import * as tsModule from 'typescript'; -import { describe, expect, vi } from 'vitest'; import { osAgnosticPath } from '@code-pushup/test-utils'; import { loadTargetConfig } from './utils.js'; @@ -31,12 +30,12 @@ describe('loadTargetConfig', () => { }, }), ); - expect(readConfigFileSpy).toHaveBeenCalledTimes(1); + expect(readConfigFileSpy).toHaveBeenCalledOnce(); expect(readConfigFileSpy).toHaveBeenCalledWith( expect.stringContaining('tsconfig.init.json'), expect.any(Function), ); - expect(parseJsonConfigFileContentSpy).toHaveBeenCalledTimes(1); + expect(parseJsonConfigFileContentSpy).toHaveBeenCalledOnce(); }); it('should return the parsed content of a tsconfig file that extends another config', () => { @@ -63,7 +62,7 @@ describe('loadTargetConfig', () => { }), ); - expect(readConfigFileSpy).toHaveBeenCalledTimes(1); - expect(parseJsonConfigFileContentSpy).toHaveBeenCalledTimes(1); + expect(readConfigFileSpy).toHaveBeenCalledOnce(); + expect(parseJsonConfigFileContentSpy).toHaveBeenCalledOnce(); }); }); diff --git a/packages/plugin-typescript/src/lib/runner/utils.unit.test.ts b/packages/plugin-typescript/src/lib/runner/utils.unit.test.ts index f4d601ee5..497fcf1d8 100644 --- a/packages/plugin-typescript/src/lib/runner/utils.unit.test.ts +++ b/packages/plugin-typescript/src/lib/runner/utils.unit.test.ts @@ -1,5 +1,4 @@ import { type Diagnostic, DiagnosticCategory } from 'typescript'; -import { beforeEach, describe, expect } from 'vitest'; import { getIssueFromDiagnostic, getSeverity, diff --git a/packages/plugin-typescript/src/lib/schema.unit.test.ts b/packages/plugin-typescript/src/lib/schema.unit.test.ts index dea7114cc..e29cfef4b 100644 --- a/packages/plugin-typescript/src/lib/schema.unit.test.ts +++ b/packages/plugin-typescript/src/lib/schema.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import { type TypescriptPluginOptions, typescriptPluginConfigSchema, diff --git a/packages/plugin-typescript/src/lib/typescript-plugin.unit.test.ts b/packages/plugin-typescript/src/lib/typescript-plugin.unit.test.ts index a01ba8f44..d3e4812eb 100644 --- a/packages/plugin-typescript/src/lib/typescript-plugin.unit.test.ts +++ b/packages/plugin-typescript/src/lib/typescript-plugin.unit.test.ts @@ -1,5 +1,4 @@ import ansis from 'ansis'; -import { expect } from 'vitest'; import { pluginConfigSchema } from '@code-pushup/models'; import { AUDITS, GROUPS } from './constants.js'; import { typescriptPlugin } from './typescript-plugin.js'; diff --git a/packages/plugin-typescript/src/lib/utils.unit.test.ts b/packages/plugin-typescript/src/lib/utils.unit.test.ts index 0acc22ba9..cf9c75dda 100644 --- a/packages/plugin-typescript/src/lib/utils.unit.test.ts +++ b/packages/plugin-typescript/src/lib/utils.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import { type Audit, categoryRefSchema } from '@code-pushup/models'; import { logger } from '@code-pushup/utils'; import { AUDITS, GROUPS } from './constants.js'; @@ -13,21 +12,21 @@ describe('filterAuditsBySlug', () => { const mockAudit = { slug: 'strict-function-types' } as Audit; it('should return true if slugs are undefined', () => { - expect(filterAuditsBySlug(undefined)(mockAudit)).toBe(true); + expect(filterAuditsBySlug(undefined)(mockAudit)).toBeTrue(); }); it('should return true if slugs are empty', () => { - expect(filterAuditsBySlug([])(mockAudit)).toBe(true); + expect(filterAuditsBySlug([])(mockAudit)).toBeTrue(); }); it('should return true if slugs are including the current audit slug', () => { - expect(filterAuditsBySlug(['strict-function-types'])(mockAudit)).toBe(true); + expect(filterAuditsBySlug(['strict-function-types'])(mockAudit)).toBeTrue(); }); it('should return false if slugs are not including the current audit slug', () => { - expect(filterAuditsBySlug(['verbatim-module-syntax'])(mockAudit)).toBe( - false, - ); + expect( + filterAuditsBySlug(['verbatim-module-syntax'])(mockAudit), + ).toBeFalse(); }); }); @@ -40,7 +39,7 @@ describe('filterAuditsByCompilerOptions', () => { }, ['strict-function-types'], )({ slug: 'strict-function-types' }), - ).toBe(false); + ).toBeFalse(); }); it('should return false if the audit is undefined in compiler options', () => { @@ -51,7 +50,7 @@ describe('filterAuditsByCompilerOptions', () => { }, ['strict-function-types'], )({ slug: 'strict-function-types' }), - ).toBe(false); + ).toBeFalse(); }); it('should return false if the audit is enabled in compiler options but not in onlyAudits', () => { @@ -63,7 +62,7 @@ describe('filterAuditsByCompilerOptions', () => { }, onlyAudits, )({ slug: 'strict-function-types' }), - ).toBe(false); + ).toBeFalse(); }); it('should return true if the audit is enabled in compiler options and onlyAudits is empty', () => { @@ -74,7 +73,7 @@ describe('filterAuditsByCompilerOptions', () => { }, [], )({ slug: 'strict-function-types' }), - ).toBe(true); + ).toBeTrue(); }); it('should return true if the audit is enabled in compiler options and in onlyAudits', () => { @@ -85,7 +84,7 @@ describe('filterAuditsByCompilerOptions', () => { }, ['strict-function-types'], )({ slug: 'strict-function-types' }), - ).toBe(true); + ).toBeTrue(); }); }); @@ -118,7 +117,7 @@ describe('logAuditsAndGroups', () => { it('should log only once if nothing was skipped', () => { logAuditsAndGroups(AUDITS, GROUPS); - expect(logger.info).toHaveBeenCalledTimes(1); + expect(logger.info).toHaveBeenCalledOnce(); expect(logger.info).toHaveBeenCalledWith( expect.stringMatching(/Created \d+ audits and \d+ groups$/), ); diff --git a/packages/plugin-typescript/tsconfig.test.json b/packages/plugin-typescript/tsconfig.test.json index b243bb3c5..54cacd82f 100644 --- a/packages/plugin-typescript/tsconfig.test.json +++ b/packages/plugin-typescript/tsconfig.test.json @@ -12,6 +12,7 @@ "src/**/*.test.tsx", "src/**/*.test.js", "src/**/*.test.jsx", - "src/**/*.d.ts" + "src/**/*.d.ts", + "../../testing/test-setup/src/vitest.d.ts" ] } diff --git a/packages/utils/src/lib/case-conversion.type.test.ts b/packages/utils/src/lib/case-conversion.type.test.ts index 86a69d1c1..c50adbb4b 100644 --- a/packages/utils/src/lib/case-conversion.type.test.ts +++ b/packages/utils/src/lib/case-conversion.type.test.ts @@ -1,4 +1,3 @@ -import { assertType, describe, expectTypeOf, it } from 'vitest'; import { lowercase, uppercase } from './case-conversions.js'; import type { CamelCaseToKebabCase, KebabCaseToCamelCase } from './types.js'; diff --git a/packages/utils/src/lib/case-conversions.unit.test.ts b/packages/utils/src/lib/case-conversions.unit.test.ts index 7481efaea..ba70091e3 100644 --- a/packages/utils/src/lib/case-conversions.unit.test.ts +++ b/packages/utils/src/lib/case-conversions.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import { camelCaseToKebabCase, capitalize, diff --git a/packages/utils/src/lib/clock-epoch.int.test.ts b/packages/utils/src/lib/clock-epoch.int.test.ts index 9e5edeee9..7bee2ef6b 100644 --- a/packages/utils/src/lib/clock-epoch.int.test.ts +++ b/packages/utils/src/lib/clock-epoch.int.test.ts @@ -1,6 +1,5 @@ import process from 'node:process'; import { threadId } from 'node:worker_threads'; -import { describe, expect, it } from 'vitest'; import { defaultClock, epochClock } from './clock-epoch.js'; describe('epochClock', () => { diff --git a/packages/utils/src/lib/clock-epoch.unit.test.ts b/packages/utils/src/lib/clock-epoch.unit.test.ts index 781f633ae..9245ddbdf 100644 --- a/packages/utils/src/lib/clock-epoch.unit.test.ts +++ b/packages/utils/src/lib/clock-epoch.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import { defaultClock, epochClock } from './clock-epoch.js'; describe('epochClock', () => { diff --git a/packages/utils/src/lib/command.unit.test.ts b/packages/utils/src/lib/command.unit.test.ts index 5a38cbcf4..92ee231e3 100644 --- a/packages/utils/src/lib/command.unit.test.ts +++ b/packages/utils/src/lib/command.unit.test.ts @@ -1,7 +1,6 @@ import ansis from 'ansis'; import path from 'node:path'; import process from 'node:process'; -import { describe, expect, it } from 'vitest'; import { formatCommandStatus } from './command.js'; describe('formatCommandStatus', () => { diff --git a/packages/utils/src/lib/execute-process.int.test.ts b/packages/utils/src/lib/execute-process.int.test.ts index 2f2db7c7c..9440116ce 100644 --- a/packages/utils/src/lib/execute-process.int.test.ts +++ b/packages/utils/src/lib/execute-process.int.test.ts @@ -1,5 +1,4 @@ import { ChildProcess } from 'node:child_process'; -import { describe, expect, it, vi } from 'vitest'; import { getAsyncProcessRunnerConfig } from '@code-pushup/test-utils'; import { type ProcessObserver, executeProcess } from './execute-process.js'; import { logger } from './logger.js'; diff --git a/packages/utils/src/lib/exit-process.int.test.ts b/packages/utils/src/lib/exit-process.int.test.ts index 7f3d0850a..5fccb57a3 100644 --- a/packages/utils/src/lib/exit-process.int.test.ts +++ b/packages/utils/src/lib/exit-process.int.test.ts @@ -1,5 +1,4 @@ import process from 'node:process'; -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import { SIGNAL_EXIT_CODES, installExitHandlers } from './exit-process.js'; describe('installExitHandlers', () => { @@ -50,7 +49,7 @@ describe('installExitHandlers', () => { (process as any).emit('uncaughtException', testError); expect(onError).toHaveBeenCalledWith(testError, 'uncaughtException'); - expect(onError).toHaveBeenCalledTimes(1); + expect(onError).toHaveBeenCalledOnce(); expect(onExit).not.toHaveBeenCalled(); }); @@ -62,7 +61,7 @@ describe('installExitHandlers', () => { (process as any).emit('unhandledRejection', testReason); expect(onError).toHaveBeenCalledWith(testReason, 'unhandledRejection'); - expect(onError).toHaveBeenCalledTimes(1); + expect(onError).toHaveBeenCalledOnce(); expect(onExit).not.toHaveBeenCalled(); }); @@ -71,7 +70,7 @@ describe('installExitHandlers', () => { (process as any).emit('SIGINT'); - expect(onExit).toHaveBeenCalledTimes(1); + expect(onExit).toHaveBeenCalledOnce(); expect(onExit).toHaveBeenCalledWith(SIGNAL_EXIT_CODES().SIGINT, { kind: 'signal', signal: 'SIGINT', @@ -84,7 +83,7 @@ describe('installExitHandlers', () => { (process as any).emit('SIGTERM'); - expect(onExit).toHaveBeenCalledTimes(1); + expect(onExit).toHaveBeenCalledOnce(); expect(onExit).toHaveBeenCalledWith(SIGNAL_EXIT_CODES().SIGTERM, { kind: 'signal', signal: 'SIGTERM', @@ -97,7 +96,7 @@ describe('installExitHandlers', () => { (process as any).emit('SIGQUIT'); - expect(onExit).toHaveBeenCalledTimes(1); + expect(onExit).toHaveBeenCalledOnce(); expect(onExit).toHaveBeenCalledWith(SIGNAL_EXIT_CODES().SIGQUIT, { kind: 'signal', signal: 'SIGQUIT', @@ -110,7 +109,7 @@ describe('installExitHandlers', () => { (process as any).emit('exit', 0); - expect(onExit).toHaveBeenCalledTimes(1); + expect(onExit).toHaveBeenCalledOnce(); expect(onExit).toHaveBeenCalledWith(0, { kind: 'exit' }); expect(onError).not.toHaveBeenCalled(); expect(processExitSpy).not.toHaveBeenCalled(); @@ -121,7 +120,7 @@ describe('installExitHandlers', () => { (process as any).emit('exit', 1); - expect(onExit).toHaveBeenCalledTimes(1); + expect(onExit).toHaveBeenCalledOnce(); expect(onExit).toHaveBeenCalledWith(1, { kind: 'exit' }); expect(onError).not.toHaveBeenCalled(); expect(processExitSpy).not.toHaveBeenCalled(); diff --git a/packages/utils/src/lib/exit-process.unit.test.ts b/packages/utils/src/lib/exit-process.unit.test.ts index d9437a51c..6ca520cfe 100644 --- a/packages/utils/src/lib/exit-process.unit.test.ts +++ b/packages/utils/src/lib/exit-process.unit.test.ts @@ -1,6 +1,5 @@ import os from 'node:os'; import process from 'node:process'; -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import { SIGNAL_EXIT_CODES, installExitHandlers } from './exit-process.js'; describe('exit-process tests', () => { @@ -51,7 +50,7 @@ describe('exit-process tests', () => { (process as any).emit('uncaughtException', testError); expect(onError).toHaveBeenCalledWith(testError, 'uncaughtException'); - expect(onError).toHaveBeenCalledTimes(1); + expect(onError).toHaveBeenCalledOnce(); expect(onExit).not.toHaveBeenCalled(); }); @@ -63,7 +62,7 @@ describe('exit-process tests', () => { (process as any).emit('unhandledRejection', testReason); expect(onError).toHaveBeenCalledWith(testReason, 'unhandledRejection'); - expect(onError).toHaveBeenCalledTimes(1); + expect(onError).toHaveBeenCalledOnce(); expect(onExit).not.toHaveBeenCalled(); }); @@ -74,7 +73,7 @@ describe('exit-process tests', () => { (process as any).emit('SIGINT'); - expect(onExit).toHaveBeenCalledTimes(1); + expect(onExit).toHaveBeenCalledOnce(); expect(onExit).toHaveBeenCalledWith(SIGNAL_EXIT_CODES().SIGINT, { kind: 'signal', signal: 'SIGINT', @@ -90,7 +89,7 @@ describe('exit-process tests', () => { (process as any).emit('SIGTERM'); - expect(onExit).toHaveBeenCalledTimes(1); + expect(onExit).toHaveBeenCalledOnce(); expect(onExit).toHaveBeenCalledWith(SIGNAL_EXIT_CODES().SIGTERM, { kind: 'signal', signal: 'SIGTERM', @@ -106,7 +105,7 @@ describe('exit-process tests', () => { (process as any).emit('SIGQUIT'); - expect(onExit).toHaveBeenCalledTimes(1); + expect(onExit).toHaveBeenCalledOnce(); expect(onExit).toHaveBeenCalledWith(SIGNAL_EXIT_CODES().SIGQUIT, { kind: 'signal', signal: 'SIGQUIT', @@ -122,7 +121,7 @@ describe('exit-process tests', () => { (process as any).emit('SIGINT'); - expect(onExit).toHaveBeenCalledTimes(1); + expect(onExit).toHaveBeenCalledOnce(); expect(onExit).toHaveBeenCalledWith(SIGNAL_EXIT_CODES().SIGINT, { kind: 'signal', signal: 'SIGINT', @@ -136,7 +135,7 @@ describe('exit-process tests', () => { (process as any).emit('SIGTERM'); - expect(onExit).toHaveBeenCalledTimes(1); + expect(onExit).toHaveBeenCalledOnce(); expect(onExit).toHaveBeenCalledWith(SIGNAL_EXIT_CODES().SIGTERM, { kind: 'signal', signal: 'SIGTERM', @@ -151,7 +150,7 @@ describe('exit-process tests', () => { const exitCode = 42; (process as any).emit('exit', exitCode); - expect(onExit).toHaveBeenCalledTimes(1); + expect(onExit).toHaveBeenCalledOnce(); expect(onExit).toHaveBeenCalledWith(exitCode, { kind: 'exit' }); expect(onError).not.toHaveBeenCalled(); expect(processExitSpy).not.toHaveBeenCalled(); @@ -167,12 +166,12 @@ describe('exit-process tests', () => { (process as any).emit('uncaughtException', testError); expect(onError).toHaveBeenCalledWith(testError, 'uncaughtException'); - expect(onError).toHaveBeenCalledTimes(1); + expect(onError).toHaveBeenCalledOnce(); expect(onExit).toHaveBeenCalledWith(1, { kind: 'fatal', fatal: 'uncaughtException', }); - expect(onExit).toHaveBeenCalledTimes(1); + expect(onExit).toHaveBeenCalledOnce(); }); it('should use custom fatalExitCode when exitOnFatal is true', () => { @@ -190,12 +189,12 @@ describe('exit-process tests', () => { (process as any).emit('uncaughtException', testError); expect(onError).toHaveBeenCalledWith(testError, 'uncaughtException'); - expect(onError).toHaveBeenCalledTimes(1); + expect(onError).toHaveBeenCalledOnce(); expect(onExit).toHaveBeenCalledWith(42, { kind: 'fatal', fatal: 'uncaughtException', }); - expect(onExit).toHaveBeenCalledTimes(1); + expect(onExit).toHaveBeenCalledOnce(); }); it('should call onExit with fatal reason for unhandledRejection when exitOnFatal is true', () => { @@ -208,12 +207,12 @@ describe('exit-process tests', () => { (process as any).emit('unhandledRejection', testReason); expect(onError).toHaveBeenCalledWith(testReason, 'unhandledRejection'); - expect(onError).toHaveBeenCalledTimes(1); + expect(onError).toHaveBeenCalledOnce(); expect(onExit).toHaveBeenCalledWith(1, { kind: 'fatal', fatal: 'unhandledRejection', }); - expect(onExit).toHaveBeenCalledTimes(1); + expect(onExit).toHaveBeenCalledOnce(); }); it('should have correct SIGINT exit code on Windows', () => { @@ -248,7 +247,7 @@ describe('exit-process tests', () => { ).not.toThrow(); (process as any).emit('SIGINT'); - expect(onExit).toHaveBeenCalledTimes(1); + expect(onExit).toHaveBeenCalledOnce(); expect(onExit).toHaveBeenCalledWith(SIGNAL_EXIT_CODES().SIGINT, { kind: 'signal', signal: 'SIGINT', diff --git a/packages/utils/src/lib/file-system.int.test.ts b/packages/utils/src/lib/file-system.int.test.ts index b355e1bb1..77d16eeff 100644 --- a/packages/utils/src/lib/file-system.int.test.ts +++ b/packages/utils/src/lib/file-system.int.test.ts @@ -1,5 +1,4 @@ import path from 'node:path'; -import { describe, expect, it } from 'vitest'; import { importModule } from './file-system.js'; describe('importModule', () => { diff --git a/packages/utils/src/lib/file-system.unit.test.ts b/packages/utils/src/lib/file-system.unit.test.ts index 0652ee389..59bc6b9a6 100644 --- a/packages/utils/src/lib/file-system.unit.test.ts +++ b/packages/utils/src/lib/file-system.unit.test.ts @@ -1,7 +1,6 @@ import { vol } from 'memfs'; import { stat } from 'node:fs/promises'; import path from 'node:path'; -import { beforeEach, describe, expect, it } from 'vitest'; import { MEMFS_VOLUME } from '@code-pushup/test-utils'; import { crawlFileSystem, diff --git a/packages/utils/src/lib/filter.unit.test.ts b/packages/utils/src/lib/filter.unit.test.ts index 5824bea14..b39f2ccb6 100644 --- a/packages/utils/src/lib/filter.unit.test.ts +++ b/packages/utils/src/lib/filter.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import { filterItemRefsBy } from './filter.js'; describe('filterItemsWithRefBy', () => { diff --git a/packages/utils/src/lib/formatting.unit.test.ts b/packages/utils/src/lib/formatting.unit.test.ts index c6459dce8..0f517e9d5 100644 --- a/packages/utils/src/lib/formatting.unit.test.ts +++ b/packages/utils/src/lib/formatting.unit.test.ts @@ -1,5 +1,4 @@ import ansis from 'ansis'; -import { describe, expect, it } from 'vitest'; import { formatBytes, formatCoveragePercentage, diff --git a/packages/utils/src/lib/git/git.commits-and-tags.int.test.ts b/packages/utils/src/lib/git/git.commits-and-tags.int.test.ts index 1c30292e0..d37b97533 100644 --- a/packages/utils/src/lib/git/git.commits-and-tags.int.test.ts +++ b/packages/utils/src/lib/git/git.commits-and-tags.int.test.ts @@ -1,7 +1,6 @@ import { mkdir, rm } from 'node:fs/promises'; import path from 'node:path'; import { type SimpleGit, simpleGit } from 'simple-git'; -import { afterAll, beforeAll, describe, expect } from 'vitest'; import { commitFile, initGitRepo } from '@code-pushup/test-utils'; import { getCurrentBranchOrTag, diff --git a/packages/utils/src/lib/git/git.commits-and-tags.unit.test.ts b/packages/utils/src/lib/git/git.commits-and-tags.unit.test.ts index 03e9b2874..cf2cb89e4 100644 --- a/packages/utils/src/lib/git/git.commits-and-tags.unit.test.ts +++ b/packages/utils/src/lib/git/git.commits-and-tags.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, vi } from 'vitest'; import { filterLogs, getSemverTags } from './git.commits-and-tags.js'; vi.mock('simple-git', async () => { diff --git a/packages/utils/src/lib/git/git.int.test.ts b/packages/utils/src/lib/git/git.int.test.ts index 47c2f749f..151cffdd0 100644 --- a/packages/utils/src/lib/git/git.int.test.ts +++ b/packages/utils/src/lib/git/git.int.test.ts @@ -1,7 +1,6 @@ import { mkdir, rm, stat, writeFile } from 'node:fs/promises'; import path from 'node:path'; import { type SimpleGit, simpleGit } from 'simple-git'; -import { afterAll, beforeAll, beforeEach, describe, expect } from 'vitest'; import { initGitRepo, teardownTestFolder } from '@code-pushup/test-utils'; import { toUnixPath } from '../transform.js'; import { diff --git a/packages/utils/src/lib/git/git.unit.test.ts b/packages/utils/src/lib/git/git.unit.test.ts index c38563939..240f7695f 100644 --- a/packages/utils/src/lib/git/git.unit.test.ts +++ b/packages/utils/src/lib/git/git.unit.test.ts @@ -1,5 +1,4 @@ import type { SimpleGit, StatusResult } from 'simple-git'; -import { describe, expect } from 'vitest'; import { GitStatusError, formatGitPath, diff --git a/packages/utils/src/lib/guards.unit.test.ts b/packages/utils/src/lib/guards.unit.test.ts index e76418939..cabce4be9 100644 --- a/packages/utils/src/lib/guards.unit.test.ts +++ b/packages/utils/src/lib/guards.unit.test.ts @@ -1,4 +1,3 @@ -import { describe } from 'vitest'; import { hasNoNullableProps, isPromiseFulfilledResult, diff --git a/packages/utils/src/lib/merge-configs.unit.test.ts b/packages/utils/src/lib/merge-configs.unit.test.ts index 6a02e65d6..15c96b8d1 100644 --- a/packages/utils/src/lib/merge-configs.unit.test.ts +++ b/packages/utils/src/lib/merge-configs.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import type { CoreConfig, PluginConfig } from '@code-pushup/models'; import { mergeConfigs } from './merge-configs.js'; diff --git a/packages/utils/src/lib/performance-observer.int.test.ts b/packages/utils/src/lib/performance-observer.int.test.ts index 2c1721ebb..b3a07547e 100644 --- a/packages/utils/src/lib/performance-observer.int.test.ts +++ b/packages/utils/src/lib/performance-observer.int.test.ts @@ -1,12 +1,5 @@ import { type PerformanceEntry, performance } from 'node:perf_hooks'; -import { - type MockedFunction, - beforeEach, - describe, - expect, - it, - vi, -} from 'vitest'; +import type { MockedFunction } from 'vitest'; import { MockSink } from '../../mocks/sink.mock'; import { type PerformanceObserverOptions, diff --git a/packages/utils/src/lib/performance-observer.unit.test.ts b/packages/utils/src/lib/performance-observer.unit.test.ts index a73be955a..9d949f78c 100644 --- a/packages/utils/src/lib/performance-observer.unit.test.ts +++ b/packages/utils/src/lib/performance-observer.unit.test.ts @@ -1,12 +1,5 @@ import { type PerformanceEntry, performance } from 'node:perf_hooks'; -import { - type MockedFunction, - beforeEach, - describe, - expect, - it, - vi, -} from 'vitest'; +import type { MockedFunction } from 'vitest'; import { MockPerformanceObserver } from '@code-pushup/test-utils'; import { MockSink } from '../../mocks/sink.mock'; import { @@ -95,7 +88,7 @@ describe('PerformanceObserverSink', () => { expect(MockPerformanceObserver.instances).toHaveLength(1); expect( MockPerformanceObserver.lastInstance()?.observe, - ).toHaveBeenCalledTimes(1); + ).toHaveBeenCalledOnce(); }); it('internal PerformanceObserver should observe mark and measure', () => { @@ -177,23 +170,23 @@ describe('PerformanceObserverSink', () => { it('isSubscribed returns false when not observing', () => { const observer = new PerformanceObserverSink(options); - expect(observer.isSubscribed()).toBe(false); + expect(observer.isSubscribed()).toBeFalse(); }); it('isSubscribed returns true when observing', () => { const observer = new PerformanceObserverSink(options); observer.subscribe(); - expect(observer.isSubscribed()).toBe(true); + expect(observer.isSubscribed()).toBeTrue(); }); it('isSubscribed reflects observe disconnect', () => { const observer = new PerformanceObserverSink(options); observer.subscribe(); - expect(observer.isSubscribed()).toBe(true); + expect(observer.isSubscribed()).toBeTrue(); observer.unsubscribe(); - expect(observer.isSubscribed()).toBe(false); + expect(observer.isSubscribed()).toBeFalse(); }); it('flush flushes observed entries when subscribed', () => { @@ -250,7 +243,7 @@ describe('PerformanceObserverSink', () => { const perfObserver = MockPerformanceObserver.lastInstance(); observerSink.unsubscribe(); observerSink.unsubscribe(); - expect(perfObserver?.disconnect).toHaveBeenCalledTimes(1); + expect(perfObserver?.disconnect).toHaveBeenCalledOnce(); expect(MockPerformanceObserver.instances).toHaveLength(0); }); diff --git a/packages/utils/src/lib/profiler/profiler.int.test.ts b/packages/utils/src/lib/profiler/profiler.int.test.ts index 949f66649..cc1ebd587 100644 --- a/packages/utils/src/lib/profiler/profiler.int.test.ts +++ b/packages/utils/src/lib/profiler/profiler.int.test.ts @@ -1,5 +1,4 @@ import { performance } from 'node:perf_hooks'; -import { beforeEach, describe, expect, it } from 'vitest'; import type { ActionTrackEntryPayload } from '../user-timing-extensibility-api.type.js'; import { Profiler } from './profiler.js'; diff --git a/packages/utils/src/lib/profiler/profiler.unit.test.ts b/packages/utils/src/lib/profiler/profiler.unit.test.ts index 0e285deb2..eeb82f8c7 100644 --- a/packages/utils/src/lib/profiler/profiler.unit.test.ts +++ b/packages/utils/src/lib/profiler/profiler.unit.test.ts @@ -1,5 +1,4 @@ import { performance } from 'node:perf_hooks'; -import { beforeEach, describe, expect, it, vi } from 'vitest'; import type { ActionTrackEntryPayload } from '../user-timing-extensibility-api.type.js'; import { Profiler, type ProfilerOptions } from './profiler.js'; @@ -26,7 +25,7 @@ describe('Profiler', () => { vi.stubEnv('CP_PROFILING', 'true'); const profilerWithEnv = getProfiler(); - expect(profilerWithEnv.isEnabled()).toBe(true); + expect(profilerWithEnv.isEnabled()).toBeTrue(); }); it('constructor should override enabled state from options', () => { @@ -37,7 +36,7 @@ describe('Profiler', () => { enabled: true, }); - expect(profilerWithOverride.isEnabled()).toBe(true); + expect(profilerWithOverride.isEnabled()).toBeTrue(); }); it('constructor should use defaults for measure', () => { @@ -119,13 +118,13 @@ describe('Profiler', () => { }); it('isEnabled should set and get enabled state', () => { - expect(profiler.isEnabled()).toBe(false); + expect(profiler.isEnabled()).toBeFalse(); profiler.setEnabled(true); - expect(profiler.isEnabled()).toBe(true); + expect(profiler.isEnabled()).toBeTrue(); profiler.setEnabled(false); - expect(profiler.isEnabled()).toBe(false); + expect(profiler.isEnabled()).toBeFalse(); }); it('isEnabled should update environment variable', () => { diff --git a/packages/utils/src/lib/promises.unit.test.ts b/packages/utils/src/lib/promises.unit.test.ts index 540f87eef..5ec70fd9c 100644 --- a/packages/utils/src/lib/promises.unit.test.ts +++ b/packages/utils/src/lib/promises.unit.test.ts @@ -1,4 +1,3 @@ -import { describe } from 'vitest'; import { asyncSequential, groupByStatus, settlePromise } from './promises.js'; describe('groupByStatus', () => { diff --git a/packages/utils/src/lib/reports/environment-type.unit.test.ts b/packages/utils/src/lib/reports/environment-type.unit.test.ts index 72e1348f8..c083532ab 100644 --- a/packages/utils/src/lib/reports/environment-type.unit.test.ts +++ b/packages/utils/src/lib/reports/environment-type.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import { getEnvironmentType } from './environment-type.js'; describe('getEnvironmentType', () => { diff --git a/packages/utils/src/lib/reports/formatting.unit.test.ts b/packages/utils/src/lib/reports/formatting.unit.test.ts index a2f29de37..a63e81d77 100644 --- a/packages/utils/src/lib/reports/formatting.unit.test.ts +++ b/packages/utils/src/lib/reports/formatting.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import { toUnixPath } from '../transform.js'; import { formatFileLink, diff --git a/packages/utils/src/lib/reports/generate-md-report-category-section.unit.test.ts b/packages/utils/src/lib/reports/generate-md-report-category-section.unit.test.ts index fa57144b0..4179af656 100644 --- a/packages/utils/src/lib/reports/generate-md-report-category-section.unit.test.ts +++ b/packages/utils/src/lib/reports/generate-md-report-category-section.unit.test.ts @@ -1,5 +1,4 @@ import { type InlineText, md } from 'build-md'; -import { describe, expect, it } from 'vitest'; import { binaryIconSuffix, categoriesDetailsSection, diff --git a/packages/utils/src/lib/reports/generate-md-report.int.test.ts b/packages/utils/src/lib/reports/generate-md-report.int.test.ts index 33ca1357c..7c59c3846 100644 --- a/packages/utils/src/lib/reports/generate-md-report.int.test.ts +++ b/packages/utils/src/lib/reports/generate-md-report.int.test.ts @@ -1,4 +1,3 @@ -import { describe } from 'vitest'; import { reportMock } from '@code-pushup/test-fixtures'; import { generateMdReport } from './generate-md-report.js'; import { scoreReport } from './scoring.js'; diff --git a/packages/utils/src/lib/reports/generate-md-report.unit.test.ts b/packages/utils/src/lib/reports/generate-md-report.unit.test.ts index 28caf1c36..8cb86a395 100644 --- a/packages/utils/src/lib/reports/generate-md-report.unit.test.ts +++ b/packages/utils/src/lib/reports/generate-md-report.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import type { AuditReport, Issue, Table } from '@code-pushup/models'; import { tableSection } from './formatting.js'; import { diff --git a/packages/utils/src/lib/reports/log-stdout-summary.int.test.ts b/packages/utils/src/lib/reports/log-stdout-summary.int.test.ts index f89ae887a..e7936f08a 100644 --- a/packages/utils/src/lib/reports/log-stdout-summary.int.test.ts +++ b/packages/utils/src/lib/reports/log-stdout-summary.int.test.ts @@ -1,4 +1,3 @@ -import { beforeAll, describe, expect, vi } from 'vitest'; import { reportMock } from '@code-pushup/test-fixtures'; import { removeColorCodes } from '@code-pushup/test-utils'; import { logger } from '../logger.js'; diff --git a/packages/utils/src/lib/reports/log-stdout-summary.unit.test.ts b/packages/utils/src/lib/reports/log-stdout-summary.unit.test.ts index 8b4a656d9..d80744bd0 100644 --- a/packages/utils/src/lib/reports/log-stdout-summary.unit.test.ts +++ b/packages/utils/src/lib/reports/log-stdout-summary.unit.test.ts @@ -1,5 +1,4 @@ import ansis from 'ansis'; -import { beforeAll, describe, expect, vi } from 'vitest'; import { removeColorCodes } from '@code-pushup/test-utils'; import { logger } from '../logger.js'; import { @@ -56,7 +55,7 @@ describe('logCategories', () => { logCategories({ plugins, categories }); - expect(logger.info).toHaveBeenCalledTimes(1); + expect(logger.info).toHaveBeenCalledOnce(); expect(ansis.strip(stdout)).toBe( ` Categories @@ -105,7 +104,7 @@ Categories logCategories({ plugins, categories }); - expect(logger.info).toHaveBeenCalledTimes(1); + expect(logger.info).toHaveBeenCalledOnce(); expect(ansis.strip(stdout)).toBe( ` Categories @@ -154,7 +153,7 @@ Categories logCategories({ plugins, categories }); - expect(logger.info).toHaveBeenCalledTimes(1); + expect(logger.info).toHaveBeenCalledOnce(); expect(ansis.strip(stdout)).toBe( ` Categories diff --git a/packages/utils/src/lib/reports/scoring.unit.test.ts b/packages/utils/src/lib/reports/scoring.unit.test.ts index b92cd70c6..0533492e0 100644 --- a/packages/utils/src/lib/reports/scoring.unit.test.ts +++ b/packages/utils/src/lib/reports/scoring.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect } from 'vitest'; import { REPORT_MOCK } from '@code-pushup/test-fixtures'; import { calculateScore, diff --git a/packages/utils/src/lib/reports/sorting.unit.test.ts b/packages/utils/src/lib/reports/sorting.unit.test.ts index ceb348938..9491a63b3 100644 --- a/packages/utils/src/lib/reports/sorting.unit.test.ts +++ b/packages/utils/src/lib/reports/sorting.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import { getSortableAuditByRef, getSortableGroupByRef, diff --git a/packages/utils/src/lib/reports/utils.unit.test.ts b/packages/utils/src/lib/reports/utils.unit.test.ts index a983af370..8e451f74e 100644 --- a/packages/utils/src/lib/reports/utils.unit.test.ts +++ b/packages/utils/src/lib/reports/utils.unit.test.ts @@ -1,5 +1,5 @@ import type { Ansis } from 'ansis'; -import { type Mock, describe, expect, it } from 'vitest'; +import type { Mock } from 'vitest'; import type { AuditReport, Issue, IssueSeverity } from '@code-pushup/models'; import { SCORE_COLOR_RANGE } from './constants.js'; import type { @@ -34,13 +34,13 @@ import { describe('scoreFilter', () => { it('should not filter by score if no options are passed', () => { - expect(scoreFilter()({ score: 0 })).toBe(true); + expect(scoreFilter()({ score: 0 })).toBeTrue(); }); it('should filter by score if options are passed', () => { expect( scoreFilter({ isScoreListed: score => score === 0.5 })({ score: 0 }), - ).toBe(false); + ).toBeFalse(); }); }); diff --git a/packages/utils/src/lib/semver.unit.test.ts b/packages/utils/src/lib/semver.unit.test.ts index 9648b9710..4fe4925a2 100644 --- a/packages/utils/src/lib/semver.unit.test.ts +++ b/packages/utils/src/lib/semver.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import { isSemver, normalizeSemver, sortSemvers } from './semver.js'; describe('isSemver', () => { diff --git a/packages/utils/src/lib/text-formats/table.unit.test.ts b/packages/utils/src/lib/text-formats/table.unit.test.ts index fad26fe45..308f52791 100644 --- a/packages/utils/src/lib/text-formats/table.unit.test.ts +++ b/packages/utils/src/lib/text-formats/table.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import type { Table, TableRowObject } from '@code-pushup/models'; import { columnsToStringArray, diff --git a/packages/utils/src/lib/trace-file-utils.unit.test.ts b/packages/utils/src/lib/trace-file-utils.unit.test.ts index e8cbf319a..ddc81aff2 100644 --- a/packages/utils/src/lib/trace-file-utils.unit.test.ts +++ b/packages/utils/src/lib/trace-file-utils.unit.test.ts @@ -1,5 +1,4 @@ import type { PerformanceMark, PerformanceMeasure } from 'node:perf_hooks'; -import { describe, expect, it } from 'vitest'; import { frameName, frameTreeNodeId, diff --git a/packages/utils/src/lib/transform.unit.test.ts b/packages/utils/src/lib/transform.unit.test.ts index ec80aca3b..4dd262fbc 100644 --- a/packages/utils/src/lib/transform.unit.test.ts +++ b/packages/utils/src/lib/transform.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import { countOccurrences, deepClone, diff --git a/packages/utils/src/lib/user-timing-extensibility-api-utils.unit.test.ts b/packages/utils/src/lib/user-timing-extensibility-api-utils.unit.test.ts index 058301a2a..8c2373f00 100644 --- a/packages/utils/src/lib/user-timing-extensibility-api-utils.unit.test.ts +++ b/packages/utils/src/lib/user-timing-extensibility-api-utils.unit.test.ts @@ -1,6 +1,5 @@ import { performance } from 'node:perf_hooks'; import { threadId } from 'node:worker_threads'; -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import { type MeasureCtxOptions, type MeasureOptions, diff --git a/testing/test-fixtures/tsconfig.test.json b/testing/test-fixtures/tsconfig.test.json index cafb05dd2..b8ef0b567 100644 --- a/testing/test-fixtures/tsconfig.test.json +++ b/testing/test-fixtures/tsconfig.test.json @@ -4,5 +4,9 @@ "outDir": "../../dist/out-tsc", "types": ["vitest/globals", "vitest/importMeta", "vite/client", "node"] }, - "include": ["vitest.unit.config.ts", "src/**/*.unit.test.ts"] + "include": [ + "vitest.unit.config.ts", + "src/**/*.unit.test.ts", + "../test-setup/src/vitest.d.ts" + ] } diff --git a/testing/test-nx-utils/src/lib/utils/nx.unit.test.ts b/testing/test-nx-utils/src/lib/utils/nx.unit.test.ts index 5da045870..f11ff16a2 100644 --- a/testing/test-nx-utils/src/lib/utils/nx.unit.test.ts +++ b/testing/test-nx-utils/src/lib/utils/nx.unit.test.ts @@ -1,5 +1,4 @@ import { createTreeWithEmptyWorkspace } from 'nx/src/generators/testing-utils/create-tree-with-empty-workspace'; -import { describe, expect } from 'vitest'; import { MEMFS_VOLUME } from '@code-pushup/test-utils'; import { executorContext, registerPluginInWorkspace } from './nx.js'; diff --git a/testing/test-nx-utils/tsconfig.test.json b/testing/test-nx-utils/tsconfig.test.json index 44ccaf163..34e4cb30d 100644 --- a/testing/test-nx-utils/tsconfig.test.json +++ b/testing/test-nx-utils/tsconfig.test.json @@ -8,6 +8,7 @@ "vitest.unit.config.ts", "vitest.int.config.ts", "src/**/*.unit.test.ts", - "src/**/*.int.test.ts" + "src/**/*.int.test.ts", + "../test-setup/src/vitest.d.ts" ] } diff --git a/testing/test-setup-config/src/lib/vitest-config-factory.unit.test.ts b/testing/test-setup-config/src/lib/vitest-config-factory.unit.test.ts index a92a3e4bf..df845928a 100644 --- a/testing/test-setup-config/src/lib/vitest-config-factory.unit.test.ts +++ b/testing/test-setup-config/src/lib/vitest-config-factory.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it, vi } from 'vitest'; import { type E2ETestOptions, type TestKind, diff --git a/testing/test-setup-config/src/lib/vitest-setup-files.unit.test.ts b/testing/test-setup-config/src/lib/vitest-setup-files.unit.test.ts index 6b9ada51d..5e3b9a15e 100644 --- a/testing/test-setup-config/src/lib/vitest-setup-files.unit.test.ts +++ b/testing/test-setup-config/src/lib/vitest-setup-files.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import type { TestKind } from './vitest-config-factory.js'; import { getSetupFiles } from './vitest-setup-files.js'; @@ -19,7 +18,7 @@ describe('getSetupFiles', () => { it('should return an array of strings', () => { const setupFiles = getSetupFiles('unit'); - expect(Array.isArray(setupFiles)).toBe(true); + expect(setupFiles).toBeArray(); expect(setupFiles).toSatisfyAll( item => typeof item === 'string', ); diff --git a/testing/test-setup-config/src/lib/vitest-setup-presets.unit.test.ts b/testing/test-setup-config/src/lib/vitest-setup-presets.unit.test.ts index e94b7e3e9..554eaafe0 100644 --- a/testing/test-setup-config/src/lib/vitest-setup-presets.unit.test.ts +++ b/testing/test-setup-config/src/lib/vitest-setup-presets.unit.test.ts @@ -1,4 +1,3 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest'; import * as configFactory from './vitest-config-factory.js'; import { createE2ETestConfig, diff --git a/testing/test-setup/src/lib/extend/markdown-table.matcher.unit.test.ts b/testing/test-setup/src/lib/extend/markdown-table.matcher.unit.test.ts index 727ca6289..e2da53475 100644 --- a/testing/test-setup/src/lib/extend/markdown-table.matcher.unit.test.ts +++ b/testing/test-setup/src/lib/extend/markdown-table.matcher.unit.test.ts @@ -1,5 +1,3 @@ -import { describe, expect, it } from 'vitest'; - describe('markdown-table-matcher', () => { it('should match header and data rows in a markdown table', () => { const markdown = ` diff --git a/testing/test-setup/src/lib/extend/path.matcher.unit.test.ts b/testing/test-setup/src/lib/extend/path.matcher.unit.test.ts index 676b0065c..0e21299f9 100644 --- a/testing/test-setup/src/lib/extend/path.matcher.unit.test.ts +++ b/testing/test-setup/src/lib/extend/path.matcher.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it, vi } from 'vitest'; import * as testUtils from '@code-pushup/test-utils'; describe('path-matcher', () => { diff --git a/testing/test-utils/src/lib/utils/file-system.unit.test.ts b/testing/test-utils/src/lib/utils/file-system.unit.test.ts index 68dc4671c..051ce709c 100644 --- a/testing/test-utils/src/lib/utils/file-system.unit.test.ts +++ b/testing/test-utils/src/lib/utils/file-system.unit.test.ts @@ -1,15 +1,7 @@ import { vol } from 'memfs'; import { stat } from 'node:fs/promises'; import path from 'node:path'; -import { - type MockInstance, - afterEach, - beforeEach, - describe, - expect, - it, - vi, -} from 'vitest'; +import type { MockInstance } from 'vitest'; import { MEMFS_VOLUME } from '../constants.js'; import { ensureDirectoryExists } from './file-system.js'; diff --git a/testing/test-utils/src/lib/utils/os-agnostic-paths.unit.test.ts b/testing/test-utils/src/lib/utils/os-agnostic-paths.unit.test.ts index 6a9d6ee85..c2f017d8c 100644 --- a/testing/test-utils/src/lib/utils/os-agnostic-paths.unit.test.ts +++ b/testing/test-utils/src/lib/utils/os-agnostic-paths.unit.test.ts @@ -1,12 +1,4 @@ -import { - type MockInstance, - afterEach, - beforeEach, - describe, - expect, - it, - vi, -} from 'vitest'; +import type { MockInstance } from 'vitest'; import { osAgnosticPath } from './os-agnostic-paths.js'; describe('osAgnosticPath', () => { diff --git a/testing/test-utils/src/lib/utils/test-folder-setup.unit.test.ts b/testing/test-utils/src/lib/utils/test-folder-setup.unit.test.ts index 7f5968366..3a7928002 100644 --- a/testing/test-utils/src/lib/utils/test-folder-setup.unit.test.ts +++ b/testing/test-utils/src/lib/utils/test-folder-setup.unit.test.ts @@ -1,6 +1,5 @@ import ansis from 'ansis'; import { vol } from 'memfs'; -import { describe, expect, it, vi } from 'vitest'; import { MEMFS_VOLUME } from '../constants.js'; import { cleanTestFolder, diff --git a/testing/test-utils/tsconfig.test.json b/testing/test-utils/tsconfig.test.json index cafb05dd2..b8ef0b567 100644 --- a/testing/test-utils/tsconfig.test.json +++ b/testing/test-utils/tsconfig.test.json @@ -4,5 +4,9 @@ "outDir": "../../dist/out-tsc", "types": ["vitest/globals", "vitest/importMeta", "vite/client", "node"] }, - "include": ["vitest.unit.config.ts", "src/**/*.unit.test.ts"] + "include": [ + "vitest.unit.config.ts", + "src/**/*.unit.test.ts", + "../test-setup/src/vitest.d.ts" + ] } diff --git a/tools/eslint-formatter-multi/src/lib/utils.unit.test.ts b/tools/eslint-formatter-multi/src/lib/utils.unit.test.ts index effd6d8d4..8bef29be1 100644 --- a/tools/eslint-formatter-multi/src/lib/utils.unit.test.ts +++ b/tools/eslint-formatter-multi/src/lib/utils.unit.test.ts @@ -1,5 +1,4 @@ import type { ESLint } from 'eslint'; -import { describe, expect, it, vi } from 'vitest'; import { removeColorCodes } from '@code-pushup/test-utils'; import { formatContent, diff --git a/tools/eslint-formatter-multi/tsconfig.spec.json b/tools/eslint-formatter-multi/tsconfig.spec.json index 827403667..23bd3a52a 100644 --- a/tools/eslint-formatter-multi/tsconfig.spec.json +++ b/tools/eslint-formatter-multi/tsconfig.spec.json @@ -24,6 +24,7 @@ "src/**/*.spec.js", "src/**/*.test.jsx", "src/**/*.spec.jsx", - "src/**/*.d.ts" + "src/**/*.d.ts", + "../../testing/test-setup/src/vitest.d.ts" ] } diff --git a/tools/zod2md-jsdocs/src/lib/transformers.unit.test.ts b/tools/zod2md-jsdocs/src/lib/transformers.unit.test.ts index 55b090a03..01b256e51 100644 --- a/tools/zod2md-jsdocs/src/lib/transformers.unit.test.ts +++ b/tools/zod2md-jsdocs/src/lib/transformers.unit.test.ts @@ -1,4 +1,3 @@ -import { describe, expect, it } from 'vitest'; import { generateJSDocComment } from './transformers.js'; describe('generateJSDocComment', () => { diff --git a/tools/zod2md-jsdocs/tsconfig.json b/tools/zod2md-jsdocs/tsconfig.json index 0c1036efe..2392f83bd 100644 --- a/tools/zod2md-jsdocs/tsconfig.json +++ b/tools/zod2md-jsdocs/tsconfig.json @@ -9,6 +9,9 @@ "references": [ { "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" } ] } diff --git a/tools/zod2md-jsdocs/tsconfig.lib.json b/tools/zod2md-jsdocs/tsconfig.lib.json index bebaef047..83e97ea66 100644 --- a/tools/zod2md-jsdocs/tsconfig.lib.json +++ b/tools/zod2md-jsdocs/tsconfig.lib.json @@ -7,5 +7,6 @@ "types": ["node"], "esModuleInterop": true }, - "include": ["src/**/*.ts"] + "include": ["src/**/*.ts"], + "exclude": ["src/**/*.test.ts", "src/**/*.spec.ts"] } diff --git a/tools/zod2md-jsdocs/tsconfig.spec.json b/tools/zod2md-jsdocs/tsconfig.spec.json index 827403667..23bd3a52a 100644 --- a/tools/zod2md-jsdocs/tsconfig.spec.json +++ b/tools/zod2md-jsdocs/tsconfig.spec.json @@ -24,6 +24,7 @@ "src/**/*.spec.js", "src/**/*.test.jsx", "src/**/*.spec.jsx", - "src/**/*.d.ts" + "src/**/*.d.ts", + "../../testing/test-setup/src/vitest.d.ts" ] }