Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1cd31db

Browse files
committed
chore: move e2e in ssr app
1 parent 3771fa8 commit 1cd31db

File tree

12 files changed

+76
-36
lines changed

12 files changed

+76
-36
lines changed

apps/ssr-e2e/project.json

Lines changed: 0 additions & 18 deletions
This file was deleted.

apps/ssr-e2e/tsconfig.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

apps/ssr/.eslintrc.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"extends": ["plugin:cypress/recommended", "../../.eslintrc.json"],
3+
"ignorePatterns": ["!**/*"],
4+
"overrides": [
5+
{
6+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7+
"rules": {}
8+
},
9+
{
10+
"files": ["*.ts", "*.tsx"],
11+
"rules": {}
12+
},
13+
{
14+
"files": ["*.js", "*.jsx"],
15+
"rules": {}
16+
},
17+
{
18+
"files": ["*.cy.{ts,js,tsx,jsx}", "cypress/**/*.{ts,js,tsx,jsx}"],
19+
"rules": {}
20+
}
21+
]
22+
}

apps/ssr-e2e/cypress.config.ts renamed to apps/ssr/cypress.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset';
22
import { defineConfig } from 'cypress';
33

44
export default defineConfig({
5-
e2e: nxE2EPreset(__dirname),
5+
e2e: nxE2EPreset(__filename, { cypressDir: 'cypress' }),
66
});
File renamed without changes.
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
/// <reference types="cypress" />
2+
13
// ***********************************************
2-
// This example commands.js shows you how to
4+
// This example commands.ts shows you how to
35
// create various custom commands and overwrite
46
// existing commands.
57
//
@@ -8,8 +10,8 @@
810
// https://on.cypress.io/custom-commands
911
// ***********************************************
1012

11-
// eslint-disable-next-line @typescript-eslint/no-namespace
13+
// eslint-disable-next-line @typescript-eslint/no-namespace, @typescript-eslint/no-unused-vars
1214
declare namespace Cypress {
13-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
15+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-interface
1416
interface Chainable<Subject> {}
1517
}

apps/ssr-e2e/src/support/e2e.ts renamed to apps/ssr/cypress/support/e2e.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// ***********************************************************
2-
// This example support/index.js is processed and
2+
// This example support/e2e.ts is processed and
33
// loaded automatically before your test files.
44
//
55
// This is a great place to put global configuration and
@@ -13,5 +13,5 @@
1313
// https://on.cypress.io/configuration
1414
// ***********************************************************
1515

16-
// Import commands.js using ES2015 syntax:
16+
// Import commands.ts using ES2015 syntax:
1717
import './commands';

apps/ssr/cypress/tsconfig.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"allowJs": true,
5+
"outDir": "../../dist/out-tsc",
6+
"module": "commonjs",
7+
"types": ["cypress", "node"],
8+
"sourceMap": false
9+
},
10+
"include": [
11+
"**/*.ts",
12+
"**/*.js",
13+
"../cypress.config.ts",
14+
"../**/*.cy.ts",
15+
"../**/*.cy.tsx",
16+
"../**/*.cy.js",
17+
"../**/*.cy.jsx",
18+
"../**/*.d.ts"
19+
]
20+
}

apps/ssr/project.json

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,27 @@
113113
"serverTarget": "ssr:server:production"
114114
}
115115
}
116+
},
117+
"e2e": {
118+
"executor": "@nx/cypress:cypress",
119+
"options": {
120+
"cypressConfig": "apps/ssr/cypress.config.ts",
121+
"testingType": "e2e",
122+
"devServerTarget": "ssr:serve-ssr"
123+
},
124+
"configurations": {
125+
"production": {
126+
"devServerTarget": "ssr:serve:production"
127+
}
128+
}
129+
},
130+
"lint": {
131+
"executor": "@nx/eslint:lint",
132+
"outputs": ["{options.outputFile}"],
133+
"options": {
134+
"lintFilePatterns": ["apps/ssr/**/*.{js,ts}"]
135+
}
116136
}
117137
},
118-
"tags": []
138+
"tags": ["type:app"]
119139
}

apps/ssr/tsconfig.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
},
1212
{
1313
"path": "./tsconfig.editor.json"
14+
},
15+
{
16+
"path": "./cypress/tsconfig.json"
1417
}
1518
],
1619
"compilerOptions": {

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112
"eslint-plugin-cypress": "2.15.1",
113113
"husky": "^8.0.3",
114114
"jest": "^29.4.1",
115+
"express": "4.18.2",
115116
"jest-environment-jsdom": "29.5.0",
116117
"jest-preset-angular": "12.2.3",
117118
"klaw-sync": "^6.0.0",

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10678,7 +10678,7 @@ expect@^29.5.0:
1067810678
jest-message-util "^29.5.0"
1067910679
jest-util "^29.5.0"
1068010680

10681-
express@^4.17.3, express@^4.18.2:
10681+
express@4.18.2, express@^4.17.3, express@^4.18.2:
1068210682
version "4.18.2"
1068310683
resolved "https://registry.yarnpkg.com/express/-/express-4.18.2.tgz#3fabe08296e930c796c19e3c516979386ba9fd59"
1068410684
integrity sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==

0 commit comments

Comments
 (0)