Skip to content

Commit

Permalink
feat(vite): add --testFile argument to @nrwl/vite:test (#16324)
Browse files Browse the repository at this point in the history
Co-authored-by: Liam McAteer <=>
  • Loading branch information
liammcateer authored Apr 26, 2023
1 parent 369ee09 commit 83ada9d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions docs/generated/packages/vite/executors/test.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@
"reportsDirectory": {
"type": "string",
"description": "Directory to write coverage report to."
},
"testFile": {
"description": "The name of the file to test.",
"type": "string"
}
},
"required": [],
Expand Down
1 change: 1 addition & 0 deletions packages/vite/src/executors/test/schema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ export interface VitestExecutorOptions {
update?: boolean;
reportsDirectory?: string;
coverage?: boolean;
testFile?: string;
}
4 changes: 4 additions & 0 deletions packages/vite/src/executors/test/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@
"reportsDirectory": {
"type": "string",
"description": "Directory to write coverage report to."
},
"testFile": {
"description": "The name of the file to test.",
"type": "string"
}
},
"required": [],
Expand Down
3 changes: 2 additions & 1 deletion packages/vite/src/executors/test/vitest.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ export async function* vitestExecutor(
const nxReporter = new NxReporter(options.watch);
const settings = await getSettings(options, context);
settings.reporters.push(nxReporter);
const cliFilters = options.testFile ? [options.testFile] : [];

const ctx = await startVitest(options.mode, [], settings);
const ctx = await startVitest(options.mode, cliFilters, settings);

let hasErrors = false;

Expand Down

1 comment on commit 83ada9d

@vercel
Copy link

@vercel vercel bot commented on 83ada9d Apr 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx-five.vercel.app
nx-dev-nrwl.vercel.app
nx.dev
nx-dev-git-master-nrwl.vercel.app

Please sign in to comment.