From 3a8f74e3923c5789bb2eda494e146e41ddd2511a Mon Sep 17 00:00:00 2001 From: Jimmy Kasprzak Date: Sun, 12 May 2019 20:12:17 +0200 Subject: [PATCH] docs: fix example "testing" app compilation (#30427) PR Close #30427 --- .../testing/src/app/model/testing/index.ts | 2 +- aio/tools/examples/example-boilerplate.js | 9 ++++++-- .../boilerplate/testing/src/tsconfig.app.json | 22 +++++++++++++++++++ .../testing/src/tsconfig.spec.json | 19 ++++++++++++++++ 4 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 aio/tools/examples/shared/boilerplate/testing/src/tsconfig.app.json create mode 100644 aio/tools/examples/shared/boilerplate/testing/src/tsconfig.spec.json diff --git a/aio/content/examples/testing/src/app/model/testing/index.ts b/aio/content/examples/testing/src/app/model/testing/index.ts index 6da76e67db..898f64c278 100644 --- a/aio/content/examples/testing/src/app/model/testing/index.ts +++ b/aio/content/examples/testing/src/app/model/testing/index.ts @@ -1 +1 @@ -export * from './fake-hero.service'; +export * from './test-hero.service'; diff --git a/aio/tools/examples/example-boilerplate.js b/aio/tools/examples/example-boilerplate.js index 0bc5596607..cd34a0bed3 100644 --- a/aio/tools/examples/example-boilerplate.js +++ b/aio/tools/examples/example-boilerplate.js @@ -35,7 +35,12 @@ BOILERPLATE_PATHS.i18n = [...cliRelativePath, 'angular.json', 'package.json']; BOILERPLATE_PATHS['service-worker'] = [...cliRelativePath, 'angular.json', 'package.json']; -BOILERPLATE_PATHS.testing = [...cliRelativePath, 'angular.json']; +BOILERPLATE_PATHS.testing = [ + ...cliRelativePath, + 'angular.json', + 'src/tsconfig.app.json', + 'src/tsconfig.spec.json' +]; BOILERPLATE_PATHS.universal = [...cliRelativePath, 'angular.json', 'package.json']; @@ -93,7 +98,7 @@ class ExampleBoilerPlate { // Copy the boilerplate common files const useCommonBoilerplate = exampleConfig.useCommonBoilerplate !== false; - + if (useCommonBoilerplate) { BOILERPLATE_PATHS.common.forEach(filePath => this.copyFile(BOILERPLATE_COMMON_BASE_PATH, exampleFolder, filePath)); } diff --git a/aio/tools/examples/shared/boilerplate/testing/src/tsconfig.app.json b/aio/tools/examples/shared/boilerplate/testing/src/tsconfig.app.json new file mode 100644 index 0000000000..ad0bfc37fd --- /dev/null +++ b/aio/tools/examples/shared/boilerplate/testing/src/tsconfig.app.json @@ -0,0 +1,22 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "outDir": "../out-tsc/app", + "types": [] + }, + "exclude": [ + "test.ts", + "**/*.spec.ts", + "**/*.avoid.ts", + "**/*.0.ts", + "**/*.1.ts", + "**/*.1b.ts", + "**/*.2.ts", + "**/*.3.ts", + "**/*.4.ts", + "**/*.5.ts", + "**/*.6.ts", + "**/*.7.ts", + "**/testing" + ] +} diff --git a/aio/tools/examples/shared/boilerplate/testing/src/tsconfig.spec.json b/aio/tools/examples/shared/boilerplate/testing/src/tsconfig.spec.json new file mode 100644 index 0000000000..ca77f8ff5c --- /dev/null +++ b/aio/tools/examples/shared/boilerplate/testing/src/tsconfig.spec.json @@ -0,0 +1,19 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "outDir": "../out-tsc/spec", + "types": [ + "jasmine", + "node" + ] + }, + "files": [ + "test.ts", + "polyfills.ts" + ], + "include": [ + "**/*.spec.ts", + "**/*.d.ts", + "**/testing" + ] +}