mirror of
https://github.com/Raghu-Ch/angular-challenges.git
synced 2026-02-10 12:53:03 -05:00
feat(doc): move table
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": ["../../.eslintrc.json"],
|
||||
"extends": ["../../../.eslintrc.json"],
|
||||
"ignorePatterns": ["!**/*"],
|
||||
"overrides": [
|
||||
{
|
||||
@@ -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 testing-table`.
|
||||
You can play with it by running : `npx nx serve test-table`.
|
||||
|
||||
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 testing-table`. 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 test-table`. 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-table` 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-table` 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 testing-table` to play with the application
|
||||
5. `npx nx test testing-table` to test your application with Testing Library
|
||||
6. `npx nx component-test testing-table --watch` to test your application with Cypress
|
||||
4. `npx nx serve test-table` to play with the application
|
||||
5. `npx nx test test-table` to test your application with Testing Library
|
||||
6. `npx nx component-test test-table --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:22** that I will review and other dev can review.
|
||||
12
apps/test/table/cypress/support/component-index.html
Normal file
12
apps/test/table/cypress/support/component-index.html
Normal 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-table Components App</title>
|
||||
</head>
|
||||
<body>
|
||||
<div data-cy-root></div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,7 +1,7 @@
|
||||
/* eslint-disable */
|
||||
export default {
|
||||
displayName: 'testing-table',
|
||||
preset: '../../jest.preset.js',
|
||||
displayName: 'test-table',
|
||||
preset: '../../../jest.preset.js',
|
||||
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
|
||||
transform: {
|
||||
'^.+\\.(ts|mjs|js|html)$': [
|
||||
@@ -1,25 +1,25 @@
|
||||
{
|
||||
"name": "testing-table",
|
||||
"$schema": "../node_modules/nx/schemas/project-schema.json",
|
||||
"name": "test-table",
|
||||
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
|
||||
"projectType": "application",
|
||||
"sourceRoot": "apps/testing-table/src",
|
||||
"sourceRoot": "apps/test/table/src",
|
||||
"prefix": "app",
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "@angular-devkit/build-angular:browser",
|
||||
"outputs": ["{options.outputPath}"],
|
||||
"options": {
|
||||
"outputPath": "dist/apps/testing-table",
|
||||
"index": "apps/testing-table/src/index.html",
|
||||
"main": "apps/testing-table/src/main.ts",
|
||||
"outputPath": "dist/apps/test/table",
|
||||
"index": "apps/test/table/src/index.html",
|
||||
"main": "apps/test/table/src/main.ts",
|
||||
"polyfills": ["zone.js"],
|
||||
"tsConfig": "apps/testing-table/tsconfig.app.json",
|
||||
"tsConfig": "apps/test/table/tsconfig.app.json",
|
||||
"inlineStyleLanguage": "scss",
|
||||
"assets": [
|
||||
"apps/testing-table/src/favicon.ico",
|
||||
"apps/testing-table/src/assets"
|
||||
"apps/test/table/src/favicon.ico",
|
||||
"apps/test/table/src/assets"
|
||||
],
|
||||
"styles": ["apps/testing-table/src/styles.scss"],
|
||||
"styles": ["apps/test/table/src/styles.scss"],
|
||||
"scripts": [],
|
||||
"allowedCommonJsDependencies": ["seedrandom"]
|
||||
},
|
||||
@@ -54,10 +54,10 @@
|
||||
"executor": "@angular-devkit/build-angular:dev-server",
|
||||
"configurations": {
|
||||
"production": {
|
||||
"browserTarget": "testing-table:build:production"
|
||||
"browserTarget": "test-table:build:production"
|
||||
},
|
||||
"development": {
|
||||
"browserTarget": "testing-table:build:development"
|
||||
"browserTarget": "test-table:build:development"
|
||||
}
|
||||
},
|
||||
"defaultConfiguration": "development"
|
||||
@@ -65,7 +65,7 @@
|
||||
"extract-i18n": {
|
||||
"executor": "@angular-devkit/build-angular:extract-i18n",
|
||||
"options": {
|
||||
"browserTarget": "testing-table:build"
|
||||
"browserTarget": "test-table:build"
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
@@ -73,8 +73,8 @@
|
||||
"outputs": ["{options.outputFile}"],
|
||||
"options": {
|
||||
"lintFilePatterns": [
|
||||
"apps/testing-table/**/*.ts",
|
||||
"apps/testing-table/**/*.html"
|
||||
"apps/test/table/**/*.ts",
|
||||
"apps/test/table/**/*.html"
|
||||
]
|
||||
}
|
||||
},
|
||||
@@ -82,7 +82,7 @@
|
||||
"executor": "@nx/jest:jest",
|
||||
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
||||
"options": {
|
||||
"jestConfig": "apps/testing-table/jest.config.ts",
|
||||
"jestConfig": "apps/test/table/jest.config.ts",
|
||||
"passWithNoTests": true
|
||||
},
|
||||
"configurations": {
|
||||
@@ -95,10 +95,10 @@
|
||||
"component-test": {
|
||||
"executor": "@nx/cypress:cypress",
|
||||
"options": {
|
||||
"cypressConfig": "apps/testing-table/cypress.config.ts",
|
||||
"cypressConfig": "apps/test/table/cypress.config.ts",
|
||||
"testingType": "component",
|
||||
"skipServe": true,
|
||||
"devServerTarget": "testing-table:build"
|
||||
"devServerTarget": "test-table:build"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"outDir": "../../../dist/out-tsc",
|
||||
"types": []
|
||||
},
|
||||
"files": ["src/main.ts"],
|
||||
@@ -25,7 +25,7 @@
|
||||
"path": "./cypress/tsconfig.json"
|
||||
}
|
||||
],
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"extends": "../../../tsconfig.base.json",
|
||||
"angularCompilerOptions": {
|
||||
"enableI18nLegacyMessageIdFormat": false,
|
||||
"strictInjectionParameters": true,
|
||||
@@ -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"],
|
||||
"target": "ES2016"
|
||||
@@ -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-table Components App</title>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div data-cy-root></div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user