feat(doc): move router

This commit is contained in:
thomas
2023-10-17 23:13:21 +02:00
parent a855cb0a8a
commit 16809d66b5
31 changed files with 28 additions and 28 deletions

View File

@@ -1,5 +1,5 @@
{ {
"extends": ["../../.eslintrc.json"], "extends": ["../../../.eslintrc.json"],
"ignorePatterns": ["!**/*"], "ignorePatterns": ["!**/*"],
"overrides": [ "overrides": [
{ {

View File

@@ -5,7 +5,7 @@
### Run Application ### Run Application
```bash ```bash
npx nx serve testing-router-outlet npx nx serve test-router-outlet
``` ```
### Documentation and Instruction ### Documentation and Instruction

View File

@@ -1,7 +1,7 @@
/* eslint-disable */ /* eslint-disable */
export default { export default {
displayName: 'testing-router-outlet', displayName: 'test-router-outlet',
preset: '../../jest.preset.js', preset: '../../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'], setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
globals: {}, globals: {},
transform: { transform: {

View File

@@ -1,25 +1,25 @@
{ {
"name": "testing-router-outlet", "name": "test-router-outlet",
"$schema": "../../node_modules/nx/schemas/project-schema.json", "$schema": "../../../node_modules/nx/schemas/project-schema.json",
"projectType": "application", "projectType": "application",
"sourceRoot": "apps/testing-router-outlet/src", "sourceRoot": "apps/test/router-outlet/src",
"prefix": "app", "prefix": "app",
"targets": { "targets": {
"build": { "build": {
"executor": "@angular-devkit/build-angular:browser", "executor": "@angular-devkit/build-angular:browser",
"outputs": ["{options.outputPath}"], "outputs": ["{options.outputPath}"],
"options": { "options": {
"outputPath": "dist/apps/testing-router-outlet", "outputPath": "dist/apps/test/router-outlet",
"index": "apps/testing-router-outlet/src/index.html", "index": "apps/test/router-outlet/src/index.html",
"main": "apps/testing-router-outlet/src/main.ts", "main": "apps/test/router-outlet/src/main.ts",
"polyfills": ["zone.js"], "polyfills": ["zone.js"],
"tsConfig": "apps/testing-router-outlet/tsconfig.app.json", "tsConfig": "apps/test/router-outlet/tsconfig.app.json",
"inlineStyleLanguage": "scss", "inlineStyleLanguage": "scss",
"assets": [ "assets": [
"apps/testing-router-outlet/src/favicon.ico", "apps/test/router-outlet/src/favicon.ico",
"apps/testing-router-outlet/src/assets" "apps/test/router-outlet/src/assets"
], ],
"styles": ["apps/testing-router-outlet/src/styles.scss"], "styles": ["apps/test/router-outlet/src/styles.scss"],
"scripts": [] "scripts": []
}, },
"configurations": { "configurations": {
@@ -53,10 +53,10 @@
"executor": "@angular-devkit/build-angular:dev-server", "executor": "@angular-devkit/build-angular:dev-server",
"configurations": { "configurations": {
"production": { "production": {
"browserTarget": "testing-router-outlet:build:production" "browserTarget": "test-router-outlet:build:production"
}, },
"development": { "development": {
"browserTarget": "testing-router-outlet:build:development" "browserTarget": "test-router-outlet:build:development"
} }
}, },
"defaultConfiguration": "development" "defaultConfiguration": "development"
@@ -64,7 +64,7 @@
"extract-i18n": { "extract-i18n": {
"executor": "@angular-devkit/build-angular:extract-i18n", "executor": "@angular-devkit/build-angular:extract-i18n",
"options": { "options": {
"browserTarget": "testing-router-outlet:build" "browserTarget": "test-router-outlet:build"
} }
}, },
"lint": { "lint": {
@@ -72,8 +72,8 @@
"outputs": ["{options.outputFile}"], "outputs": ["{options.outputFile}"],
"options": { "options": {
"lintFilePatterns": [ "lintFilePatterns": [
"apps/testing-router-outlet/**/*.ts", "apps/test/router-outlet/**/*.ts",
"apps/testing-router-outlet/**/*.html" "apps/test/router-outlet/**/*.html"
] ]
} }
}, },
@@ -81,17 +81,17 @@
"executor": "@nx/jest:jest", "executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"], "outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": { "options": {
"jestConfig": "apps/testing-router-outlet/jest.config.ts", "jestConfig": "apps/test/router-outlet/jest.config.ts",
"passWithNoTests": true "passWithNoTests": true
} }
}, },
"component-test": { "component-test": {
"executor": "@nx/cypress:cypress", "executor": "@nx/cypress:cypress",
"options": { "options": {
"cypressConfig": "apps/testing-router-outlet/cypress.config.ts", "cypressConfig": "apps/test/router-outlet/cypress.config.ts",
"testingType": "component", "testingType": "component",
"skipServe": true, "skipServe": true,
"devServerTarget": "testing-router-outlet:build" "devServerTarget": "test-router-outlet:build"
} }
} }
}, },

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -1,7 +1,7 @@
{ {
"extends": "./tsconfig.json", "extends": "./tsconfig.json",
"compilerOptions": { "compilerOptions": {
"outDir": "../../dist/out-tsc", "outDir": "../../../dist/out-tsc",
"types": [] "types": []
}, },
"files": ["src/main.ts"], "files": ["src/main.ts"],

View File

@@ -25,7 +25,7 @@
"path": "./cypress/tsconfig.json" "path": "./cypress/tsconfig.json"
} }
], ],
"extends": "../../tsconfig.base.json", "extends": "../../../tsconfig.base.json",
"angularCompilerOptions": { "angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false, "enableI18nLegacyMessageIdFormat": false,
"strictInjectionParameters": true, "strictInjectionParameters": true,

View File

@@ -1,7 +1,7 @@
{ {
"extends": "./tsconfig.json", "extends": "./tsconfig.json",
"compilerOptions": { "compilerOptions": {
"outDir": "../../dist/out-tsc", "outDir": "../../../dist/out-tsc",
"module": "commonjs", "module": "commonjs",
"types": ["jest", "node", "@testing-library/jest-dom"] "types": ["jest", "node", "@testing-library/jest-dom"]
}, },

View File

@@ -3,7 +3,7 @@ title: 🟠 Router
description: Challenge 17 is about testing the router description: Challenge 17 is about testing the router
author: Thomas Laforge author: Thomas Laforge
challengeNumber: 17 challengeNumber: 17
command: testing-router-outlet command: test-router-outlet
sidebar: sidebar:
order: 108 order: 108
--- ---
@@ -12,9 +12,9 @@ sidebar:
We have a functional application that lists available books for borrowing inside a library. If the book you searched for is available, you will be directed to the corresponding book(s), otherwise, you will end up on an error page. We have a functional application that lists available books for borrowing inside a library. If the book you searched for is available, you will be directed to the corresponding book(s), otherwise, you will end up on an error page.
The file named `app.component.spec.ts` will let you test your application using Testing Library. To run the test suits, you need to run `npx nx test testing-router-outlet`. You can also install [Jest Runner](https://marketplace.visualstudio.com/items?itemName=firsttris.vscode-jest-runner) to execute your test by clicking on the `Run` button above each `describe` or `it` blocks. The file named `app.component.spec.ts` will let you test your application using Testing Library. To run the test suits, you need to run `npx nx test test-router-outlet`. You can also install [Jest Runner](https://marketplace.visualstudio.com/items?itemName=firsttris.vscode-jest-runner) to execute your test by clicking on the `Run` button above each `describe` or `it` blocks.
For testing cypress, you will execute your test inside the `app.component.cy.ts` and run `npx nx component-test testing-router-outlet` to execute your test suits. You can add the `--watch` flag to execute your test in watch mode. For testing cypress, you will execute your test inside the `app.component.cy.ts` and run `npx nx component-test test-router-outlet` to execute your test suits. You can add the `--watch` flag to execute your test in watch mode.
# Statement # Statement