Caleb Ukle 74bd0bb00c
feat(testing): support root project generation for jest (#13353)
Co-authored-by: Miroslav Jonas <missing.manual@gmail.com>
2022-11-29 17:03:19 -05:00

20 lines
519 B
TypeScript

import { Tree } from '@nrwl/devkit';
import { jestProjectGenerator } from '@nrwl/jest';
import { NormalizedSchema } from '../schema';
export async function addJest(host: Tree, options: NormalizedSchema) {
if (options.unitTestRunner !== 'jest') {
return () => {};
}
return await jestProjectGenerator(host, {
...options,
project: options.projectName,
supportTsx: true,
skipSerializers: true,
setupFile: 'none',
compiler: options.compiler,
rootProject: options.rootProject,
});
}