diff --git a/aio/content/examples/http/example-config.json b/aio/content/examples/http/example-config.json index e69de29bb2..317e9458f3 100644 --- a/aio/content/examples/http/example-config.json +++ b/aio/content/examples/http/example-config.json @@ -0,0 +1,3 @@ +{ + "projectType": "testing" +} diff --git a/aio/content/examples/http/src/index-specs.html b/aio/content/examples/http/src/index-specs.html index 6ab86ba366..26286a5083 100644 --- a/aio/content/examples/http/src/index-specs.html +++ b/aio/content/examples/http/src/index-specs.html @@ -1,11 +1,4 @@ - - - - - - App Tests - - - - - + diff --git a/aio/content/examples/http/src/test.css b/aio/content/examples/http/src/test.css new file mode 100644 index 0000000000..6010a5d9ba --- /dev/null +++ b/aio/content/examples/http/src/test.css @@ -0,0 +1 @@ +@import "~jasmine-core/lib/jasmine-core/jasmine.css" diff --git a/aio/content/examples/testing/example-config.json b/aio/content/examples/testing/example-config.json new file mode 100644 index 0000000000..317e9458f3 --- /dev/null +++ b/aio/content/examples/testing/example-config.json @@ -0,0 +1,3 @@ +{ + "projectType": "testing" +} diff --git a/aio/content/examples/testing/src/index-specs.html b/aio/content/examples/testing/src/index-specs.html index 6ab86ba366..ca132f6cd0 100644 --- a/aio/content/examples/testing/src/index-specs.html +++ b/aio/content/examples/testing/src/index-specs.html @@ -1,11 +1,4 @@ - - - - - - App Tests - - - - - + diff --git a/aio/content/examples/testing/src/index.html b/aio/content/examples/testing/src/index.html index bcbba0e48a..adc021fd82 100644 --- a/aio/content/examples/testing/src/index.html +++ b/aio/content/examples/testing/src/index.html @@ -6,7 +6,6 @@ App Under Test - diff --git a/aio/content/examples/testing/src/test.css b/aio/content/examples/testing/src/test.css new file mode 100644 index 0000000000..6010a5d9ba --- /dev/null +++ b/aio/content/examples/testing/src/test.css @@ -0,0 +1 @@ +@import "~jasmine-core/lib/jasmine-core/jasmine.css" diff --git a/aio/tools/examples/README.md b/aio/tools/examples/README.md index efcb2ddd81..ac85afeafb 100644 --- a/aio/tools/examples/README.md +++ b/aio/tools/examples/README.md @@ -32,8 +32,6 @@ Currently you will find the next boilerplates: * systemjs - Currently in deprecation, only used in a a few examples. * i18n - Based on the CLI one, features a few scripts for i18n. * universal - Based on the cli with a extra server for universal. -* elements - Based on the CLI, with a custom `tsconfig.json` for changing the `target` -* testing - Based on the CLI, with extra testing styles There is also a `common` folder that contains files used in all different examples. diff --git a/aio/tools/examples/example-boilerplate.js b/aio/tools/examples/example-boilerplate.js index 22112751a7..773b37aea6 100644 --- a/aio/tools/examples/example-boilerplate.js +++ b/aio/tools/examples/example-boilerplate.js @@ -61,6 +61,11 @@ BOILERPLATE_PATHS.i18n = [ 'package.json' ]; +BOILERPLATE_PATHS.testing = [ + ...cliRelativePath, + 'angular.json' +]; + BOILERPLATE_PATHS.universal = [ ...cliRelativePath, 'angular.json', diff --git a/aio/tools/examples/shared/boilerplate/testing/angular.json b/aio/tools/examples/shared/boilerplate/testing/angular.json new file mode 100644 index 0000000000..976280e171 --- /dev/null +++ b/aio/tools/examples/shared/boilerplate/testing/angular.json @@ -0,0 +1,128 @@ +{ + "$schema": "./node_modules/@angular/cli/lib/config/schema.json", + "version": 1, + "newProjectRoot": "projects", + "projects": { + "angular.io-example": { + "root": "", + "sourceRoot": "src", + "projectType": "application", + "prefix": "app", + "schematics": {}, + "architect": { + "build": { + "builder": "@angular-devkit/build-angular:browser", + "options": { + "outputPath": "dist", + "index": "src/index.html", + "main": "src/main.ts", + "polyfills": "src/polyfills.ts", + "tsConfig": "src/tsconfig.app.json", + "assets": [ + "src/favicon.ico", + "src/assets" + ], + "styles": [ + "src/styles.css" + ], + "scripts": [] + }, + "configurations": { + "production": { + "fileReplacements": [ + { + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.prod.ts" + } + ], + "optimization": true, + "outputHashing": "all", + "sourceMap": false, + "extractCss": true, + "namedChunks": false, + "aot": true, + "extractLicenses": true, + "vendorChunk": false, + "buildOptimizer": true + } + } + }, + "serve": { + "builder": "@angular-devkit/build-angular:dev-server", + "options": { + "browserTarget": "angular.io-example:build" + }, + "configurations": { + "production": { + "browserTarget": "angular.io-example:build:production" + } + } + }, + "extract-i18n": { + "builder": "@angular-devkit/build-angular:extract-i18n", + "options": { + "browserTarget": "angular.io-example:build" + } + }, + "test": { + "builder": "@angular-devkit/build-angular:karma", + "options": { + "main": "src/test.ts", + "polyfills": "src/polyfills.ts", + "tsConfig": "src/tsconfig.spec.json", + "karmaConfig": "src/karma.conf.js", + "styles": [ + "src/styles.css" + ], + "scripts": [], + "assets": [ + "src/favicon.ico", + "src/assets" + ] + } + }, + "lint": { + "builder": "@angular-devkit/build-angular:tslint", + "options": { + "tsConfig": [ + "src/tsconfig.app.json", + "src/tsconfig.spec.json" + ], + "exclude": [ + "**/node_modules/**" + ] + } + } + } + }, + "angular.io-example-e2e": { + "root": "e2e/", + "projectType": "application", + "prefix": "", + "architect": { + "e2e": { + "builder": "@angular-devkit/build-angular:protractor", + "options": { + "protractorConfig": "e2e/protractor.conf.js", + "devServerTarget": "angular.io-example:serve" + }, + "configurations": { + "production": { + "devServerTarget": "angular.io-example:serve:production" + } + } + }, + "lint": { + "builder": "@angular-devkit/build-angular:tslint", + "options": { + "tsConfig": "e2e/tsconfig.e2e.json", + "exclude": [ + "**/node_modules/**" + ] + } + } + } + } + }, + "defaultProject": "angular.io-example" +}