/
karma-project.ts
27 lines (23 loc) · 984 Bytes
/
karma-project.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import type { GeneratorCallback, Tree } from '@nrwl/devkit';
import { formatFiles } from '@nrwl/devkit';
import { checkProjectTestTarget } from './lib/check-test-target';
import { generateKarmaProjectFiles } from './lib/generate-karma-project-files';
import { updateTsConfigs } from './lib/update-tsconfig';
import { updateWorkspaceConfig } from './lib/update-workspace-config';
import type { KarmaProjectOptions } from './schema';
import { karmaGenerator } from '../../karma/karma';
export async function karmaProjectGenerator(
tree: Tree,
options: KarmaProjectOptions
): Promise<GeneratorCallback> {
const installTask = await karmaGenerator(tree, options);
checkProjectTestTarget(tree, options.project);
generateKarmaProjectFiles(tree, options.project);
updateTsConfigs(tree, options.project);
updateWorkspaceConfig(tree, options.project);
if (!options.skipFormat) {
await formatFiles(tree);
}
return installTask;
}
export default karmaProjectGenerator;