Commit a72e87c
refactor: common vitest configurations (#1107)
## Centralize and Standardize Vitest Configurations
### What Changed
* New centralized configuration system: Created
testing/test-setup-config package with a factory-based approach for
generating Vitest configurations
* Setup presets: Introduced modular setup file presets that can be
composed for different test types (unit, integration, e2e)
* Simplified configuration files: Refactored 6 existing Vitest config
files to use the new centralized system, reducing them from verbose
configurations to simple function calls
### Benefits
* Eliminates duplication: Removes repetitive boilerplate across multiple
vitest config files
* Ensures consistency: Standardizes test configurations, coverage
settings, and setup files across all packages
* Improves maintainability: Changes to test configuration defaults now
only need to be made in one place
* Better developer experience: New configs are more readable and easier
to customize with sensible defaults and preset combinations
The new system provides `createUnitConfig`, `createIntConfig`, and
`createE2eConfig` factory functions that automatically handle common
configuration patterns while still allowing customization through
override parameters.
Relates to first part of #1065
---------
Co-authored-by: Szymon.Poltorak <[email protected]>1 parent c4b025c commit a72e87c
File tree
66 files changed
+1188
-1087
lines changed- e2e
- ci-e2e
- cli-e2e
- create-cli-e2e
- nx-plugin-e2e
- plugin-coverage-e2e
- plugin-eslint-e2e
- plugin-js-packages-e2e
- plugin-jsdocs-e2e
- plugin-lighthouse-e2e
- plugin-typescript-e2e
- examples/plugins
- packages
- ci
- cli
- core
- create-cli
- models
- src/lib/implementation
- nx-plugin
- plugin-coverage
- plugin-eslint
- plugin-js-packages
- plugin-jsdocs
- plugin-lighthouse
- plugin-typescript
- utils
- testing
- test-nx-utils
- src/lib/utils
- test-setup-config
- src
- lib
- test-setup
- src/lib
- test-utils
- src/lib/utils
- tools/eslint-formatter-multi
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
66 files changed
+1188
-1087
lines changedThis file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
| 11 | + | |
13 | 12 | | |
14 | 13 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
| 1 | + | |
4 | 2 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
| 3 | + | |
| 4 | + | |
22 | 5 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
| 1 | + | |
4 | 2 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 3 | + | |
| 4 | + | |
21 | 5 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
| 1 | + | |
4 | 2 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
| 3 | + | |
| 4 | + | |
22 | 5 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
| 1 | + | |
4 | 2 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 3 | + | |
| 4 | + | |
21 | 5 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
| 1 | + | |
4 | 2 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 3 | + | |
| 4 | + | |
21 | 5 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
| 1 | + | |
4 | 2 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 3 | + | |
| 4 | + | |
21 | 5 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
| 1 | + | |
4 | 2 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 3 | + | |
| 4 | + | |
21 | 5 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
| 1 | + | |
4 | 2 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 3 | + | |
| 4 | + | |
21 | 5 | | |
0 commit comments