fix(test): move all test apps

This commit is contained in:
thomas
2023-10-18 10:35:53 +02:00
parent 058c7b04a0
commit 9a151be595
254 changed files with 273 additions and 273 deletions

View File

@@ -1,21 +0,0 @@
/* eslint-disable */
export default {
displayName: 'test-table',
preset: '../../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
transform: {
'^.+\\.(ts|mjs|js|html)$': [
'jest-preset-angular',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.(html|svg)$',
},
],
},
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
snapshotSerializers: [
'jest-preset-angular/build/serializers/no-ng-attributes',
'jest-preset-angular/build/serializers/ng-snapshot',
'jest-preset-angular/build/serializers/html-comment',
],
};

View File

@@ -1,21 +0,0 @@
/* eslint-disable */
export default {
displayName: 'test-todos-list',
preset: '../../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
transform: {
'^.+\\.(ts|mjs|js|html)$': [
'jest-preset-angular',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.(html|svg)$',
},
],
},
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
snapshotSerializers: [
'jest-preset-angular/build/serializers/no-ng-attributes',
'jest-preset-angular/build/serializers/ng-snapshot',
'jest-preset-angular/build/serializers/html-comment',
],
};

View File

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

View File

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

View File

@@ -1,25 +1,25 @@
{
"name": "test-harness",
"name": "testing-checkbox",
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"prefix": "app",
"sourceRoot": "apps/test/harness/src",
"sourceRoot": "apps/testing/checkbox/src",
"tags": [],
"targets": {
"build": {
"executor": "@angular-devkit/build-angular:browser",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/apps/test/harness",
"index": "apps/test/harness/src/index.html",
"main": "apps/test/harness/src/main.ts",
"outputPath": "dist/apps/testing/checkbox",
"index": "apps/testing/checkbox/src/index.html",
"main": "apps/testing/checkbox/src/main.ts",
"polyfills": ["zone.js"],
"tsConfig": "apps/test/harness/tsconfig.app.json",
"tsConfig": "apps/testing/checkbox/tsconfig.app.json",
"assets": [
"apps/test/harness/src/favicon.ico",
"apps/test/harness/src/assets"
"apps/testing/checkbox/src/favicon.ico",
"apps/testing/checkbox/src/assets"
],
"styles": ["apps/test/harness/src/styles.scss"],
"styles": ["apps/testing/checkbox/src/styles.scss"],
"scripts": []
},
"configurations": {
@@ -53,10 +53,10 @@
"executor": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "test-harness:build:production"
"browserTarget": "testing-checkbox:build:production"
},
"development": {
"browserTarget": "test-harness:build:development"
"browserTarget": "testing-checkbox:build:development"
}
},
"defaultConfiguration": "development"
@@ -64,14 +64,24 @@
"extract-i18n": {
"executor": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "test-harness:build"
"browserTarget": "testing-checkbox:build"
}
},
"lint": {
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": [
"apps/testing/checkbox/**/*.ts",
"apps/testing/checkbox/**/*.html"
]
}
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "apps/test/harness/jest.config.ts",
"jestConfig": "apps/testing/checkbox/jest.config.ts",
"passWithNoTests": true
},
"configurations": {
@@ -80,16 +90,6 @@
"codeCoverage": true
}
}
},
"lint": {
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": [
"apps/test/harness/**/*.ts",
"apps/test/harness/**/*.html"
]
}
}
}
}

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

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

View File

@@ -0,0 +1,21 @@
/* eslint-disable */
export default {
displayName: 'testing-create-harness',
preset: '../../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
transform: {
'^.+\\.(ts|mjs|js|html)$': [
'jest-preset-angular',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.(html|svg)$',
},
],
},
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
snapshotSerializers: [
'jest-preset-angular/build/serializers/no-ng-attributes',
'jest-preset-angular/build/serializers/ng-snapshot',
'jest-preset-angular/build/serializers/html-comment',
],
};

