fix(schematics): do not add setup file for --no-module libs
This commit is contained in:
parent
47d99d49ba
commit
31061d42b6
@ -444,7 +444,8 @@ export default function(schema: Schema): Rule {
|
||||
updateTsConfig(options),
|
||||
options.unitTestRunner === 'jest'
|
||||
? schematic('jest-project', {
|
||||
project: options.name
|
||||
project: options.name,
|
||||
skipSetupFile: !options.module
|
||||
})
|
||||
: noop(),
|
||||
|
||||
|
||||
@ -435,6 +435,15 @@ describe('lib', () => {
|
||||
'libs/my-lib/tsconfig.spec.json'
|
||||
]);
|
||||
});
|
||||
|
||||
it('should skip the setup file if no module is generated', () => {
|
||||
const resultTree = schematicRunner.runSchematic(
|
||||
'lib',
|
||||
{ name: 'myLib', unitTestRunner: 'jest', module: false },
|
||||
appTree
|
||||
);
|
||||
expect(resultTree.exists('libs/my-lib/src/test-setup.ts')).toBeFalsy();
|
||||
});
|
||||
});
|
||||
|
||||
describe('--unit-test-runner none', () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user