Skip to content

Commit

Permalink
feat(test): rename project to feat upcoming challenges
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas committed Apr 8, 2023
1 parent 3b45e10 commit 95e0f6b
Show file tree
Hide file tree
Showing 31 changed files with 36 additions and 37 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ This goal of this project is to help you get better at Angular and NgRx by resol
</br>
<img src="https://img.shields.io/badge/Testing--gray" alt="testing"/>

<a href="./apps/router-testing/README.md"><img src="https://img.shields.io/badge/17-Router Testing-orange" alt="router Testing"/></a>
<a href="./apps/testing-router-outlet/README.md"><img src="https://img.shields.io/badge/17-Router Testing-orange" alt="router outlet Testing"/></a>

## Contributors ✨

Expand Down
13 changes: 0 additions & 13 deletions apps/router-testing/cypress/support/component-index.html

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ We have a functional application that lists available books for borrowing inside

The goal is to test this behavior with Testing library and Cypress

The file named `app.component.spec.ts` will let test your application using Testing Library. To run the test suits, you need to run `npx nx test router-testing`. 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 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.

For testing cypress, you will execute your test inside the `app.component.cy.ts` and run `npx nx component-test router-testing` 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 testing-router-outlet` to execute your test suits. You can add the `--watch` flag to execute your test in watch mode.

I created some `it` blocks but feel free to add more test if you like to.

Expand All @@ -27,9 +27,9 @@ I created some `it` blocks but feel free to add more test if you like to.
1. Fork the project
2. clone it
3. npm install
4. `npx nx serve router-testing` to play with the application
5. `npx nx test router-testing` to test your application with Testing Library
6. `npx nx component-test router-testing --watch` to test your application with Cypress
4. `npx nx serve testing-router-outlet` to play with the application
5. `npx nx test testing-router-outlet` to test your application with Testing Library
6. `npx nx component-test testing-router-outlet --watch` to test your application with Cypress
7. _...work on it_
8. Commit your work
9. Submit a PR with a title beginning with **Answer:17** that I will review and other dev can review.
Expand Down
File renamed without changes.
12 changes: 12 additions & 0 deletions apps/testing-router-outlet/cypress/support/component-index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<title>router-testing Components App</title>
</head>
<body>
<div data-cy-root></div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable */
export default {
displayName: 'router-testing',
displayName: 'testing-router-outlet',
preset: '../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
globals: {},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"name": "router-testing",
"name": "testing-router-outlet",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"sourceRoot": "apps/router-testing/src",
"sourceRoot": "apps/testing-router-outlet/src",
"prefix": "app",
"targets": {
"build": {
"executor": "@angular-devkit/build-angular:browser",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/apps/router-testing",
"index": "apps/router-testing/src/index.html",
"main": "apps/router-testing/src/main.ts",
"outputPath": "dist/apps/testing-router-outlet",
"index": "apps/testing-router-outlet/src/index.html",
"main": "apps/testing-router-outlet/src/main.ts",
"polyfills": ["zone.js"],
"tsConfig": "apps/router-testing/tsconfig.app.json",
"tsConfig": "apps/testing-router-outlet/tsconfig.app.json",
"inlineStyleLanguage": "scss",
"assets": [
"apps/router-testing/src/favicon.ico",
"apps/router-testing/src/assets"
"apps/testing-router-outlet/src/favicon.ico",
"apps/testing-router-outlet/src/assets"
],
"styles": ["apps/router-testing/src/styles.scss"],
"styles": ["apps/testing-router-outlet/src/styles.scss"],
"scripts": []
},
"configurations": {
Expand Down Expand Up @@ -53,45 +53,45 @@
"executor": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "router-testing:build:production"
"browserTarget": "testing-router-outlet:build:production"
},
"development": {
"browserTarget": "router-testing:build:development"
"browserTarget": "testing-router-outlet:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"executor": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "router-testing:build"
"browserTarget": "testing-router-outlet:build"
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": [
"apps/router-testing/**/*.ts",
"apps/router-testing/**/*.html"
"apps/testing-router-outlet/**/*.ts",
"apps/testing-router-outlet/**/*.html"
]
}
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "apps/router-testing/jest.config.ts",
"jestConfig": "apps/testing-router-outlet/jest.config.ts",
"passWithNoTests": true
}
},
"component-test": {
"executor": "@nrwl/cypress:cypress",
"options": {
"cypressConfig": "apps/router-testing/cypress.config.ts",
"cypressConfig": "apps/testing-router-outlet/cypress.config.ts",
"testingType": "component",
"skipServe": true,
"devServerTarget": "router-testing:build"
"devServerTarget": "testing-router-outlet:build"
}
}
},
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 95e0f6b

Please sign in to comment.