nx/packages/workspace/src/utils/cli-config-utils.spec.ts
Dan Smith f095647013 fix(angular): allow creating an app named 'app' or lib named 'lib'
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
2019-11-11 13:17:40 -05:00

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);
});
});
});
});