Skip to content

Commit 1dc6ee3

Browse files
chore: install Vitest V4
1 parent 97274b2 commit 1dc6ee3

File tree

5 files changed

+7
-13
lines changed

5 files changed

+7
-13
lines changed

apps/docs-app/docs/features/testing/vitest.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ ng g @analogjs/vitest-angular:setup --project [your-project-name] --browserMode
5858

5959
This automatically installs Playwright dependencies and configures Vitest for browser testing. See [Setup for Running Tests in the Browser](#setup-for-running-tests-in-the-browser) for more details.
6060

61+
If using browser mode, run `npx playwright install` after the schematic to ensure playwright is installed and configured.
62+
6163
Next, go to [running tests](#running-tests)
6264

6365
## Manual Installation

packages/vitest-angular-tools/src/schematics/setup/index.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ describe('setup schematic', () => {
6969
'@analogjs/vite-plugin-angular': '^2.2.3',
7070
jsdom: '^22.0.0',
7171
vite: '^7.0.0',
72-
vitest: '^3.0.0',
72+
vitest: '^4.0.0',
7373
'vite-tsconfig-paths': '^4.2.0',
7474
});
7575
});

packages/vitest-angular-tools/src/schematics/utils/dependencies.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
VITE,
88
VITE_TSCONFIG_PATHS,
99
VITEST_BROWSER_PLAYWRIGHT,
10-
VITEST_V3,
1110
VITEST_V4,
1211
} from './versions';
1312

@@ -25,12 +24,10 @@ export function getDevDependencies(
2524
throw new SchematicsException('Angular v17.0.0 or newer is required.');
2625
}
2726

28-
const vitestVersion = lt(escapedVersion, '21.0.0') ? VITEST_V3 : VITEST_V4;
29-
3027
const deps: Record<string, string> = {
3128
'@analogjs/vite-plugin-angular': ANALOG_JS_VITE_PLUGIN_ANGULAR,
3229
vite: VITE,
33-
vitest: vitestVersion,
30+
vitest: VITEST_V4,
3431
'vite-tsconfig-paths': VITE_TSCONFIG_PATHS,
3532
};
3633

packages/vitest-angular-tools/src/schematics/utils/versions.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ export const ANALOG_JS_VITE_PLUGIN_ANGULAR = '^2.2.3';
33
export const JSDOM = '^22.0.0';
44
export const VITE_TSCONFIG_PATHS = '^4.2.0';
55
export const VITE = '^7.0.0';
6-
export const VITEST_V3 = '^3.0.0';
76
export const VITEST_V4 = '^4.0.0';
87

98
// Browser mode dependencies

packages/vitest-angular/README.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,7 @@ yarn install @analogjs/vitest-angular vitest --dev
4141

4242
A schematic can be used to setup Vitest in an existing Angular project:
4343

44-
Install the `@analogjs/vitest-angular` package:
45-
46-
```sh
47-
npm i @analogjs/vitest-angular --save-dev
48-
```
49-
50-
Next, run the schematic to set up the Vite config, test configuration files, and update the test configuration.
44+
Run the schematic to set up the Vite config, test configuration files, and update the test configuration.
5145

5246
```sh
5347
npx ng generate @analogjs/vitest-angular:setup --project [your-project-name]
@@ -68,6 +62,8 @@ ng g @analogjs/vitest-angular:setup --project [your-project-name] --browserMode
6862

6963
This automatically installs Playwright dependencies and configures Vitest for browser testing. See [Setup for Running Tests in the Browser](#setup-for-running-tests-in-the-browser) for more details.
7064

65+
If using browser mode, run `npx playwright install` after the schematic to ensure playwright is installed and configured.
66+
7167
## Manual Setup
7268

7369
Vitest can be setup manually also using the steps below.

0 commit comments

Comments
 (0)