Skip to content
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

feat(testing): remove --watch=false from inferred vitest targets to keep things inlined with vitest recommendations #25975

Merged
merged 1 commit into from
May 23, 2024
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
4 changes: 2 additions & 2 deletions e2e/vite/src/vite-crystal.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe('@nx/vite/plugin', () => {
}, 200_000);

it('should test application', () => {
const result = runCLI(`test ${myApp}`);
const result = runCLI(`test ${myApp} --watch=false`);
expect(result).toContain('Successfully ran target test');
}, 200_000);
});
Expand All @@ -60,7 +60,7 @@ describe('@nx/vite/plugin', () => {
}, 200_000);

it('should test application', () => {
const result = runCLI(`test ${myVueApp}`);
const result = runCLI(`test ${myVueApp} --watch=false`);
expect(result).toContain('Successfully ran target test');
}, 200_000);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ exports[`@nx/vite/plugin root project should create nodes 1`] = `
"vitest",
],
},
{
"env": "CI",
},
],
"options": {
"cwd": ".",
"watch": false,
},
"outputs": [
"{projectRoot}/coverage",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ exports[`@nx/vite/plugin with test node root project should create nodes - with
"vitest",
],
},
{
"env": "CI",
},
],
"options": {
"cwd": ".",
"watch": false,
},
"outputs": [
"{projectRoot}/coverage",
Expand Down
3 changes: 2 additions & 1 deletion packages/vite/src/plugins/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ async function testTarget(
) {
return {
command: `vitest`,
options: { cwd: joinPathFragments(projectRoot), watch: false },
options: { cwd: joinPathFragments(projectRoot) },
cache: true,
inputs: [
...('production' in namedInputs
Expand All @@ -225,6 +225,7 @@ async function testTarget(
{
externalDependencies: ['vitest'],
},
{ env: 'CI' },
],
outputs,
};
Expand Down