Skip to content

test: abbreviate integration to int, rename vitest config files #1018

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
- name: Install dependencies
run: npm ci
- name: Integration test affected projects
run: npx nx affected -t integration-test --parallel=3 --coverage.enabled
run: npx nx affected -t int-test --parallel=3 --coverage.enabled

e2e:
strategy:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- plugin-coverage
- plugin-js-packages
- plugin-lighthouse
scope: [unit, integration]
scope: [unit, int]
name: Update code coverage
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ npx nx graph
npx nx run-many -t unit-test

# run integration tests for all projects
npx nx run-many -t integration-test
npx nx run-many -t int-test

# run E2E tests for CLI
npx nx e2e cli-e2e
Expand Down
5 changes: 2 additions & 3 deletions code-pushup.preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,10 @@ export const coverageCoreConfigNx = async (
if (projectName) {
throw new Error('coverageCoreConfigNx for single projects not implemented');
}
const targetNames = ['unit-test', 'integration-test'];
const targetNames = ['unit-test', 'int-test'];
const targetArgs = [
'-t',
'unit-test',
'integration-test',
...targetNames,
'--coverage.enabled',
'--skipNxCache',
];
Expand Down
10 changes: 5 additions & 5 deletions docs/e2e.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ The `e2e` testing process is complex and involves multiple steps and targets.
#### Overview:

- `nx run e2e <project-name>`
- `global-setup.e2e.ts#setup` (vitest setup script configured in `vite.config.e2e.ts`)
- `global-setup.e2e.ts#setup` (vitest setup script configured in `vitest.e2e.config.ts`)
- setup - `nx start-verdaccio`
- setup - `nx run-many -t publish`
- setup - `nx run-many -t npm-install`
- **run tests**
- `global-setup.e2e.ts#teardown` (vitest teardown script configured in `vite.config.e2e.ts`)
- `global-setup.e2e.ts#teardown` (vitest teardown script configured in `vitest.e2e.config.ts`)
- teardown - `nx run-many -t npm-uninstall`
- teardown - `process.kill(<verdaccio-port>)`

Expand All @@ -74,7 +74,7 @@ Root/
│ └── <project-name>-e2e/
│ ├── tests/
│ │ └── <file-name>.e2e.ts
│ ├── vite.config.e2e.ts # uses `global-setup.e2e.ts` for as `globalSetup` script
│ ├── vitest.e2e.config.ts # uses `global-setup.e2e.ts` for as `globalSetup` script
│ └── project.json
├── packages/
│ └── <project-name>/
Expand Down Expand Up @@ -115,14 +115,14 @@ Root/
"e2e": {
"executor": "@nx/vite:test",
"options": {
"configFile": "e2e/<project-name>-e2e/vite.config.e2e.ts",
"configFile": "e2e/<project-name>-e2e/vitest.e2e.config.ts",
},
},
},
}
```

2. 1. The `vite.config.e2e.ts` file is used to configure the Vite test runner.
2. 1. The `vitest.e2e.config.ts` file is used to configure the Vite test runner.
Inside the file, the `globalSetup` option is set to `global-setup.e2e.ts`:

```typescript
Expand Down
2 changes: 1 addition & 1 deletion e2e/ci-e2e/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"e2e": {
"executor": "@nx/vite:test",
"options": {
"configFile": "e2e/ci-e2e/vite.config.e2e.ts"
"configFile": "e2e/ci-e2e/vitest.e2e.config.ts"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion e2e/ci-e2e/tsconfig.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"types": ["vitest/globals", "vitest/importMeta", "vite/client", "node"]
},
"include": [
"vite.config.e2e.ts",
"vitest.e2e.config.ts",
"tests/**/*.e2e.test.ts",
"tests/**/*.d.ts",
"mocks/**/*.ts"
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion e2e/cli-e2e/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"e2e": {
"executor": "@nx/vite:test",
"options": {
"configFile": "e2e/cli-e2e/vite.config.e2e.ts"
"configFile": "e2e/cli-e2e/vitest.e2e.config.ts"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion e2e/cli-e2e/tsconfig.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"types": ["vitest/globals", "vitest/importMeta", "vite/client", "node"]
},
"include": [
"vite.config.e2e.ts",
"vitest.e2e.config.ts",
"tests/**/*.e2e.test.ts",
"tests/**/*.d.ts",
"mocks/**/*.ts"
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion e2e/create-cli-e2e/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"executor": "@nx/vite:test",
"options": {
"keepServerRunning": true,
"configFile": "e2e/create-cli-e2e/vite.config.e2e.ts"
"configFile": "e2e/create-cli-e2e/vitest.e2e.config.ts"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion e2e/create-cli-e2e/tsconfig.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"types": ["vitest/globals", "vitest/importMeta", "vite/client", "node"]
},
"include": [
"vite.config.e2e.ts",
"vitest.e2e.config.ts",
"tests/**/*.e2e.test.ts",
"tests/**/*.d.ts",
"mocks/**/*.ts"
Expand Down
2 changes: 1 addition & 1 deletion e2e/nx-plugin-e2e/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"e2e": {
"executor": "@nx/vite:test",
"options": {
"configFile": "e2e/nx-plugin-e2e/vite.config.e2e.ts"
"configFile": "e2e/nx-plugin-e2e/vitest.e2e.config.ts"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion e2e/nx-plugin-e2e/tsconfig.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"types": ["vitest/globals", "vitest/importMeta", "vite/client", "node"]
},
"include": [
"vite.config.e2e.ts",
"vitest.e2e.config.ts",
"tests/**/*.e2e.test.ts",
"tests/**/*.d.ts",
"mocks/**/*.ts"
Expand Down
2 changes: 1 addition & 1 deletion e2e/plugin-coverage-e2e/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"e2e": {
"executor": "@nx/vite:test",
"options": {
"configFile": "e2e/plugin-coverage-e2e/vite.config.e2e.ts"
"configFile": "e2e/plugin-coverage-e2e/vitest.e2e.config.ts"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion e2e/plugin-coverage-e2e/tsconfig.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"exclude": [],
"include": [
"vite.config.e2e.ts",
"vitest.e2e.config.ts",
"tests/**/*.e2e.test.ts",
"tests/**/*.d.ts",
"mocks/**/*.ts"
Expand Down
2 changes: 1 addition & 1 deletion e2e/plugin-eslint-e2e/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"e2e": {
"executor": "@nx/vite:test",
"options": {
"configFile": "e2e/plugin-eslint-e2e/vite.config.e2e.ts"
"configFile": "e2e/plugin-eslint-e2e/vitest.e2e.config.ts"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion e2e/plugin-eslint-e2e/tsconfig.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"exclude": ["__test-env__/**"],
"include": [
"vite.config.e2e.ts",
"vitest.e2e.config.ts",
"tests/**/*.e2e.test.ts",
"tests/**/*.d.ts",
"mocks/**/*.ts"
Expand Down
2 changes: 1 addition & 1 deletion e2e/plugin-js-packages-e2e/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"e2e": {
"executor": "@nx/vite:test",
"options": {
"configFile": "e2e/plugin-eslint-e2e/vite.config.e2e.ts"
"configFile": "e2e/plugin-eslint-e2e/vitest.e2e.config.ts"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion e2e/plugin-js-packages-e2e/tsconfig.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"exclude": ["__test-env__/**"],
"include": [
"vite.config.e2e.ts",
"vitest.e2e.config.ts",
"tests/**/*.e2e.test.ts",
"tests/**/*.d.ts",
"mocks/**/*.ts"
Expand Down
2 changes: 1 addition & 1 deletion e2e/plugin-jsdocs-e2e/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"e2e": {
"executor": "@nx/vite:test",
"options": {
"configFile": "e2e/plugin-jsdocs-e2e/vite.config.e2e.ts"
"configFile": "e2e/plugin-jsdocs-e2e/vitest.e2e.config.ts"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion e2e/plugin-jsdocs-e2e/tsconfig.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"exclude": ["__test-env__/**"],
"include": [
"vite.config.e2e.ts",
"vitest.e2e.config.ts",
"tests/**/*.e2e.test.ts",
"tests/**/*.d.ts",
"mocks/**/*.ts"
Expand Down
2 changes: 1 addition & 1 deletion e2e/plugin-lighthouse-e2e/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"e2e": {
"executor": "@nx/vite:test",
"options": {
"configFile": "e2e/plugin-lighthouse-e2e/vite.config.e2e.ts"
"configFile": "e2e/plugin-lighthouse-e2e/vitest.e2e.config.ts"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion e2e/plugin-lighthouse-e2e/tsconfig.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"target": "ES2020"
},
"include": [
"vite.config.e2e.ts",
"vitest.e2e.config.ts",
"tests/**/*.e2e.test.ts",
"tests/**/*.d.ts",
"mocks/**/*.ts"
Expand Down
2 changes: 1 addition & 1 deletion e2e/plugin-typescript-e2e/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"e2e": {
"executor": "@nx/vite:test",
"options": {
"configFile": "e2e/plugin-typescript-e2e/vite.config.e2e.ts"
"configFile": "e2e/plugin-typescript-e2e/vitest.e2e.config.ts"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion e2e/plugin-typescript-e2e/tsconfig.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"target": "ES2020"
},
"include": [
"vite.config.e2e.ts",
"vitest.e2e.config.ts",
"tests/**/*.e2e.test.ts",
"tests/**/*.d.ts",
"mocks/**/*.ts"
Expand Down
2 changes: 1 addition & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default tseslint.config(
'vitest/consistent-test-filename': [
'warn',
{
pattern: String.raw`.*\.(bench|type|unit|integration|e2e)\.test\.[tj]sx?$`,
pattern: String.raw`.*\.(bench|type|unit|int|e2e)\.test\.[tj]sx?$`,
},
],
},
Expand Down
8 changes: 4 additions & 4 deletions examples/plugins/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@
"executor": "@nx/vite:test",
"outputs": ["{options.reportsDirectory}"],
"options": {
"configFile": "examples/plugins/vite.config.unit.ts",
"configFile": "examples/plugins/vitest.unit.config.ts",
"reportsDirectory": "../../coverage/examples-plugins/unit-tests"
}
},
"integration-test": {
"int-test": {
"executor": "@nx/vite:test",
"outputs": ["{options.reportsDirectory}"],
"options": {
"configFile": "examples/plugins/vite.config.integration.ts",
"reportsDirectory": "../../coverage/examples-plugins/integration-tests"
"configFile": "examples/plugins/vitest.int.config.ts",
"reportsDirectory": "../../coverage/examples-plugins/int-tests"
}
},
"run-collect": {
Expand Down
4 changes: 2 additions & 2 deletions examples/plugins/tsconfig.lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
},
"include": ["src/**/*.ts"],
"exclude": [
"vite.config.unit.ts",
"vite.config.integration.ts",
"vitest.unit.config.ts",
"vitest.int.config.ts",
"src/**/*.test.ts",
"src/**/*.mock.ts",
"mocks/**/*.ts"
Expand Down
4 changes: 2 additions & 2 deletions examples/plugins/tsconfig.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"types": ["vitest/globals", "vitest/importMeta", "vite/client", "node"]
},
"include": [
"vite.config.unit.ts",
"vite.config.integration.ts",
"vitest.unit.config.ts",
"vitest.int.config.ts",
"mocks/**/*.ts",
"src/**/*.test.ts",
"src/**/*.test.tsx",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ export default defineConfig({
poolOptions: { threads: { singleThread: true } },
coverage: {
reporter: ['text', 'lcov'],
reportsDirectory: '../../coverage/examples-plugins/integration-tests',
reportsDirectory: '../../coverage/examples-plugins/int-tests',
exclude: ['**/mocks/**', '**/mock/**', 'code-pushup.config.ts'],
},
environment: 'node',
include: ['src/**/*.integration.test.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
include: ['src/**/*.int.test.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
globalSetup: ['../../global-setup.ts'],
setupFiles: [
'../../testing/test-setup/src/lib/fs.mock.ts',
Expand Down
2 changes: 1 addition & 1 deletion knip.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const withNxStandards = (): KnipConfigPlugin => () => {
// missing knip plugin for now, so this is in the root entry
'packages/models/zod2md.config.ts',
'**/code-pushup.*.{js,mjs,ts,cjs,mts,cts}',
'**/vite.config.*.ts',
'**/vitest.*.config.ts',
'**/*.d.ts',
'tools/**/*.{js,mjs,ts,cjs,mts,cts}',
],
Expand Down
2 changes: 1 addition & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"!{projectRoot}/src/test-setup.[jt]s",
"!{projectRoot}/test-setup.[jt]s",
"!{projectRoot}/**/?(*.)mock.[jt]s?(x)",
"!{projectRoot}/vite.config.@(unit|integration|e2e).[jt]s",
"!{projectRoot}/vitest.@(unit|int|e2e).config.[jt]s",
"!{projectRoot}/@(test|mocks)/**/*",
"!{projectRoot}/perf/**/*",
"!{projectRoot}/tools/**/*",
Expand Down
6 changes: 3 additions & 3 deletions packages/ci/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
"unit-test": {
"executor": "@nx/vite:test",
"options": {
"configFile": "packages/ci/vite.config.unit.ts"
"configFile": "packages/ci/vitest.unit.config.ts"
}
},
"integration-test": {
"int-test": {
"executor": "@nx/vite:test",
"options": {
"configFile": "packages/ci/vite.config.integration.ts"
"configFile": "packages/ci/vitest.int.config.ts"
}
}
},
Expand Down
4 changes: 2 additions & 2 deletions packages/ci/tsconfig.lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
},
"include": ["src/**/*.ts"],
"exclude": [
"vite.config.unit.ts",
"vite.config.integration.ts",
"vitest.unit.config.ts",
"vitest.int.config.ts",
"src/**/*.test.ts",
"src/**/*.mock.ts",
"mocks/**/*.ts"
Expand Down
4 changes: 2 additions & 2 deletions packages/ci/tsconfig.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
]
},
"include": [
"vite.config.unit.ts",
"vite.config.integration.ts",
"vitest.unit.config.ts",
"vitest.int.config.ts",
"mocks/**/*.ts",
"src/**/*.test.ts",
"src/**/*.test.tsx",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ export default defineConfig({
poolOptions: { threads: { singleThread: true } },
coverage: {
reporter: ['text', 'lcov'],
reportsDirectory: '../../coverage/ci/integration-tests',
reportsDirectory: '../../coverage/ci/int-tests',
exclude: ['mocks/**', '**/types.ts'],
},
environment: 'node',
include: ['src/**/*.integration.test.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
include: ['src/**/*.int.test.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
globalSetup: ['../../global-setup.ts'],
setupFiles: [
'../../testing/test-setup/src/lib/console.mock.ts',
Expand Down
File renamed without changes.
Loading
Loading