View File

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

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -8,13 +8,13 @@ NOT IMPLEMENTED YET
<!-- We have a small application that send a title to a fake backend that you type inside a input.
If the title is correctly typed, you can send the request otherwise you get a nice error and the request is not sent.
You can play with it by running : `npx nx serve test-forms`.
You can play with it by running : `npx nx serve testing-forms`.
The goal is to test this behavior with Testing library and Cypress
The file named `child.component.spec.ts` will let test your application using Testing Library. To run the test suits, you need to run `npx nx test test-forms`. 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 `child.component.spec.ts` will let test your application using Testing Library. To run the test suits, you need to run `npx nx test testing-forms`. 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 test-forms` 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 testing-forms` 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. -->
@@ -23,9 +23,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 ci
4. `npx nx serve test-forms` to play with the application
5. `npx nx test test-forms` to test your application with Testing Library
6. `npx nx component-test test-forms --watch` to test your application with Cypress
4. `npx nx serve testing-forms` to play with the application
5. `npx nx test testing-forms` to test your application with Testing Library
6. `npx nx component-test testing-forms --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:20** that I will review and other dev can review.

View File

@@ -1,6 +1,6 @@
/* eslint-disable */
export default {
displayName: 'test-modal',
displayName: 'testing-forms',
preset: '../../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
transform: {

View File

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

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

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

View File

@@ -0,0 +1,21 @@
/* eslint-disable */
export default {
displayName: 'testing-harness',
preset: '../../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
transform: {
'^.+\\.(ts|mjs|js|html)$': [
'jest-preset-angular',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.(html|svg)$',
},
],
},
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
snapshotSerializers: [
'jest-preset-angular/build/serializers/no-ng-attributes',
'jest-preset-angular/build/serializers/ng-snapshot',
'jest-preset-angular/build/serializers/html-comment',
],
};

View File

@@ -1,25 +1,25 @@
{
"name": "test-checkbox",
"name": "testing-harness",
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"prefix": "app",
"sourceRoot": "apps/test/checkbox/src",
"sourceRoot": "apps/testing/harness/src",
"tags": [],
"targets": {
"build": {
"executor": "@angular-devkit/build-angular:browser",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/apps/test/checkbox",
"index": "apps/test/checkbox/src/index.html",
"main": "apps/test/checkbox/src/main.ts",
"outputPath": "dist/apps/testing/harness",
"index": "apps/testing/harness/src/index.html",
"main": "apps/testing/harness/src/main.ts",
"polyfills": ["zone.js"],
"tsConfig": "apps/test/checkbox/tsconfig.app.json",
"tsConfig": "apps/testing/harness/tsconfig.app.json",
"assets": [
"apps/test/checkbox/src/favicon.ico",
"apps/test/checkbox/src/assets"
"apps/testing/harness/src/favicon.ico",
"apps/testing/harness/src/assets"
],
"styles": ["apps/test/checkbox/src/styles.scss"],
"styles": ["apps/testing/harness/src/styles.scss"],
"scripts": []
},
"configurations": {
@@ -53,10 +53,10 @@
"executor": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "test-checkbox:build:production"
"browserTarget": "testing-harness:build:production"
},
"development": {
"browserTarget": "test-checkbox:build:development"
"browserTarget": "testing-harness:build:development"
}
},
"defaultConfiguration": "development"
@@ -64,24 +64,14 @@
"extract-i18n": {
"executor": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "test-checkbox:build"
}
},
"lint": {
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": [
"apps/test/checkbox/**/*.ts",
"apps/test/checkbox/**/*.html"
]
"browserTarget": "testing-harness:build"
}
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "apps/test/checkbox/jest.config.ts",
"jestConfig": "apps/testing/harness/jest.config.ts",
"passWithNoTests": true
},
"configurations": {
@@ -90,6 +80,16 @@
"codeCoverage": true
}
}
},
"lint": {
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": [
"apps/testing/harness/**/*.ts",
"apps/testing/harness/**/*.html"
]
}
}
}
}

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

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

View File

@@ -1,6 +1,6 @@
/* eslint-disable */
export default {
displayName: 'test-create-harness',
displayName: 'testing-input-output',
preset: '../../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
transform: {

View File

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

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Some files were not shown because too many files have changed in this diff Show More