From 220667f83e8e867b696604d932a1312afc77d5e2 Mon Sep 17 00:00:00 2001 From: timdeschryver <28659384+timdeschryver@users.noreply.github.com> Date: Thu, 25 Jun 2020 18:43:34 +0200 Subject: [PATCH 1/3] chore: migrate to NX --- .circleci/config.yml | 38 +- angular.json | 91 +- .../example-app}/app/app-routing.module.ts | 0 .../example-app}/app/app.component.css | 0 .../example-app}/app/app.component.html | 0 .../example-app}/app/app.component.ts | 0 {src => apps/example-app}/app/app.module.ts | 0 .../app/examples/00-single-component.spec.ts | 0 .../app/examples/00-single-component.ts | 0 .../app/examples/01-nested-component.spec.ts | 0 .../app/examples/01-nested-component.ts | 0 .../app/examples/02-input-output.spec.ts | 0 .../app/examples/02-input-output.ts | 0 .../app/examples/03-forms.spec.ts | 0 .../example-app}/app/examples/03-forms.ts | 0 .../examples/04-forms-with-material.spec.ts | 0 .../app/examples/04-forms-with-material.ts | 0 .../examples/05-component-provider.spec.ts | 0 .../app/examples/05-component-provider.ts | 0 .../app/examples/06-with-ngrx-store.spec.ts | 0 .../app/examples/06-with-ngrx-store.ts | 0 .../examples/07-with-ngrx-mock-store.spec.ts | 0 .../app/examples/07-with-ngrx-mock-store.ts | 0 .../app/examples/08-directive.spec.ts | 0 .../example-app}/app/examples/08-directive.ts | 0 .../app/examples/09-router.spec.ts | 0 .../example-app}/app/examples/09-router.ts | 0 .../10-inject-token-dependency.spec.ts | 0 .../examples/10-inject-token-dependency.ts | 0 .../app/examples/11-ng-content.spec.ts | 0 .../app/examples/11-ng-content.ts | 0 .../app/examples/12-service-component.spec.ts | 0 .../app/examples/12-service-component.ts | 0 .../example-app}/app/examples/README.md | 0 .../example-app}/app/issues/issue-106.spec.ts | 0 .../example-app}/app/material.module.ts | 0 {src => apps/example-app}/assets/.gitkeep | 0 .../app/examples/00-single-component.ts.html | 119 ++ .../app/examples/01-nested-component.ts.html | 170 ++ .../app/examples/02-input-output.ts.html | 128 ++ .../coverage/app/examples/03-forms.ts.html | 281 +++ .../examples/04-forms-with-material.ts.html | 347 ++++ .../examples/05-component-provider.ts.html | 179 ++ .../app/examples/06-with-ngrx-store.ts.html | 200 +++ .../examples/07-with-ngrx-mock-store.ts.html | 152 ++ .../app/examples/08-directive.ts.html | 155 ++ .../coverage/app/examples/09-router.ts.html | 200 +++ .../10-inject-token-dependency.ts.html | 113 ++ .../app/examples/11-ng-content.ts.html | 113 ++ .../app/examples/12-service-component.ts.html | 173 ++ .../coverage/app/examples/index.html | 291 +++ apps/example-app/coverage/app/index.html | 111 ++ .../coverage/app/material.module.ts.html | 107 ++ apps/example-app/coverage/base.css | 224 +++ apps/example-app/coverage/block-navigation.js | 79 + apps/example-app/coverage/favicon.png | Bin 0 -> 540 bytes apps/example-app/coverage/index.html | 126 ++ apps/example-app/coverage/prettify.css | 1 + apps/example-app/coverage/prettify.js | 2 + .../coverage/sort-arrow-sprite.png | Bin 0 -> 209 bytes apps/example-app/coverage/sorter.js | 170 ++ .../environments/environment.prod.ts | 0 .../example-app}/environments/environment.ts | 0 {src => apps/example-app}/favicon.ico | Bin {src => apps/example-app}/index.html | 0 apps/example-app/jest.config.js | 8 + {src => apps/example-app}/main.ts | 0 {src => apps/example-app}/polyfills.ts | 0 .../example-app/setup-jest.ts | 0 {src => apps/example-app}/styles.css | 0 .../example-app/tsconfig.json | 2 +- .../example-app/tsconfig.spec.json | 2 +- {src => apps/example-app}/tslint.json | 2 +- jest.base.config.js => jest.config.js | 11 +- nx.json | 30 + package.json | 26 +- projects/jest-utils/coverage/base.css | 224 +++ .../jest-utils/coverage/block-navigation.js | 79 + projects/jest-utils/coverage/favicon.png | Bin 0 -> 540 bytes projects/jest-utils/coverage/index.html | 126 ++ projects/jest-utils/coverage/prettify.css | 1 + projects/jest-utils/coverage/prettify.js | 2 + .../jest-utils/coverage/sort-arrow-sprite.png | Bin 0 -> 209 bytes projects/jest-utils/coverage/sorter.js | 170 ++ projects/jest-utils/coverage/src/index.html | 111 ++ .../coverage/src/lib/create-mock.ts.html | 191 ++ .../jest-utils/coverage/src/lib/index.html | 126 ++ .../jest-utils/coverage/src/lib/index.ts.html | 83 + .../coverage/src/public_api.ts.html | 95 + projects/jest-utils/index.ts | 1 + projects/jest-utils/jest.config.js | 8 + projects/jest-utils/ng-package.json | 4 +- projects/jest-utils/ng-package.prod.json | 8 - .../setup-jest.ts} | 0 projects/jest-utils/tsconfig.lib.json | 1 + projects/jest-utils/tsconfig.lib.prod.json | 6 - projects/jest-utils/tsconfig.spec.json | 7 + projects/jest.lib.config.js | 11 - projects/testing-library/coverage/base.css | 224 +++ .../coverage/block-navigation.js | 79 + projects/testing-library/coverage/favicon.png | Bin 0 -> 540 bytes projects/testing-library/coverage/index.html | 201 +++ .../coverage/migrations/4_0_0/index.html | 111 ++ .../coverage/migrations/4_0_0/index.ts.html | 170 ++ .../migrations/4_0_0/rules/index.html | 141 ++ .../rules/noComponentParametersRule.ts.html | 212 +++ .../rules/noComponentPropertyRule.ts.html | 146 ++ .../4_0_0/rules/noCreateComponentRule.ts.html | 200 +++ .../coverage/migrations/5_1_2/index.html | 111 ++ .../coverage/migrations/5_1_2/index.ts.html | 239 +++ .../migrations/5_1_2/rules/index.html | 111 ++ .../noAngularExtensionsImportRule.ts.html | 158 ++ .../testing-library/coverage/prettify.css | 1 + projects/testing-library/coverage/prettify.js | 2 + .../coverage/sort-arrow-sprite.png | Bin 0 -> 209 bytes projects/testing-library/coverage/sorter.js | 170 ++ .../testing-library/coverage/src/index.html | 111 ++ .../coverage/src/lib/config.ts.html | 152 ++ .../coverage/src/lib/index.html | 126 ++ .../coverage/src/lib/testing-library.ts.html | 1574 +++++++++++++++++ .../coverage/src/lib/user-events/index.html | 156 ++ .../src/lib/user-events/index.ts.html | 254 +++ .../src/lib/user-events/selectOptions.ts.html | 275 +++ .../coverage/src/lib/user-events/tab.ts.html | 110 ++ .../coverage/src/lib/user-events/type.ts.html | 389 ++++ .../coverage/src/public_api.ts.html | 104 ++ projects/testing-library/index.ts | 1 + projects/testing-library/jest.config.js | 8 + projects/testing-library/ng-package.json | 2 +- projects/testing-library/ng-package.prod.json | 14 - projects/testing-library/setup-jest.ts | 2 + projects/testing-library/tsconfig.lib.json | 1 + .../testing-library/tsconfig.lib.prod.json | 6 - projects/testing-library/tsconfig.spec.json | 7 + src/jest.app.config.js | 13 - tsconfig.json | 4 +- yarn.lock | 1557 +++++++++++++++- 137 files changed, 11887 insertions(+), 160 deletions(-) rename {src => apps/example-app}/app/app-routing.module.ts (100%) rename {src => apps/example-app}/app/app.component.css (100%) rename {src => apps/example-app}/app/app.component.html (100%) rename {src => apps/example-app}/app/app.component.ts (100%) rename {src => apps/example-app}/app/app.module.ts (100%) rename {src => apps/example-app}/app/examples/00-single-component.spec.ts (100%) rename {src => apps/example-app}/app/examples/00-single-component.ts (100%) rename {src => apps/example-app}/app/examples/01-nested-component.spec.ts (100%) rename {src => apps/example-app}/app/examples/01-nested-component.ts (100%) rename {src => apps/example-app}/app/examples/02-input-output.spec.ts (100%) rename {src => apps/example-app}/app/examples/02-input-output.ts (100%) rename {src => apps/example-app}/app/examples/03-forms.spec.ts (100%) rename {src => apps/example-app}/app/examples/03-forms.ts (100%) rename {src => apps/example-app}/app/examples/04-forms-with-material.spec.ts (100%) rename {src => apps/example-app}/app/examples/04-forms-with-material.ts (100%) rename {src => apps/example-app}/app/examples/05-component-provider.spec.ts (100%) rename {src => apps/example-app}/app/examples/05-component-provider.ts (100%) rename {src => apps/example-app}/app/examples/06-with-ngrx-store.spec.ts (100%) rename {src => apps/example-app}/app/examples/06-with-ngrx-store.ts (100%) rename {src => apps/example-app}/app/examples/07-with-ngrx-mock-store.spec.ts (100%) rename {src => apps/example-app}/app/examples/07-with-ngrx-mock-store.ts (100%) rename {src => apps/example-app}/app/examples/08-directive.spec.ts (100%) rename {src => apps/example-app}/app/examples/08-directive.ts (100%) rename {src => apps/example-app}/app/examples/09-router.spec.ts (100%) rename {src => apps/example-app}/app/examples/09-router.ts (100%) rename {src => apps/example-app}/app/examples/10-inject-token-dependency.spec.ts (100%) rename {src => apps/example-app}/app/examples/10-inject-token-dependency.ts (100%) rename {src => apps/example-app}/app/examples/11-ng-content.spec.ts (100%) rename {src => apps/example-app}/app/examples/11-ng-content.ts (100%) rename {src => apps/example-app}/app/examples/12-service-component.spec.ts (100%) rename {src => apps/example-app}/app/examples/12-service-component.ts (100%) rename {src => apps/example-app}/app/examples/README.md (100%) rename {src => apps/example-app}/app/issues/issue-106.spec.ts (100%) rename {src => apps/example-app}/app/material.module.ts (100%) rename {src => apps/example-app}/assets/.gitkeep (100%) create mode 100644 apps/example-app/coverage/app/examples/00-single-component.ts.html create mode 100644 apps/example-app/coverage/app/examples/01-nested-component.ts.html create mode 100644 apps/example-app/coverage/app/examples/02-input-output.ts.html create mode 100644 apps/example-app/coverage/app/examples/03-forms.ts.html create mode 100644 apps/example-app/coverage/app/examples/04-forms-with-material.ts.html create mode 100644 apps/example-app/coverage/app/examples/05-component-provider.ts.html create mode 100644 apps/example-app/coverage/app/examples/06-with-ngrx-store.ts.html create mode 100644 apps/example-app/coverage/app/examples/07-with-ngrx-mock-store.ts.html create mode 100644 apps/example-app/coverage/app/examples/08-directive.ts.html create mode 100644 apps/example-app/coverage/app/examples/09-router.ts.html create mode 100644 apps/example-app/coverage/app/examples/10-inject-token-dependency.ts.html create mode 100644 apps/example-app/coverage/app/examples/11-ng-content.ts.html create mode 100644 apps/example-app/coverage/app/examples/12-service-component.ts.html create mode 100644 apps/example-app/coverage/app/examples/index.html create mode 100644 apps/example-app/coverage/app/index.html create mode 100644 apps/example-app/coverage/app/material.module.ts.html create mode 100644 apps/example-app/coverage/base.css create mode 100644 apps/example-app/coverage/block-navigation.js create mode 100644 apps/example-app/coverage/favicon.png create mode 100644 apps/example-app/coverage/index.html create mode 100644 apps/example-app/coverage/prettify.css create mode 100644 apps/example-app/coverage/prettify.js create mode 100644 apps/example-app/coverage/sort-arrow-sprite.png create mode 100644 apps/example-app/coverage/sorter.js rename {src => apps/example-app}/environments/environment.prod.ts (100%) rename {src => apps/example-app}/environments/environment.ts (100%) rename {src => apps/example-app}/favicon.ico (100%) rename {src => apps/example-app}/index.html (100%) create mode 100644 apps/example-app/jest.config.js rename {src => apps/example-app}/main.ts (100%) rename {src => apps/example-app}/polyfills.ts (100%) rename src/setupJest.ts => apps/example-app/setup-jest.ts (100%) rename {src => apps/example-app}/styles.css (100%) rename src/tsconfig.app.json => apps/example-app/tsconfig.json (79%) rename tsconfig.spec.json => apps/example-app/tsconfig.spec.json (70%) rename {src => apps/example-app}/tslint.json (81%) rename jest.base.config.js => jest.config.js (51%) create mode 100644 nx.json create mode 100644 projects/jest-utils/coverage/base.css create mode 100644 projects/jest-utils/coverage/block-navigation.js create mode 100644 projects/jest-utils/coverage/favicon.png create mode 100644 projects/jest-utils/coverage/index.html create mode 100644 projects/jest-utils/coverage/prettify.css create mode 100644 projects/jest-utils/coverage/prettify.js create mode 100644 projects/jest-utils/coverage/sort-arrow-sprite.png create mode 100644 projects/jest-utils/coverage/sorter.js create mode 100644 projects/jest-utils/coverage/src/index.html create mode 100644 projects/jest-utils/coverage/src/lib/create-mock.ts.html create mode 100644 projects/jest-utils/coverage/src/lib/index.html create mode 100644 projects/jest-utils/coverage/src/lib/index.ts.html create mode 100644 projects/jest-utils/coverage/src/public_api.ts.html create mode 100644 projects/jest-utils/index.ts create mode 100644 projects/jest-utils/jest.config.js delete mode 100644 projects/jest-utils/ng-package.prod.json rename projects/{setupJest.ts => jest-utils/setup-jest.ts} (100%) delete mode 100644 projects/jest-utils/tsconfig.lib.prod.json create mode 100644 projects/jest-utils/tsconfig.spec.json delete mode 100644 projects/jest.lib.config.js create mode 100644 projects/testing-library/coverage/base.css create mode 100644 projects/testing-library/coverage/block-navigation.js create mode 100644 projects/testing-library/coverage/favicon.png create mode 100644 projects/testing-library/coverage/index.html create mode 100644 projects/testing-library/coverage/migrations/4_0_0/index.html create mode 100644 projects/testing-library/coverage/migrations/4_0_0/index.ts.html create mode 100644 projects/testing-library/coverage/migrations/4_0_0/rules/index.html create mode 100644 projects/testing-library/coverage/migrations/4_0_0/rules/noComponentParametersRule.ts.html create mode 100644 projects/testing-library/coverage/migrations/4_0_0/rules/noComponentPropertyRule.ts.html create mode 100644 projects/testing-library/coverage/migrations/4_0_0/rules/noCreateComponentRule.ts.html create mode 100644 projects/testing-library/coverage/migrations/5_1_2/index.html create mode 100644 projects/testing-library/coverage/migrations/5_1_2/index.ts.html create mode 100644 projects/testing-library/coverage/migrations/5_1_2/rules/index.html create mode 100644 projects/testing-library/coverage/migrations/5_1_2/rules/noAngularExtensionsImportRule.ts.html create mode 100644 projects/testing-library/coverage/prettify.css create mode 100644 projects/testing-library/coverage/prettify.js create mode 100644 projects/testing-library/coverage/sort-arrow-sprite.png create mode 100644 projects/testing-library/coverage/sorter.js create mode 100644 projects/testing-library/coverage/src/index.html create mode 100644 projects/testing-library/coverage/src/lib/config.ts.html create mode 100644 projects/testing-library/coverage/src/lib/index.html create mode 100644 projects/testing-library/coverage/src/lib/testing-library.ts.html create mode 100644 projects/testing-library/coverage/src/lib/user-events/index.html create mode 100644 projects/testing-library/coverage/src/lib/user-events/index.ts.html create mode 100644 projects/testing-library/coverage/src/lib/user-events/selectOptions.ts.html create mode 100644 projects/testing-library/coverage/src/lib/user-events/tab.ts.html create mode 100644 projects/testing-library/coverage/src/lib/user-events/type.ts.html create mode 100644 projects/testing-library/coverage/src/public_api.ts.html create mode 100644 projects/testing-library/index.ts create mode 100644 projects/testing-library/jest.config.js delete mode 100644 projects/testing-library/ng-package.prod.json create mode 100644 projects/testing-library/setup-jest.ts delete mode 100644 projects/testing-library/tsconfig.lib.prod.json create mode 100644 projects/testing-library/tsconfig.spec.json delete mode 100644 src/jest.app.config.js diff --git a/.circleci/config.yml b/.circleci/config.yml index 3744ae17..7571ec1c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,7 +17,7 @@ jobs: key: *cache_key - run: name: install-dependencies - command: yarn --frozen-lockfile + command: yarn --frozen-lockfile --non-interactive - save_cache: key: *cache_key paths: @@ -31,19 +31,9 @@ jobs: key: *cache_key - run: name: lint - command: yarn lint + command: yarn affected:lint - test-lib: - <<: *job_defaults - steps: - - checkout - - restore_cache: - key: *cache_key - - run: - name: test - command: yarn test --maxWorkers=1 --ci - - build-lib: + build: <<: *job_defaults steps: - checkout @@ -56,18 +46,18 @@ jobs: key: *dist_key paths: - dist + - store_artifacts: + path: dist - test-app: + test: <<: *job_defaults steps: - checkout - restore_cache: key: *cache_key - - restore_cache: - key: *dist_key - run: name: test - command: yarn test:app --maxWorkers=1 --ci + command: yarn affected:test --ci --code-coverage release: <<: *job_defaults @@ -101,26 +91,22 @@ workflows: - lint: requires: - install - - test-lib: - requires: - - install - - build-lib: + - build: requires: - lint - - test-lib - - test-app: + - test: requires: - - build-lib + - build - release: requires: - - test-app + - test filters: branches: only: - master - release-beta: requires: - - test-app + - test filters: branches: only: diff --git a/angular.json b/angular.json index 9d6a47b3..a1235c9d 100644 --- a/angular.json +++ b/angular.json @@ -1,9 +1,9 @@ { "$schema": "./node_modules/@angular/cli/lib/config/schema.json", "version": 1, - "newProjectRoot": "projects", + "newProjectRoot": "", "projects": { - "testing-library-app": { + "example-app": { "root": "", "sourceRoot": "src", "projectType": "application", @@ -14,13 +14,13 @@ "builder": "@angular-devkit/build-angular:browser", "options": { "aot": true, - "outputPath": "dist/testing-library-app", - "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"], + "outputPath": "dist/apps/example-app", + "index": "apps/example-app/index.html", + "main": "apps/example-app/main.ts", + "polyfills": "apps/example-app/polyfills.ts", + "tsConfig": "apps/example-app/tsconfig.json", + "assets": ["apps/example-app/favicon.ico", "apps/example-app/assets"], + "styles": ["apps/example-app/styles.css"], "scripts": [] }, "configurations": { @@ -33,8 +33,8 @@ ], "fileReplacements": [ { - "replace": "src/environments/environment.ts", - "with": "src/environments/environment.prod.ts" + "replace": "apps/example-app/environments/environment.ts", + "with": "apps/example-app/environments/environment.prod.ts" } ], "optimization": true, @@ -69,9 +69,17 @@ "lint": { "builder": "@angular-devkit/build-angular:tslint", "options": { - "tsConfig": ["src/tsconfig.app.json", "./tsconfig.spec.json"], + "tsConfig": ["apps/example-app/tsconfig.json", "apps/example-app/tsconfig.spec.json"], "exclude": ["**/node_modules/**"] } + }, + "test": { + "builder": "@nrwl/jest:jest", + "options": { + "jestConfig": "apps/example-app/jest.config.js", + "tsConfig": "apps/example-app/tsconfig.spec.json", + "setupFile": "apps/example-app/setup-jest.ts" + } } } }, @@ -89,17 +97,45 @@ }, "configurations": { "production": { - "project": "projects/testing-library/ng-package.prod.json", - "tsConfig": "projects/testing-library/tsconfig.lib.prod.json" + "project": "projects/testing-library/ng-package.json", + "tsConfig": "projects/testing-library/tsconfig.lib.json" } } }, "lint": { "builder": "@angular-devkit/build-angular:tslint", "options": { - "tsConfig": ["projects/testing-library/tsconfig.lib.json", "./tsconfig.spec.json"], + "tsConfig": ["projects/testing-library/tsconfig.lib.json", "projects/testing-library/tsconfig.spec.json"], "exclude": ["**/node_modules/**"] } + }, + "build-release": { + "builder": "@nrwl/workspace:run-commands", + "options": { + "parallel": false, + "commands": [ + { + "command": "ng build testing-library" + }, + { + "command": "tsc -p ./projects/testing-library/migrations/tsconfig.migrations.json" + }, + { + "command": "cpy ./projects/testing-library/migrations/migration.json ./dist/@testing-library/angular/migrations" + }, + { + "command": "cpy ./README.md ./dist/@testing-library/angular" + } + ] + } + }, + "test": { + "builder": "@nrwl/jest:jest", + "options": { + "jestConfig": "projects/testing-library/jest.config.js", + "tsConfig": "projects/testing-library/tsconfig.spec.json", + "setupFile": "projects/testing-library/setup-jest.ts" + } } } }, @@ -117,17 +153,36 @@ }, "configurations": { "production": { - "project": "projects/jest-utils/ng-package.prod.json", - "tsConfig": "projects/jest-utils/tsconfig.lib.prod.json" + "project": "projects/jest-utils/ng-package.json", + "tsConfig": "projects/jest-utils/tsconfig.lib.json" } } }, "lint": { "builder": "@angular-devkit/build-angular:tslint", "options": { - "tsConfig": ["projects/jest-utils/tsconfig.lib.json", "./tsconfig.spec.json"], + "tsConfig": ["projects/jest-utils/tsconfig.lib.json", "projects/jest-utils/tsconfig.spec.json"], "exclude": ["**/node_modules/**"] } + }, + "build-release": { + "builder": "@nrwl/workspace:run-commands", + "options": { + "parallel": false, + "commands": [ + { + "command": "ng build jest-utils" + } + ] + } + }, + "test": { + "builder": "@nrwl/jest:jest", + "options": { + "jestConfig": "projects/jest-utils/jest.config.js", + "tsConfig": "projects/jest-utils/tsconfig.spec.json", + "setupFile": "projects/jest-utils/setup-jest.ts" + } } } } diff --git a/src/app/app-routing.module.ts b/apps/example-app/app/app-routing.module.ts similarity index 100% rename from src/app/app-routing.module.ts rename to apps/example-app/app/app-routing.module.ts diff --git a/src/app/app.component.css b/apps/example-app/app/app.component.css similarity index 100% rename from src/app/app.component.css rename to apps/example-app/app/app.component.css diff --git a/src/app/app.component.html b/apps/example-app/app/app.component.html similarity index 100% rename from src/app/app.component.html rename to apps/example-app/app/app.component.html diff --git a/src/app/app.component.ts b/apps/example-app/app/app.component.ts similarity index 100% rename from src/app/app.component.ts rename to apps/example-app/app/app.component.ts diff --git a/src/app/app.module.ts b/apps/example-app/app/app.module.ts similarity index 100% rename from src/app/app.module.ts rename to apps/example-app/app/app.module.ts diff --git a/src/app/examples/00-single-component.spec.ts b/apps/example-app/app/examples/00-single-component.spec.ts similarity index 100% rename from src/app/examples/00-single-component.spec.ts rename to apps/example-app/app/examples/00-single-component.spec.ts diff --git a/src/app/examples/00-single-component.ts b/apps/example-app/app/examples/00-single-component.ts similarity index 100% rename from src/app/examples/00-single-component.ts rename to apps/example-app/app/examples/00-single-component.ts diff --git a/src/app/examples/01-nested-component.spec.ts b/apps/example-app/app/examples/01-nested-component.spec.ts similarity index 100% rename from src/app/examples/01-nested-component.spec.ts rename to apps/example-app/app/examples/01-nested-component.spec.ts diff --git a/src/app/examples/01-nested-component.ts b/apps/example-app/app/examples/01-nested-component.ts similarity index 100% rename from src/app/examples/01-nested-component.ts rename to apps/example-app/app/examples/01-nested-component.ts diff --git a/src/app/examples/02-input-output.spec.ts b/apps/example-app/app/examples/02-input-output.spec.ts similarity index 100% rename from src/app/examples/02-input-output.spec.ts rename to apps/example-app/app/examples/02-input-output.spec.ts diff --git a/src/app/examples/02-input-output.ts b/apps/example-app/app/examples/02-input-output.ts similarity index 100% rename from src/app/examples/02-input-output.ts rename to apps/example-app/app/examples/02-input-output.ts diff --git a/src/app/examples/03-forms.spec.ts b/apps/example-app/app/examples/03-forms.spec.ts similarity index 100% rename from src/app/examples/03-forms.spec.ts rename to apps/example-app/app/examples/03-forms.spec.ts diff --git a/src/app/examples/03-forms.ts b/apps/example-app/app/examples/03-forms.ts similarity index 100% rename from src/app/examples/03-forms.ts rename to apps/example-app/app/examples/03-forms.ts diff --git a/src/app/examples/04-forms-with-material.spec.ts b/apps/example-app/app/examples/04-forms-with-material.spec.ts similarity index 100% rename from src/app/examples/04-forms-with-material.spec.ts rename to apps/example-app/app/examples/04-forms-with-material.spec.ts diff --git a/src/app/examples/04-forms-with-material.ts b/apps/example-app/app/examples/04-forms-with-material.ts similarity index 100% rename from src/app/examples/04-forms-with-material.ts rename to apps/example-app/app/examples/04-forms-with-material.ts diff --git a/src/app/examples/05-component-provider.spec.ts b/apps/example-app/app/examples/05-component-provider.spec.ts similarity index 100% rename from src/app/examples/05-component-provider.spec.ts rename to apps/example-app/app/examples/05-component-provider.spec.ts diff --git a/src/app/examples/05-component-provider.ts b/apps/example-app/app/examples/05-component-provider.ts similarity index 100% rename from src/app/examples/05-component-provider.ts rename to apps/example-app/app/examples/05-component-provider.ts diff --git a/src/app/examples/06-with-ngrx-store.spec.ts b/apps/example-app/app/examples/06-with-ngrx-store.spec.ts similarity index 100% rename from src/app/examples/06-with-ngrx-store.spec.ts rename to apps/example-app/app/examples/06-with-ngrx-store.spec.ts diff --git a/src/app/examples/06-with-ngrx-store.ts b/apps/example-app/app/examples/06-with-ngrx-store.ts similarity index 100% rename from src/app/examples/06-with-ngrx-store.ts rename to apps/example-app/app/examples/06-with-ngrx-store.ts diff --git a/src/app/examples/07-with-ngrx-mock-store.spec.ts b/apps/example-app/app/examples/07-with-ngrx-mock-store.spec.ts similarity index 100% rename from src/app/examples/07-with-ngrx-mock-store.spec.ts rename to apps/example-app/app/examples/07-with-ngrx-mock-store.spec.ts diff --git a/src/app/examples/07-with-ngrx-mock-store.ts b/apps/example-app/app/examples/07-with-ngrx-mock-store.ts similarity index 100% rename from src/app/examples/07-with-ngrx-mock-store.ts rename to apps/example-app/app/examples/07-with-ngrx-mock-store.ts diff --git a/src/app/examples/08-directive.spec.ts b/apps/example-app/app/examples/08-directive.spec.ts similarity index 100% rename from src/app/examples/08-directive.spec.ts rename to apps/example-app/app/examples/08-directive.spec.ts diff --git a/src/app/examples/08-directive.ts b/apps/example-app/app/examples/08-directive.ts similarity index 100% rename from src/app/examples/08-directive.ts rename to apps/example-app/app/examples/08-directive.ts diff --git a/src/app/examples/09-router.spec.ts b/apps/example-app/app/examples/09-router.spec.ts similarity index 100% rename from src/app/examples/09-router.spec.ts rename to apps/example-app/app/examples/09-router.spec.ts diff --git a/src/app/examples/09-router.ts b/apps/example-app/app/examples/09-router.ts similarity index 100% rename from src/app/examples/09-router.ts rename to apps/example-app/app/examples/09-router.ts diff --git a/src/app/examples/10-inject-token-dependency.spec.ts b/apps/example-app/app/examples/10-inject-token-dependency.spec.ts similarity index 100% rename from src/app/examples/10-inject-token-dependency.spec.ts rename to apps/example-app/app/examples/10-inject-token-dependency.spec.ts diff --git a/src/app/examples/10-inject-token-dependency.ts b/apps/example-app/app/examples/10-inject-token-dependency.ts similarity index 100% rename from src/app/examples/10-inject-token-dependency.ts rename to apps/example-app/app/examples/10-inject-token-dependency.ts diff --git a/src/app/examples/11-ng-content.spec.ts b/apps/example-app/app/examples/11-ng-content.spec.ts similarity index 100% rename from src/app/examples/11-ng-content.spec.ts rename to apps/example-app/app/examples/11-ng-content.spec.ts diff --git a/src/app/examples/11-ng-content.ts b/apps/example-app/app/examples/11-ng-content.ts similarity index 100% rename from src/app/examples/11-ng-content.ts rename to apps/example-app/app/examples/11-ng-content.ts diff --git a/src/app/examples/12-service-component.spec.ts b/apps/example-app/app/examples/12-service-component.spec.ts similarity index 100% rename from src/app/examples/12-service-component.spec.ts rename to apps/example-app/app/examples/12-service-component.spec.ts diff --git a/src/app/examples/12-service-component.ts b/apps/example-app/app/examples/12-service-component.ts similarity index 100% rename from src/app/examples/12-service-component.ts rename to apps/example-app/app/examples/12-service-component.ts diff --git a/src/app/examples/README.md b/apps/example-app/app/examples/README.md similarity index 100% rename from src/app/examples/README.md rename to apps/example-app/app/examples/README.md diff --git a/src/app/issues/issue-106.spec.ts b/apps/example-app/app/issues/issue-106.spec.ts similarity index 100% rename from src/app/issues/issue-106.spec.ts rename to apps/example-app/app/issues/issue-106.spec.ts diff --git a/src/app/material.module.ts b/apps/example-app/app/material.module.ts similarity index 100% rename from src/app/material.module.ts rename to apps/example-app/app/material.module.ts diff --git a/src/assets/.gitkeep b/apps/example-app/assets/.gitkeep similarity index 100% rename from src/assets/.gitkeep rename to apps/example-app/assets/.gitkeep diff --git a/apps/example-app/coverage/app/examples/00-single-component.ts.html b/apps/example-app/coverage/app/examples/00-single-component.ts.html new file mode 100644 index 00000000..a3b0a834 --- /dev/null +++ b/apps/example-app/coverage/app/examples/00-single-component.ts.html @@ -0,0 +1,119 @@ + + + + +
++ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 | 1x + + + + + + + + + +1x +1x + + | import { Component } from '@angular/core'; + +@Component({ + selector: 'app-fixture', + template: ` + <button (click)="value = value - 1">Decrement</button> + <span data-testid="value">{{ value }}</span> + <button (click)="value = value + 1">Increment</button> + `, +}) +export class SingleComponent { + value = 0; +} + |
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 | 1x + + + + + +1x +1x +2x + + + + + + +1x +1x + + + + + + + + + + +1x +1x + + | import { Component, Input, Output, EventEmitter } from '@angular/core'; + +@Component({ + selector: 'app-button', + template: ` <button (click)="raise.emit()">{{ name }}</button> `, +}) +export class NestedButtonComponent { + @Input() name: string; + @Output() raise = new EventEmitter<void>(); +} + +@Component({ + selector: 'app-value', + template: ` <span data-testid="value">{{ value }}</span> `, +}) +export class NestedValueComponent { + @Input() value: number; +} + +@Component({ + selector: 'app-fixture', + template: ` + <app-button (raise)="value = value - 1" name="Decrement"></app-button> + <app-value [value]="value"></app-value> + <app-button (raise)="value = value + 1" name="Increment"></app-button> + `, +}) +export class NestedContainerComponent { + value = 0; +} + |
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 | 1x + + + + + + + + + + + +1x +1x +1x + + | import { Component, EventEmitter, Input, Output } from '@angular/core'; + +@Component({ + selector: 'app-fixture', + template: ` + <button (click)="value = value - 1">Decrement</button> + <span data-testid="value">{{ value }}</span> + <button (click)="value = value + 1">Increment</button> + + <button (click)="sendValue.emit(value)">Send</button> + `, +}) +export class InputOutputComponent { + @Input() value = 0; + @Output() sendValue = new EventEmitter<number>(); +} + |
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 | 1x +1x + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +1x +1x + + + + +1x + + + + + +1x + + +280x + +840x +840x +484x +484x +484x + +208x + +136x + +140x + + + + +840x + + + + | import { Component } from '@angular/core'; +import { FormBuilder, Validators, ValidationErrors } from '@angular/forms'; + +@Component({ + selector: 'app-fixture', + template: ` + <form [formGroup]="form" name="form"> + <div> + <label for="name">Name</label> + <input type="text" id="name" name="name" formControlName="name" required /> + </div> + + <div> + <label for="score">Score</label> + <input type="number" id="score" name="score" formControlName="score" required min="0" max="10" /> + </div> + + <div> + <label for="color">Color</label> + <select id="color" name="color" formControlName="color"> + <option value="">---</option> + <option *ngFor="let color of colors" [value]="color.id">{{ color.value }}</option> + </select> + </div> + + <div role="alert" *ngIf="formErrors.length"> + <p *ngFor="let error of formErrors">{{ error }}</p> + </div> + </form> + `, +}) +export class FormsComponent { + colors = [ + { id: 'R', value: 'Red' }, + { id: 'B', value: 'Blue' }, + { id: 'G', value: 'Green' }, + ]; + form = this.formBuilder.group({ + name: ['', Validators.required], + score: [0, { validators: [Validators.min(1), Validators.max(10)], updateOn: 'blur' }], + color: ['', Validators.required], + }); + + constructor(private formBuilder: FormBuilder) {} + + get formErrors() { + return Object.keys(this.form.controls) + .map((formKey) => { + const controlErrors: ValidationErrors = this.form.get(formKey).errors; + if (controlErrors != null) { + return Object.keys(controlErrors).map((keyError) => { + const error = controlErrors[keyError]; + switch (keyError) { + case 'required': + return `${formKey} is required`; + case 'min': + return `${formKey} must be greater than ${error.min}`; + case 'max': + return `${formKey} must be lesser than ${error.max}`; + } + }); + } + }) + .reduce((errors, value) => errors.concat(value), []) + .filter(Boolean); + } +} + |
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 | 1x +1x + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +1x +1x + + + + +1x + + + + + +1x + + +264x + +792x +792x +444x +444x +444x + +224x + +100x + +120x + + + + +792x + + + + | import { Component } from '@angular/core'; +import { FormBuilder, Validators, ValidationErrors } from '@angular/forms'; + +@Component({ + selector: 'app-fixture', + template: ` + <form [formGroup]="form" name="form"> + <mat-form-field> + <input matInput placeholder="Name" name="name" formControlName="name" required /> + </mat-form-field> + + <mat-form-field> + <input + matInput + type="number" + placeholder="Score" + name="score" + formControlName="score" + required + min="0" + max="10" + /> + </mat-form-field> + + <mat-form-field> + <mat-select placeholder="Color" name="color" formControlName="color"> + <mat-option value="">---</mat-option> + <mat-option *ngFor="let color of colors" [value]="color.id">{{ color.value }}</mat-option> + </mat-select> + </mat-form-field> + + <div role="alert" *ngIf="formErrors.length"> + <p *ngFor="let error of formErrors">{{ error }}</p> + </div> + </form> + `, + styles: [ + ` + form { + display: flex; + flex-direction: column; + } + + form > * { + width: 100%; + } + + [role='alert'] { + color: red; + } + `, + ], +}) +export class MaterialFormsComponent { + colors = [ + { id: 'R', value: 'Red' }, + { id: 'B', value: 'Blue' }, + { id: 'G', value: 'Green' }, + ]; + form = this.formBuilder.group({ + name: ['', Validators.required], + score: [0, [Validators.min(1), Validators.max(10)]], + color: ['', Validators.required], + }); + + constructor(private formBuilder: FormBuilder) {} + + get formErrors() { + return Object.keys(this.form.controls) + .map((formKey) => { + const controlErrors: ValidationErrors = this.form.get(formKey).errors; + if (controlErrors != null) { + return Object.keys(controlErrors).map((keyError) => { + const error = controlErrors[keyError]; + switch (keyError) { + case 'required': + return `${formKey} is required`; + case 'min': + return `${formKey} must be greater than ${error.min}`; + case 'max': + return `${formKey} must be lesser than ${error.max}`; + } + }); + } + }) + .reduce((errors, value) => errors.concat(value), []) + .filter(Boolean); + } +} + |
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 | 1x + + + + +1x +1x + + +2x + + + +1x + + + +14x + + + + + + + + + + + + +1x +3x + + | import { Component, Injectable } from '@angular/core'; + +@Injectable({ + providedIn: 'root', +}) +export class CounterService { + private _value = 0; + + increment() { + this._value += 1; + } + + decrement() { + this._value -= 1; + } + + value() { + return this._value; + } +} + +@Component({ + selector: 'app-fixture', + template: ` + <button (click)="counter.decrement()">Decrement</button> + <span data-testid="value">{{ counter.value() }}</span> + <button (click)="counter.increment()">Increment</button> + `, + providers: [CounterService], +}) +export class ComponentWithProviderComponent { + constructor(public counter: CounterService) {} +} + |
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 | 1x +1x + +1x +1x +1x + +2x +1x + + +1x +4x + + +1x +4x +4x + + + + + + + + + + +1x +1x +1x + + +2x + + + +1x + + + | import { Component } from '@angular/core'; +import { createSelector, Store, createAction, createReducer, on, select } from '@ngrx/store'; + +const increment = createAction('increment'); +const decrement = createAction('decrement'); +const counterReducer = createReducer( + 0, + on(increment, (state) => state + 1), + on(decrement, (state) => state - 1), +); + +export function reducer(state, action) { + return counterReducer(state, action); +} + +const selectValue = createSelector( + (state: any) => state.value, + (value) => value * 10, +); + +@Component({ + selector: 'app-fixture', + template: ` + <button (click)="decrement()">Decrement</button> + <span data-testid="value">{{ value | async }}</span> + <button (click)="increment()">Increment</button> + `, +}) +export class WithNgRxStoreComponent { + value = this.store.pipe(select(selectValue)); + constructor(private store: Store<any>) {} + + increment() { + this.store.dispatch(increment()); + } + + decrement() { + this.store.dispatch(decrement()); + } +} + |
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 | 1x +1x + +1x + + + + + + + + + + + + +1x +1x +1x + + +1x + + + | import { Component } from '@angular/core'; +import { createSelector, Store, select } from '@ngrx/store'; + +export const selectItems = createSelector( + (state: any) => state.items, + (items) => items, +); + +@Component({ + selector: 'app-fixture', + template: ` + <ul> + <li *ngFor="let item of items | async" (click)="send(item)" [attr.aria-label]="item">{{ item }}</li> + </ul> + `, +}) +export class WithNgRxMockStoreComponent { + items = this.store.pipe(select(selectItems)); + constructor(private store: Store<any>) {} + + send(item: string) { + this.store.dispatch({ type: '[Item List] send', item }); + } +} + |
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 | 1x + + + + +1x +3x +3x + +3x + + +3x + + + +1x +3x + + + +1x +3x + + + | import { Directive, HostListener, ElementRef, Input, OnInit } from '@angular/core'; + +@Directive({ + selector: '[appSpoiler]', +}) +export class SpoilerDirective implements OnInit { + @Input() hidden = 'SPOILER'; + @Input() visible = 'I am visible now...'; + + constructor(private el: ElementRef) {} + + ngOnInit() { + this.el.nativeElement.textContent = this.hidden; + } + + @HostListener('mouseover') + onMouseOver() { + this.el.nativeElement.textContent = this.visible; + } + + @HostListener('mouseleave') + onMouseLeave() { + this.el.nativeElement.textContent = this.hidden; + } +} + |
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 | 1x +1x +1x + + + + + + + + + + + + +1x + + + + + + + + + + + + +1x +6x +4x +4x +4x + + + + + + +1x + | import { OnInit, Component } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { map } from 'rxjs/operators'; + +@Component({ + selector: 'app-master', + template: ` + <a [routerLink]="'./detail/one'">Load one</a> | <a [routerLink]="'./detail/two'">Load two</a> | + <a [routerLink]="'./detail/three'">Load three</a> | + + <hr /> + + <router-outlet></router-outlet> + `, +}) +export class MasterComponent {} + +@Component({ + selector: 'app-detail', + template: ` + <h2>Detail {{ id | async }}</h2> + + <p>{{ text | async }} {{ subtext | async }}</p> + + <a [routerLink]="'../..'">Back to parent</a> + <a routerLink="/hidden-detail">hidden x</a> + `, +}) +export class DetailComponent { + id = this.route.paramMap.pipe(map((params) => params.get('id'))); + text = this.route.queryParams.pipe(map((params) => params['text'])); + subtext = this.route.queryParams.pipe(map((params) => params['subtext'])); + constructor(private route: ActivatedRoute) {} +} + +@Component({ + selector: 'app-detail-hidden', + template: ` You found the treasure! `, +}) +export class HiddenDetailComponent {} + |
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 | 1x + +1x + + + + + +1x +1x + + | import { Component, InjectionToken, Inject } from '@angular/core'; + +export const DATA = new InjectionToken<{ text: string }>('Components Data'); + +@Component({ + selector: 'app-fixture', + template: ` {{ data.text }} `, +}) +export class DataInjectedComponent { + constructor(@Inject(DATA) public data: { text: string }) {} +} + |
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 | 1x + + + + + + + + + +1x + | import { Component, ChangeDetectionStrategy } from '@angular/core'; + +@Component({ + template: ` + <p> + <ng-content></ng-content> + </p> + `, + changeDetection: ChangeDetectionStrategy.OnPush, +}) +export class CellComponent {} + |
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 | 1x +1x + +1x + + + + + + + +1x + + + + + + + + + + + + + + + +1x +2x +2x + + | import { Component, Injectable } from '@angular/core'; +import { Observable, of } from 'rxjs'; + +export class Customer { + id: string; + name: string; +} + +@Injectable({ + providedIn: 'root', +}) +export class CustomersService { + load(): Observable<Customer[]> { + return of([]); + } +} + +@Component({ + selector: 'app-fixture', + template: ` + <ul> + <li *ngFor="let customer of customers$ | async"> + {{ customer.name }} + </li> + </ul> + `, +}) +export class CustomersComponent { + customers$ = this.service.load(); + constructor(private service: CustomersService) {} +} + |
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+File | ++ | Statements | ++ | Branches | ++ | Functions | ++ | Lines | ++ |
---|---|---|---|---|---|---|---|---|---|
00-single-component.ts | +
+
+ |
+ 100% | +5/5 | +100% | +0/0 | +100% | +1/1 | +100% | +3/3 | +
01-nested-component.ts | +
+
+ |
+ 100% | +15/15 | +100% | +0/0 | +100% | +2/2 | +100% | +8/8 | +
02-input-output.ts | +
+
+ |
+ 100% | +8/8 | +100% | +0/0 | +100% | +1/1 | +100% | +4/4 | +
03-forms.ts | +
+
+ |
+ 100% | +18/18 | +100% | +5/5 | +100% | +5/5 | +100% | +16/16 | +
04-forms-with-material.ts | +
+
+ |
+ 100% | +18/18 | +100% | +5/5 | +100% | +5/5 | +100% | +16/16 | +
05-component-provider.ts | +
+
+ |
+ 100% | +12/12 | +100% | +0/0 | +100% | +5/5 | +100% | +8/8 | +
06-with-ngrx-store.ts | +
+
+ |
+ 100% | +19/19 | +100% | +0/0 | +100% | +8/8 | +100% | +17/17 | +
07-with-ngrx-mock-store.ts | +
+
+ |
+ 81.82% | +9/11 | +100% | +0/0 | +50% | +2/4 | +77.78% | +7/9 | +
08-directive.ts | +
+
+ |
+ 100% | +14/14 | +100% | +0/0 | +100% | +4/4 | +100% | +10/10 | +
09-router.ts | +
+
+ |
+ 100% | +19/19 | +100% | +0/0 | +100% | +4/4 | +100% | +10/10 | +
10-inject-token-dependency.ts | +
+
+ |
+ 100% | +6/6 | +100% | +0/0 | +100% | +1/1 | +100% | +4/4 | +
11-ng-content.ts | +
+
+ |
+ 100% | +4/4 | +100% | +0/0 | +100% | +0/0 | +100% | +2/2 | +
12-service-component.ts | +
+
+ |
+ 91.67% | +11/12 | +100% | +0/0 | +50% | +1/2 | +87.5% | +7/8 | +
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+File | ++ | Statements | ++ | Branches | ++ | Functions | ++ | Lines | ++ |
---|---|---|---|---|---|---|---|---|---|
material.module.ts | +
+
+ |
+ 100% | +6/6 | +100% | +0/0 | +100% | +0/0 | +100% | +4/4 | +
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+1 +2 +3 +4 +5 +6 +7 +8 +9 +10 | 1x + +1x +1x + + + + +1x + | import { NgModule } from '@angular/core'; + +import { MatInputModule } from '@angular/material/input'; +import { MatSelectModule } from '@angular/material/select'; + +@NgModule({ + exports: [MatInputModule, MatSelectModule], +}) +export class MaterialModule {} + |
+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +
+File | ++ | Statements | ++ | Branches | ++ | Functions | ++ | Lines | ++ |
---|---|---|---|---|---|---|---|---|---|
app | +
+
+ |
+ 100% | +6/6 | +100% | +0/0 | +100% | +0/0 | +100% | +4/4 | +
app/examples | +
+
+ |
+ 98.14% | +158/161 | +100% | +10/10 | +92.86% | +39/42 | +97.39% | +112/115 | +