feat(doc): move input-output

This commit is contained in:
thomas
2023-10-17 23:12:11 +02:00
parent bbb00d60e6
commit be270efde1
26 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-input-output
npx nx serve test-input-output
```
### 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-input-output Components App</title>
</head>
<body>
<div data-cy-root></div>
</body>
</html>

View File

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

View File

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

View File

@@ -3,7 +3,7 @@ title: 🟠 Input Output
description: Challenge 19 is about testing inputs and ouputs
author: Thomas Laforge
challengeNumber: 19
command: testing-input-output
command: test-input-output
sidebar:
order: 110
---
@@ -12,11 +12,11 @@ sidebar:
We have a small counter application that increments or decrements a number. The `CounterComponent` takes an initial value as an `@Input` and emits the result of the counter as an `@Output` when we click on the **Send** button. Since we are testing our component as a black box, we only have access to our inputs and listen to the output values. <b>We should not rely on any internal implementation details!!!</b>
You can play with it by running : `npx nx serve testing-input-output`.
You can play with it by running : `npx nx serve test-input-output`.
The file named `counter.component.spec.ts` will let test your application using Testing Library. To run the 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.
The file named `counter.component.spec.ts` will let test your application using Testing Library. To run the 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