Skip to content

Commit

Permalink
feat(testing): remove --watch=false from inferred vitest targets to k…
Browse files Browse the repository at this point in the history
…eep things inlined with vitest recommendations
  • Loading branch information
jaysoo committed May 23, 2024
1 parent 94707d9 commit 4ec254e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
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

0 comments on commit 4ec254e

Please sign in to comment.