feat(doc): move todo-list

This commit is contained in:
thomas
2023-10-17 23:14:16 +02:00
parent 05951bd4df
commit ad3824aa79
36 changed files with 41 additions and 42 deletions

View File

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

View File

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

View File

@@ -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>testing-todos-list Components App</title>
</head>
<body>
<div data-cy-root></div>
</body>
</html>

View File

@@ -1,7 +1,7 @@
/* eslint-disable */
export default {
displayName: 'testing-todos-list',
preset: '../../jest.preset.js',
displayName: 'test-todos-list',
preset: '../../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
transform: {
'^.+\\.(ts|mjs|js|html)$': [

View File

@@ -1,26 +1,26 @@
{
"name": "testing-todos-list",
"$schema": "../node_modules/nx/schemas/project-schema.json",
"name": "test-todos-list",
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"sourceRoot": "apps/testing-todos-list/src",
"sourceRoot": "apps/test/todos-list/src",
"prefix": "app",
"targets": {
"build": {
"executor": "@angular-devkit/build-angular:browser",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/apps/testing-todos-list",
"index": "apps/testing-todos-list/src/index.html",
"main": "apps/testing-todos-list/src/main.ts",
"outputPath": "dist/apps/test/todos-list",
"index": "apps/test/todos-list/src/index.html",
"main": "apps/test/todos-list/src/main.ts",
"polyfills": ["zone.js"],
"tsConfig": "apps/testing-todos-list/tsconfig.app.json",
"tsConfig": "apps/test/todos-list/tsconfig.app.json",
"inlineStyleLanguage": "scss",
"assets": [
"apps/testing-todos-list/src/favicon.ico",
"apps/testing-todos-list/src/assets"
"apps/test/todos-list/src/favicon.ico",
"apps/test/todos-list/src/assets"
],
"styles": [
"apps/testing-todos-list/src/styles.scss",
"apps/test/todos-list/src/styles.scss",
"./node_modules/@angular/material/prebuilt-themes/indigo-pink.css"
],
"scripts": []
@@ -56,10 +56,10 @@
"executor": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "testing-todos-list:build:production"
"browserTarget": "test-todos-list:build:production"
},
"development": {
"browserTarget": "testing-todos-list:build:development"
"browserTarget": "test-todos-list:build:development"
}
},
"defaultConfiguration": "development"
@@ -67,7 +67,7 @@
"extract-i18n": {
"executor": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "testing-todos-list:build"
"browserTarget": "test-todos-list:build"
}
},
"lint": {
@@ -75,8 +75,8 @@
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": [
"apps/testing-todos-list/**/*.ts",
"apps/testing-todos-list/**/*.html"
"apps/test/todos-list/**/*.ts",
"apps/test/todos-list/**/*.html"
]
}
},
@@ -84,7 +84,7 @@
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "apps/testing-todos-list/jest.config.ts",
"jestConfig": "apps/test/todos-list/jest.config.ts",
"passWithNoTests": true
},
"configurations": {
@@ -97,10 +97,10 @@
"component-test": {
"executor": "@nx/cypress:cypress",
"options": {
"cypressConfig": "apps/testing-todos-list/cypress.config.ts",
"cypressConfig": "apps/test/todos-list/cypress.config.ts",
"testingType": "component",
"skipServe": true,
"devServerTarget": "testing-todos-list:build"
"devServerTarget": "test-todos-list:build"
}
}
},

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

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

View File

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

View File

@@ -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"]
},

View File

@@ -1,13 +0,0 @@
<!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>testing-todos-list Components App</title>
</head>
<body>
<div data-cy-root></div>
</body>
</html>

View File

@@ -3,7 +3,7 @@ title: 🔴 Real-life Application
description: Challenge 29 is about testing a real-life application
author: Thomas Laforge
challengeNumber: 29
command: testing-todos-list
command: test-todos-list
sidebar:
order: 205
---
@@ -18,11 +18,11 @@ In this challenge, you will write tests for the `ListComponent`, which represent
Handling asynchronous tasks will be particularly challenging. It's important not to introduce any explicit <b>waits</b> in your tests, as this would introduce unnecessary delays. Instead, it's better to look for an element that needs to appear or disappear from the DOM. In this case, the test will naturally wait for the correct period of time, as the waits are already implemented within both libraries. Take advantage of these built-in functionalities to create efficient and reliable tests.
You can play with it by running : `npx nx serve testing-todos-list`.
You can play with it by running : `npx nx serve test-todos-list`.
To run Testing Library test suits, you need to run `npx nx test testing-input-output`. 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.
To run Testing Library test suits, you need to run `npx nx test test-input-output`. 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 `child.component.cy.ts` and run `npx nx component-test testing-input-output` 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 `child.component.cy.ts` and run `npx nx component-test test-input-output` to execute your test suits. You can add the `--watch` flag to execute your test in watch mode.
# Statement