|
9 | 9 | import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing';
|
10 | 10 | import { parse as parseJson } from 'jsonc-parser';
|
11 | 11 | import { latestVersions } from '../utility/latest-versions';
|
12 |
| -import { getFileContent } from '../utility/test'; |
13 | 12 | import { Schema as WorkspaceOptions } from '../workspace/schema';
|
14 | 13 | import { Schema as ApplicationOptions, Style, ViewEncapsulation } from './schema';
|
15 | 14 |
|
@@ -52,7 +51,6 @@ describe('Application Schematic', () => {
|
52 | 51 | const files = tree.files;
|
53 | 52 | expect(files).toEqual(
|
54 | 53 | jasmine.arrayContaining([
|
55 |
| - '/projects/foo/karma.conf.js', |
56 | 54 | '/projects/foo/tsconfig.app.json',
|
57 | 55 | '/projects/foo/tsconfig.spec.json',
|
58 | 56 | '/projects/foo/src/favicon.ico',
|
@@ -165,14 +163,6 @@ describe('Application Schematic', () => {
|
165 | 163 | expect(_extends).toBe('../../tsconfig.json');
|
166 | 164 | });
|
167 | 165 |
|
168 |
| - it('should set the right coverage folder in the karma.json file', async () => { |
169 |
| - const tree = await schematicRunner |
170 |
| - .runSchematicAsync('application', defaultOptions, workspaceTree) |
171 |
| - .toPromise(); |
172 |
| - const karmaConf = getFileContent(tree, '/projects/foo/karma.conf.js'); |
173 |
| - expect(karmaConf).toContain(`dir: require('path').join(__dirname, '../../coverage/foo')`); |
174 |
| - }); |
175 |
| - |
176 | 166 | it('should set the skipTests flag for other schematics when using --skipTests=true', async () => {
|
177 | 167 | const options: ApplicationOptions = { ...defaultOptions, skipTests: true };
|
178 | 168 | const tree = await schematicRunner
|
@@ -250,7 +240,6 @@ describe('Application Schematic', () => {
|
250 | 240 | const files = tree.files;
|
251 | 241 | [
|
252 | 242 | '/projects/foo/tsconfig.spec.json',
|
253 |
| - '/projects/foo/karma.conf.js', |
254 | 243 | '/projects/foo/src/app/app.component.css',
|
255 | 244 | '/projects/foo/src/app/app.component.html',
|
256 | 245 | '/projects/foo/src/app/app.component.spec.ts',
|
@@ -278,6 +267,7 @@ describe('Application Schematic', () => {
|
278 | 267 | [
|
279 | 268 | '/projects/foo/tsconfig.spec.json',
|
280 | 269 | '/projects/foo/karma.conf.js',
|
| 270 | + '/projects/foo/src/test.ts', |
281 | 271 | '/projects/foo/src/app/app.component.html',
|
282 | 272 | '/projects/foo/src/app/app.component.spec.ts',
|
283 | 273 | ].forEach((x) => expect(files).not.toContain(x));
|
@@ -305,6 +295,7 @@ describe('Application Schematic', () => {
|
305 | 295 | [
|
306 | 296 | '/projects/foo/tsconfig.spec.json',
|
307 | 297 | '/projects/foo/karma.conf.js',
|
| 298 | + '/projects/foo/src/test.ts', |
308 | 299 | '/projects/foo/src/app/app.component.css',
|
309 | 300 | '/projects/foo/src/app/app.component.spec.ts',
|
310 | 301 | ].forEach((x) => expect(files).not.toContain(x));
|
@@ -388,7 +379,6 @@ describe('Application Schematic', () => {
|
388 | 379 | const files = tree.files;
|
389 | 380 | expect(files).toEqual(
|
390 | 381 | jasmine.arrayContaining([
|
391 |
| - '/karma.conf.js', |
392 | 382 | '/tsconfig.app.json',
|
393 | 383 | '/tsconfig.spec.json',
|
394 | 384 | '/src/favicon.ico',
|
@@ -421,7 +411,7 @@ describe('Application Schematic', () => {
|
421 | 411 |
|
422 | 412 | const testOpt = prj.architect.test.options;
|
423 | 413 | expect(testOpt.tsConfig).toEqual('tsconfig.spec.json');
|
424 |
| - expect(testOpt.karmaConfig).toEqual('karma.conf.js'); |
| 414 | + expect(testOpt.karmaConfig).toBeUndefined(); |
425 | 415 | expect(testOpt.styles).toEqual(['src/styles.css']);
|
426 | 416 | });
|
427 | 417 |
|
@@ -574,10 +564,5 @@ describe('Application Schematic', () => {
|
574 | 564 |
|
575 | 565 | const cfg = JSON.parse(tree.readContent('/angular.json'));
|
576 | 566 | expect(cfg.projects['@myscope/myapp']).toBeDefined();
|
577 |
| - |
578 |
| - const karmaConf = getFileContent(tree, '/projects/myscope/myapp/karma.conf.js'); |
579 |
| - expect(karmaConf).toContain( |
580 |
| - `dir: require('path').join(__dirname, '../../../coverage/myscope/myapp')`, |
581 |
| - ); |
582 | 567 | });
|
583 | 568 | });
|
0 commit comments