-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(angular): add vitest option to angular (#27311)
- This adds `vitest` option to `unitTestRunner` for Angular generators. - This **does not** add vitest option to `create-nx-workspace` but I think we should provide this as an option in the future. Please let me know if you wantme to add this here or as a future feature. --------- Co-authored-by: Colum Ferry <[email protected]>
- Loading branch information
Showing
27 changed files
with
481 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 18 additions & 7 deletions
25
packages/angular/src/generators/application/lib/add-unit-test-runner.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,26 @@ | ||
import { Tree } from '@nx/devkit'; | ||
import { UnitTestRunner } from '../../../utils/test-runners'; | ||
import { addJest } from '../../utils/add-jest'; | ||
import { addVitest } from '../../utils/add-vitest'; | ||
import type { NormalizedSchema } from './normalized-schema'; | ||
|
||
export async function addUnitTestRunner(host: Tree, options: NormalizedSchema) { | ||
if (options.unitTestRunner === UnitTestRunner.Jest) { | ||
await addJest(host, { | ||
name: options.name, | ||
projectRoot: options.appProjectRoot, | ||
skipPackageJson: options.skipPackageJson, | ||
strict: options.strict, | ||
}); | ||
switch (options.unitTestRunner) { | ||
case UnitTestRunner.Jest: | ||
await addJest(host, { | ||
name: options.name, | ||
projectRoot: options.appProjectRoot, | ||
skipPackageJson: options.skipPackageJson, | ||
strict: options.strict, | ||
}); | ||
break; | ||
case UnitTestRunner.Vitest: | ||
await addVitest(host, { | ||
name: options.name, | ||
projectRoot: options.appProjectRoot, | ||
skipPackageJson: options.skipPackageJson, | ||
strict: options.strict, | ||
}); | ||
break; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.