1
0
mirror of https://github.com/angular/angular-cli.git synced 2025-05-16 02:24:10 +08:00
2018-06-05 18:50:06 -07:00

41 lines
1.1 KiB
TypeScript

/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { WorkspaceProject } from '../utility/config';
import { buildDefaultPath } from './project';
describe('project', () => {
describe('buildDefaultPath', () => {
let project: WorkspaceProject;
beforeEach(() => {
project = {
projectType: 'application',
root: 'foo',
prefix: 'app',
};
});
it('should handle projectType of application', () => {
const result = buildDefaultPath(project);
expect(result).toEqual('/foo/src/app');
});
it('should handle projectType of library', () => {
project = { ...project, projectType: 'library' };
const result = buildDefaultPath(project);
expect(result).toEqual('/foo/src/lib');
});
it('should handle sourceRoot', () => {
project = { ...project, sourceRoot: 'foo/bar/custom' };
const result = buildDefaultPath(project);
expect(result).toEqual('/foo/bar/custom/app');
});
});
});