Skip to content

Commit 4caf2e5

Browse files
committed
upgrage to cypress 10
1 parent c35f1c2 commit 4caf2e5

File tree

10 files changed

+119
-109
lines changed

10 files changed

+119
-109
lines changed

angular.json

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@
147147
"watch": false,
148148
"headless": true,
149149
"browser": "chrome",
150-
"configFile": "projects/test-app/cypress.json"
150+
"configFile": "projects/test-app/cypress.config.ts"
151151
},
152152
"configurations": {
153153
"production": {
@@ -168,8 +168,7 @@
168168
"builder": "@cypress/schematic:cypress",
169169
"options": {
170170
"devServerTarget": "test-app:serve",
171-
"browser": "chrome",
172-
"configFile": "projects/test-app/cypress.json"
171+
"configFile": "projects/test-app/cypress.config.ts"
173172
},
174173
"configurations": {
175174
"production": {
@@ -182,7 +181,7 @@
182181
"options": {
183182
"watch": true,
184183
"headless": false,
185-
"configFile": "projects/test-app/cypress.json"
184+
"configFile": "projects/test-app/cypress.config.ts"
186185
}
187186
}
188187
}
@@ -331,7 +330,7 @@
331330
"watch": false,
332331
"headless": true,
333332
"browser": "chrome",
334-
"configFile": "projects/test-app/cypress.json"
333+
"configFile": "projects/backend-test-app/cypress.config.ts"
335334
},
336335
"configurations": {
337336
"production": {
@@ -402,8 +401,7 @@
402401
"builder": "@cypress/schematic:cypress",
403402
"options": {
404403
"devServerTarget": "backend-test-app:serve",
405-
"browser": "chrome",
406-
"configFile": "projects/backend-test-app/cypress.json"
404+
"configFile": "projects/backend-test-app/cypress.config.ts"
407405
},
408406
"configurations": {
409407
"production": {
@@ -416,7 +414,7 @@
416414
"options": {
417415
"watch": true,
418416
"headless": false,
419-
"configFile": "projects/backend-test-app/cypress.json"
417+
"configFile": "projects/backend-test-app/cypress.config.ts"
420418
}
421419
}
422420
}

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"build": "ng build ngx-cookie --configuration production && ng build ngx-cookie-backend --configuration production",
99
"test": "ng test --watch=false",
1010
"lint": "ng lint",
11-
"e2e": "yarn e2e:test-app && yarn e2e:backend-test-app",
11+
"e2e": "ng e2e",
1212
"e2e:test-app": "ng run test-app:e2e",
1313
"e2e:backend-test-app": "ng run backend-test-app:e2e",
1414
"dev:ssr": "ng run backend-test-app:serve-ssr",
@@ -70,27 +70,27 @@
7070
"@angular/cli": "^14.0.3",
7171
"@angular/compiler-cli": "^14.0.3",
7272
"@angular/language-service": "^14.0.3",
73-
"@cypress/schematic": "1.6.0",
73+
"@cypress/schematic": "2.0.0",
7474
"@nguniversal/builders": "^14.0.2",
7575
"@types/express": "^4.17.8",
7676
"@types/jasmine": "~4.0.3",
7777
"@types/jasminewd2": "~2.0.3",
78-
"@types/node": "^17.0.25",
78+
"@types/node": "^18.0.0",
7979
"@typescript-eslint/eslint-plugin": "^5.29.0",
8080
"@typescript-eslint/parser": "^5.29.0",
81-
"cypress": "^9.5.4",
81+
"cypress": "^10.3.0",
8282
"eslint": "^8.18.0",
8383
"eslint-plugin-import": "^2.26.0",
84-
"eslint-plugin-jsdoc": "39.2.3",
84+
"eslint-plugin-jsdoc": "39.3.3",
8585
"eslint-plugin-prefer-arrow": "^1.2.3",
86-
"jasmine-core": "~4.1.0",
87-
"karma": "~6.3.2",
86+
"jasmine-core": "~4.2.0",
87+
"karma": "~6.4.0",
8888
"karma-chrome-launcher": "~3.1.0",
8989
"karma-coverage": "^2.2.0",
90-
"karma-jasmine": "~5.0.0",
91-
"karma-jasmine-html-reporter": "^1.5.0",
90+
"karma-jasmine": "~5.1.0",
91+
"karma-jasmine-html-reporter": "^2.0.0",
9292
"ng-packagr": "^14.0.2",
93-
"ts-node": "~10.7.0",
94-
"typescript": "~4.6.3"
93+
"ts-node": "~10.8.1",
94+
"typescript": "~4.7.4"
9595
}
9696
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { defineConfig } from 'cypress';
2+
3+
export default defineConfig({
4+
e2e: {
5+
baseUrl: 'http://localhost:4200',
6+
specPattern: 'projects/backend-test-app/cypress/e2e/**/*.cy.ts',
7+
supportFile: 'projects/backend-test-app/cypress/support/e2e.ts',
8+
screenshotOnRunFailure: false,
9+
video: false
10+
}
11+
});
Lines changed: 10 additions & 10 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/component.ts is processed and
33
// loaded automatically before your test files.
44
//
55
// This is a great place to put global configuration and
@@ -16,12 +16,12 @@
1616
// When a command from ./commands is ready to use, import with `import './commands'` syntax
1717
// import './commands';
1818

19-
Cypress.on('window:before:load', (win) => {
20-
cy.spy(win.console, 'error');
21-
});
22-
23-
afterEach(() => {
24-
cy.window().then((win) => {
25-
expect(win.console.error).to.have.callCount(0);
26-
});
27-
});
19+
// Cypress.on('window:before:load', (win) => {
20+
// cy.spy(win.console, 'error');
21+
// });
22+
//
23+
// afterEach(() => {
24+
// cy.window().then((win) => {
25+
// expect(win.console.error).to.have.callCount(0);
26+
// });
27+
// });

projects/backend-test-app/src/app/app-routing.module.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ import { Routes, RouterModule } from '@angular/router';
55
const routes: Routes = [];
66

77
@NgModule({
8-
imports: [RouterModule.forRoot(routes, {
9-
initialNavigation: 'enabled',
10-
relativeLinkResolution: 'legacy'
11-
})],
8+
imports: [
9+
RouterModule.forRoot(routes, {
10+
initialNavigation: 'enabledBlocking',
11+
relativeLinkResolution: 'legacy'
12+
})
13+
],
1214
exports: [RouterModule]
1315
})
1416
export class AppRoutingModule {}

projects/test-app/cypress.config.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { defineConfig } from 'cypress';
2+
3+
export default defineConfig({
4+
e2e: {
5+
baseUrl: 'http://localhost:4200',
6+
specPattern: 'projects/test-app/cypress/e2e/**/*.cy.ts',
7+
supportFile: 'projects/test-app/cypress/support/e2e.ts',
8+
screenshotOnRunFailure: false,
9+
video: false
10+
}
11+
});

projects/backend-test-app/cypress/support/index.ts renamed to projects/test-app/cypress/support/e2e.ts

Lines changed: 1 addition & 1 deletion
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/component.ts is processed and
33
// loaded automatically before your test files.
44
//
55
// This is a great place to put global configuration and

0 commit comments

Comments
 (0)