"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/cdk/schematics/ng-update/upgrade-rules/project-tsconfig-paths.spec.ts" between
material2-7.3.4.tar.gz and material2-7.3.5.tar.gz

About: material2 offers Material Design components for Angular.

project-tsconfig-paths.spec.ts  (material2-7.3.4):project-tsconfig-paths.spec.ts  (material2-7.3.5)
import {HostTree} from '@angular-devkit/schematics'; import {HostTree} from '@angular-devkit/schematics';
import {UnitTestTree} from '@angular-devkit/schematics/testing'; import {UnitTestTree} from '@angular-devkit/schematics/testing';
import {getProjectTsConfigPaths} from './project-tsconfig-paths'; import {getProjectTsConfigPaths} from './project-tsconfig-paths';
describe('ng-update project-tsconfig-paths', () => { describe('ng-update project-tsconfig-paths', () => {
let testTree: UnitTestTree; let testTree: UnitTestTree;
beforeEach(() => { beforeEach(() => {
testTree = new UnitTestTree(new HostTree()); testTree = new UnitTestTree(new HostTree());
}); });
it('should detect build tsconfig path inside of angular.json file', () => { it('should detect build tsconfig path inside of angular.json file', () => {
testTree.create('/my-custom-config.json', ''); testTree.create('/my-custom-config.json', '');
testTree.create('/angular.json', JSON.stringify({ testTree.create('/angular.json', JSON.stringify({
projects: { projects: {my_name: {architect: {build: {options: {tsConfig: './my-custom-
my_name: { config.json'}}}}}
architect: {
build: {
options: {
tsConfig: './my-custom-config.json'
}
}
}
}
}
})); }));
expect(getProjectTsConfigPaths(testTree)).toEqual(['./my-custom-config.json' ]); expect(getProjectTsConfigPaths(testTree)).toEqual(['my-custom-config.json']) ;
}); });
it('should detect test tsconfig path inside of .angular.json file', () => { it('should detect test tsconfig path inside of .angular.json file', () => {
testTree.create('/my-test-config.json', ''); testTree.create('/my-test-config.json', '');
testTree.create('/.angular.json', JSON.stringify({ testTree.create('/.angular.json', JSON.stringify({
projects: { projects: {with_tests: {architect: {test: {options: {tsConfig: './my-test-
with_tests: { config.json'}}}}}
architect: {
test: {
options: {
tsConfig: './my-test-config.json'
}
}
}
}
}
})); }));
expect(getProjectTsConfigPaths(testTree)).toEqual(['./my-test-config.json']) ; expect(getProjectTsConfigPaths(testTree)).toEqual(['my-test-config.json']);
}); });
it('should detect common tsconfigs if no workspace config could be found', () => { it('should detect common tsconfigs if no workspace config could be found', () => {
testTree.create('/tsconfig.json', ''); testTree.create('/tsconfig.json', '');
testTree.create('/src/tsconfig.json', ''); testTree.create('/src/tsconfig.json', '');
testTree.create('/src/tsconfig.app.json', ''); testTree.create('/src/tsconfig.app.json', '');
expect(getProjectTsConfigPaths(testTree)) expect(getProjectTsConfigPaths(testTree)).toEqual([
.toEqual(['./tsconfig.json', './src/tsconfig.json', './src/tsconfig.app.js 'tsconfig.json', 'src/tsconfig.json', 'src/tsconfig.app.json'
on']); ]);
});
it('should not return duplicate tsconfig files', () => {
testTree.create('/tsconfig.json', '');
testTree.create('/.angular.json', JSON.stringify({
projects: {app: {architect: {test: {options: {tsConfig: 'tsconfig.json'}}}
}}
}));
expect(getProjectTsConfigPaths(testTree)).toEqual(['tsconfig.json']);
}); });
}); });
 End of changes. 6 change blocks. 
28 lines changed or deleted 19 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)