Currently when trying to create an app named 'app' or a lib named 'lib', the schematics inject the 'projectType' as 'apps/application' or lib as 'libs/library', breaking the Angular build. fix #1844
26 lines
774 B
TypeScript
26 lines
774 B
TypeScript
import { replaceAppNameWithPath } from './cli-config-utils';
|
|
|
|
describe('replaceAppNameWithPath', () => {
|
|
describe('when node is `application`', () => {
|
|
describe('and appName is `app`', () => {
|
|
it('still returns the node', () => {
|
|
const node = 'application';
|
|
const appName = 'app';
|
|
const root = 'apps/app';
|
|
expect(replaceAppNameWithPath(node, appName, root)).toEqual(node);
|
|
});
|
|
});
|
|
});
|
|
|
|
describe('when node is `library`', () => {
|
|
describe('and appName is `lib`', () => {
|
|
it('still returns the node', () => {
|
|
const node = 'library';
|
|
const appName = 'lib';
|
|
const root = 'libs/lib';
|
|
expect(replaceAppNameWithPath(node, appName, root)).toEqual(node);
|
|
});
|
|
});
|
|
});
|
|
});
|