diff --git a/apps/testing-router-outlet/.eslintrc.json b/apps/test/router-outlet/.eslintrc.json similarity index 94% rename from apps/testing-router-outlet/.eslintrc.json rename to apps/test/router-outlet/.eslintrc.json index b428c22..bf8df14 100644 --- a/apps/testing-router-outlet/.eslintrc.json +++ b/apps/test/router-outlet/.eslintrc.json @@ -1,5 +1,5 @@ { - "extends": ["../../.eslintrc.json"], + "extends": ["../../../.eslintrc.json"], "ignorePatterns": ["!**/*"], "overrides": [ { diff --git a/apps/testing-router-outlet/README.md b/apps/test/router-outlet/README.md similarity index 85% rename from apps/testing-router-outlet/README.md rename to apps/test/router-outlet/README.md index 71208a4..7bf1d9d 100644 --- a/apps/testing-router-outlet/README.md +++ b/apps/test/router-outlet/README.md @@ -5,7 +5,7 @@ ### Run Application ```bash -npx nx serve testing-router-outlet +npx nx serve test-router-outlet ``` ### Documentation and Instruction diff --git a/apps/testing-router-outlet/cypress.config.ts b/apps/test/router-outlet/cypress.config.ts similarity index 100% rename from apps/testing-router-outlet/cypress.config.ts rename to apps/test/router-outlet/cypress.config.ts diff --git a/apps/testing-router-outlet/cypress/fixtures/example.json b/apps/test/router-outlet/cypress/fixtures/example.json similarity index 100% rename from apps/testing-router-outlet/cypress/fixtures/example.json rename to apps/test/router-outlet/cypress/fixtures/example.json diff --git a/apps/testing-router-outlet/cypress/support/commands.ts b/apps/test/router-outlet/cypress/support/commands.ts similarity index 100% rename from apps/testing-router-outlet/cypress/support/commands.ts rename to apps/test/router-outlet/cypress/support/commands.ts diff --git a/apps/testing-router-outlet/cypress/support/component-index.html b/apps/test/router-outlet/cypress/support/component-index.html similarity index 100% rename from apps/testing-router-outlet/cypress/support/component-index.html rename to apps/test/router-outlet/cypress/support/component-index.html diff --git a/apps/testing-router-outlet/cypress/support/component.ts b/apps/test/router-outlet/cypress/support/component.ts similarity index 100% rename from apps/testing-router-outlet/cypress/support/component.ts rename to apps/test/router-outlet/cypress/support/component.ts diff --git a/apps/testing-router-outlet/cypress/tsconfig.json b/apps/test/router-outlet/cypress/tsconfig.json similarity index 100% rename from apps/testing-router-outlet/cypress/tsconfig.json rename to apps/test/router-outlet/cypress/tsconfig.json diff --git a/apps/testing-router-outlet/jest.config.ts b/apps/test/router-outlet/jest.config.ts similarity index 88% rename from apps/testing-router-outlet/jest.config.ts rename to apps/test/router-outlet/jest.config.ts index f08ad64..fa70325 100644 --- a/apps/testing-router-outlet/jest.config.ts +++ b/apps/test/router-outlet/jest.config.ts @@ -1,7 +1,7 @@ /* eslint-disable */ export default { - displayName: 'testing-router-outlet', - preset: '../../jest.preset.js', + displayName: 'test-router-outlet', + preset: '../../../jest.preset.js', setupFilesAfterEnv: ['/src/test-setup.ts'], globals: {}, transform: { diff --git a/apps/testing-router-outlet/project.json b/apps/test/router-outlet/project.json similarity index 64% rename from apps/testing-router-outlet/project.json rename to apps/test/router-outlet/project.json index b498eea..a33bb42 100644 --- a/apps/testing-router-outlet/project.json +++ b/apps/test/router-outlet/project.json @@ -1,25 +1,25 @@ { - "name": "testing-router-outlet", - "$schema": "../../node_modules/nx/schemas/project-schema.json", + "name": "test-router-outlet", + "$schema": "../../../node_modules/nx/schemas/project-schema.json", "projectType": "application", - "sourceRoot": "apps/testing-router-outlet/src", + "sourceRoot": "apps/test/router-outlet/src", "prefix": "app", "targets": { "build": { "executor": "@angular-devkit/build-angular:browser", "outputs": ["{options.outputPath}"], "options": { - "outputPath": "dist/apps/testing-router-outlet", - "index": "apps/testing-router-outlet/src/index.html", - "main": "apps/testing-router-outlet/src/main.ts", + "outputPath": "dist/apps/test/router-outlet", + "index": "apps/test/router-outlet/src/index.html", + "main": "apps/test/router-outlet/src/main.ts", "polyfills": ["zone.js"], - "tsConfig": "apps/testing-router-outlet/tsconfig.app.json", + "tsConfig": "apps/test/router-outlet/tsconfig.app.json", "inlineStyleLanguage": "scss", "assets": [ - "apps/testing-router-outlet/src/favicon.ico", - "apps/testing-router-outlet/src/assets" + "apps/test/router-outlet/src/favicon.ico", + "apps/test/router-outlet/src/assets" ], - "styles": ["apps/testing-router-outlet/src/styles.scss"], + "styles": ["apps/test/router-outlet/src/styles.scss"], "scripts": [] }, "configurations": { @@ -53,10 +53,10 @@ "executor": "@angular-devkit/build-angular:dev-server", "configurations": { "production": { - "browserTarget": "testing-router-outlet:build:production" + "browserTarget": "test-router-outlet:build:production" }, "development": { - "browserTarget": "testing-router-outlet:build:development" + "browserTarget": "test-router-outlet:build:development" } }, "defaultConfiguration": "development" @@ -64,7 +64,7 @@ "extract-i18n": { "executor": "@angular-devkit/build-angular:extract-i18n", "options": { - "browserTarget": "testing-router-outlet:build" + "browserTarget": "test-router-outlet:build" } }, "lint": { @@ -72,8 +72,8 @@ "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": [ - "apps/testing-router-outlet/**/*.ts", - "apps/testing-router-outlet/**/*.html" + "apps/test/router-outlet/**/*.ts", + "apps/test/router-outlet/**/*.html" ] } }, @@ -81,17 +81,17 @@ "executor": "@nx/jest:jest", "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], "options": { - "jestConfig": "apps/testing-router-outlet/jest.config.ts", + "jestConfig": "apps/test/router-outlet/jest.config.ts", "passWithNoTests": true } }, "component-test": { "executor": "@nx/cypress:cypress", "options": { - "cypressConfig": "apps/testing-router-outlet/cypress.config.ts", + "cypressConfig": "apps/test/router-outlet/cypress.config.ts", "testingType": "component", "skipServe": true, - "devServerTarget": "testing-router-outlet:build" + "devServerTarget": "test-router-outlet:build" } } }, diff --git a/apps/testing-router-outlet/src/app/app.component.cy.ts b/apps/test/router-outlet/src/app/app.component.cy.ts similarity index 100% rename from apps/testing-router-outlet/src/app/app.component.cy.ts rename to apps/test/router-outlet/src/app/app.component.cy.ts diff --git a/apps/testing-router-outlet/src/app/app.component.spec.ts b/apps/test/router-outlet/src/app/app.component.spec.ts similarity index 100% rename from apps/testing-router-outlet/src/app/app.component.spec.ts rename to apps/test/router-outlet/src/app/app.component.spec.ts diff --git a/apps/testing-router-outlet/src/app/app.component.ts b/apps/test/router-outlet/src/app/app.component.ts similarity index 100% rename from apps/testing-router-outlet/src/app/app.component.ts rename to apps/test/router-outlet/src/app/app.component.ts diff --git a/apps/testing-router-outlet/src/app/app.config.ts b/apps/test/router-outlet/src/app/app.config.ts similarity index 100% rename from apps/testing-router-outlet/src/app/app.config.ts rename to apps/test/router-outlet/src/app/app.config.ts diff --git a/apps/testing-router-outlet/src/app/app.routes.ts b/apps/test/router-outlet/src/app/app.routes.ts similarity index 100% rename from apps/testing-router-outlet/src/app/app.routes.ts rename to apps/test/router-outlet/src/app/app.routes.ts diff --git a/apps/testing-router-outlet/src/app/book.guard.ts b/apps/test/router-outlet/src/app/book.guard.ts similarity index 100% rename from apps/testing-router-outlet/src/app/book.guard.ts rename to apps/test/router-outlet/src/app/book.guard.ts diff --git a/apps/testing-router-outlet/src/app/book.model.ts b/apps/test/router-outlet/src/app/book.model.ts similarity index 100% rename from apps/testing-router-outlet/src/app/book.model.ts rename to apps/test/router-outlet/src/app/book.model.ts diff --git a/apps/testing-router-outlet/src/app/no-book-search.component.ts b/apps/test/router-outlet/src/app/no-book-search.component.ts similarity index 100% rename from apps/testing-router-outlet/src/app/no-book-search.component.ts rename to apps/test/router-outlet/src/app/no-book-search.component.ts diff --git a/apps/testing-router-outlet/src/app/search.component.ts b/apps/test/router-outlet/src/app/search.component.ts similarity index 100% rename from apps/testing-router-outlet/src/app/search.component.ts rename to apps/test/router-outlet/src/app/search.component.ts diff --git a/apps/testing-router-outlet/src/app/shelf.component.ts b/apps/test/router-outlet/src/app/shelf.component.ts similarity index 100% rename from apps/testing-router-outlet/src/app/shelf.component.ts rename to apps/test/router-outlet/src/app/shelf.component.ts diff --git a/apps/testing-router-outlet/src/assets/.gitkeep b/apps/test/router-outlet/src/assets/.gitkeep similarity index 100% rename from apps/testing-router-outlet/src/assets/.gitkeep rename to apps/test/router-outlet/src/assets/.gitkeep diff --git a/apps/testing-router-outlet/src/favicon.ico b/apps/test/router-outlet/src/favicon.ico similarity index 100% rename from apps/testing-router-outlet/src/favicon.ico rename to apps/test/router-outlet/src/favicon.ico diff --git a/apps/testing-router-outlet/src/index.html b/apps/test/router-outlet/src/index.html similarity index 100% rename from apps/testing-router-outlet/src/index.html rename to apps/test/router-outlet/src/index.html diff --git a/apps/testing-router-outlet/src/main.ts b/apps/test/router-outlet/src/main.ts similarity index 100% rename from apps/testing-router-outlet/src/main.ts rename to apps/test/router-outlet/src/main.ts diff --git a/apps/testing-router-outlet/src/styles.scss b/apps/test/router-outlet/src/styles.scss similarity index 100% rename from apps/testing-router-outlet/src/styles.scss rename to apps/test/router-outlet/src/styles.scss diff --git a/apps/testing-router-outlet/src/test-setup.ts b/apps/test/router-outlet/src/test-setup.ts similarity index 100% rename from apps/testing-router-outlet/src/test-setup.ts rename to apps/test/router-outlet/src/test-setup.ts diff --git a/apps/testing-router-outlet/tsconfig.app.json b/apps/test/router-outlet/tsconfig.app.json similarity index 89% rename from apps/testing-router-outlet/tsconfig.app.json rename to apps/test/router-outlet/tsconfig.app.json index e46d4fc..01a02ed 100644 --- a/apps/testing-router-outlet/tsconfig.app.json +++ b/apps/test/router-outlet/tsconfig.app.json @@ -1,7 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", + "outDir": "../../../dist/out-tsc", "types": [] }, "files": ["src/main.ts"], diff --git a/apps/testing-router-outlet/tsconfig.editor.json b/apps/test/router-outlet/tsconfig.editor.json similarity index 100% rename from apps/testing-router-outlet/tsconfig.editor.json rename to apps/test/router-outlet/tsconfig.editor.json diff --git a/apps/testing-router-outlet/tsconfig.json b/apps/test/router-outlet/tsconfig.json similarity index 94% rename from apps/testing-router-outlet/tsconfig.json rename to apps/test/router-outlet/tsconfig.json index 28546c4..3879b94 100644 --- a/apps/testing-router-outlet/tsconfig.json +++ b/apps/test/router-outlet/tsconfig.json @@ -25,7 +25,7 @@ "path": "./cypress/tsconfig.json" } ], - "extends": "../../tsconfig.base.json", + "extends": "../../../tsconfig.base.json", "angularCompilerOptions": { "enableI18nLegacyMessageIdFormat": false, "strictInjectionParameters": true, diff --git a/apps/testing-router-outlet/tsconfig.spec.json b/apps/test/router-outlet/tsconfig.spec.json similarity index 88% rename from apps/testing-router-outlet/tsconfig.spec.json rename to apps/test/router-outlet/tsconfig.spec.json index 1a4817a..c0c092e 100644 --- a/apps/testing-router-outlet/tsconfig.spec.json +++ b/apps/test/router-outlet/tsconfig.spec.json @@ -1,7 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../dist/out-tsc", + "outDir": "../../../dist/out-tsc", "module": "commonjs", "types": ["jest", "node", "@testing-library/jest-dom"] }, diff --git a/docs/src/content/docs/challenges/testing/17-router.md b/docs/src/content/docs/challenges/testing/17-router.md index 12e0611..1a0aaeb 100644 --- a/docs/src/content/docs/challenges/testing/17-router.md +++ b/docs/src/content/docs/challenges/testing/17-router.md @@ -3,7 +3,7 @@ title: 🟠 Router description: Challenge 17 is about testing the router author: Thomas Laforge challengeNumber: 17 -command: testing-router-outlet +command: test-router-outlet sidebar: 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. -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