Skip to content

Commit be0589e

Browse files
committed
chore: upgrade cypress to run on node 18
1 parent 66e01d1 commit be0589e

File tree

14 files changed

+1297
-1037
lines changed

14 files changed

+1297
-1037
lines changed

.github/workflows/ci-api.yml

+11-11
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ jobs:
2525
runs-on: ubuntu-latest
2626

2727
steps:
28-
- uses: actions/checkout@v2
29-
- name: Set up Node 14
30-
uses: actions/setup-node@v2
28+
- uses: actions/checkout@v3
29+
- name: Set up Node 18
30+
uses: actions/setup-node@v3
3131
with:
32-
node-version: '14'
32+
node-version: 18
3333

3434
- name: Cache node modules
35-
uses: actions/cache@v2
35+
uses: actions/cache@v3
3636
env:
3737
cache-name: cache-node-modules
3838
with:
@@ -75,22 +75,22 @@ jobs:
7575
needs:
7676
- build
7777
steps:
78-
- uses: actions/checkout@v2
78+
- uses: actions/checkout@v3
7979

8080
- name: Set up QEMU
81-
uses: docker/setup-qemu-action@v1
81+
uses: docker/setup-qemu-action@v2
8282

8383
- name: Set up Docker Buildx
84-
uses: docker/setup-buildx-action@v1
84+
uses: docker/setup-buildx-action@v2
8585

8686
- name: Dashboard to DockerHub
87-
uses: docker/login-action@v1
87+
uses: docker/login-action@v2
8888
with:
8989
username: ${{ secrets.DOCKERHUB_USERNAME }}
9090
password: ${{ secrets.DOCKERHUB_TOKEN }}
9191

9292
- name: Build and push
93-
uses: docker/build-push-action@v2
93+
uses: docker/build-push-action@v3
9494
with:
9595
context: .
9696
file: Dockerfile.api
@@ -106,7 +106,7 @@ jobs:
106106
needs:
107107
- package
108108
steps:
109-
- uses: actions/checkout@v2
109+
- uses: actions/checkout@v3
110110
- name: Add Server key
111111
run: |
112112
touch key.txt && echo "${{ secrets.SERVER_KEY }}" > key.txt

.github/workflows/ci-web.yml

+10-10
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ jobs:
2525
runs-on: ubuntu-latest
2626

2727
steps:
28-
- uses: actions/checkout@v2
29-
- name: Set up Node 14
30-
uses: actions/setup-node@v2
28+
- uses: actions/checkout@v3
29+
- name: Set up Node 18
30+
uses: actions/setup-node@v3
3131
with:
32-
node-version: '14'
32+
node-version: 18
3333

3434
- name: Cache node modules
35-
uses: actions/cache@v2
35+
uses: actions/cache@v3
3636
env:
3737
cache-name: cache-node-modules
3838
with:
@@ -67,7 +67,7 @@ jobs:
6767
needs:
6868
- build
6969
steps:
70-
- uses: actions/checkout@v2
70+
- uses: actions/checkout@v3
7171
- name: Copy configuration file for production
7272
uses: prewk/s3-cp-action@v2
7373
with:
@@ -81,19 +81,19 @@ jobs:
8181
run: mv frontend.env .env.production.local
8282

8383
- name: Set up QEMU
84-
uses: docker/setup-qemu-action@v1
84+
uses: docker/setup-qemu-action@v2
8585

8686
- name: Set up Docker Buildx
87-
uses: docker/setup-buildx-action@v1
87+
uses: docker/setup-buildx-action@v2
8888

8989
- name: Dashboard to DockerHub
90-
uses: docker/login-action@v1
90+
uses: docker/login-action@v2
9191
with:
9292
username: ${{ secrets.DOCKERHUB_USERNAME }}
9393
password: ${{ secrets.DOCKERHUB_TOKEN }}
9494

9595
- name: Build and push
96-
uses: docker/build-push-action@v2
96+
uses: docker/build-push-action@v3
9797
with:
9898
context: ..
9999
file: Dockerfile.web

backend/app/__tests__/shared/utils/helpers.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ describe('Test Helpers - extractQueryFields', () => {
4545
});
4646
});
4747

48-
describe.only('Others helpers functions', () => {
48+
describe('Others helpers functions', () => {
4949
test('remove query string from the URL path', () => {
5050
expect(removeQueryStringIfExist('/languages?fields=id,name')).toMatchInlineSnapshot(`"/languages"`);
5151
expect(removeQueryStringIfExist('/years-groups')).toMatchInlineSnapshot(`"/years-groups"`);
@@ -60,7 +60,7 @@ describe.only('Others helpers functions', () => {
6060
expect(generateRoutePrefix('/')).toMatchObject(['/', '/private']);
6161
});
6262

63-
test.only('Verify if the url is from scam', () => {
63+
test('Verify if the url is from scam', () => {
6464
expect(isScamRoute('/languages?fields=id,name')).toEqual(false);
6565
expect(isScamRoute('/?XDEBUG_SESSION_START=phpstorm')).toEqual(true);
6666
expect(isScamRoute('/years-groups')).toEqual(false);

backend/app/shared/core/middleware/logRequestMiddleware.ts

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { getDurationInMilliseconds } from '../../utils/request';
66
import { CLIENT_ORIGIN } from '../config';
77

88
const isWhiteListedURL = (requestURL: string) => {
9-
console.log('youherelle => ', requestURL);
109
const urls = ['/', '/health', '/spec/prolang.yaml'];
1110

1211
return urls.includes(requestURL);

frontend/.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,5 @@ mockServiceWorker.js
3838

3939
# sitemap
4040
/public/robots.txt
41-
/public/sitemap.xml
41+
/public/sitemap.xml
42+
/public/sitemap-0.xml

frontend/__tests__/cypress.config.ts

+11
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+
setupNodeEvents(on, config) {
6+
// implement node event listeners here
7+
},
8+
"baseUrl": "http://localhost:5701",
9+
"video": false
10+
},
11+
});

frontend/__tests__/cypress.json

-4
This file was deleted.

frontend/__tests__/cypress/support/index.ts frontend/__tests__/cypress/support/e2e.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ declare global {
1717
}
1818

1919
// Import commands.js using ES2015 syntax:
20-
import './commands';
20+
import './commands';

frontend/__tests__/setup/dom.setup.js

-5
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
const SITE_URL = process.env.NEXT_PUBLIC_APP_URL;
22

33
module.exports = {
4-
siteUrl: SITE_URL,
4+
exclude: ['/login', '/dashboard', '/profile', '/settings', '/authors*', '/users*', '/languages*'],
55
generateRobotsTxt: true,
66
robotsTxtOptions: {
7+
additionalSitemaps: [`${SITE_URL}/sitemap.xml`],
78
policies: [
8-
{ userAgent: '*', disallow: '/login' },
9-
{ userAgent: '*', allow: '/' },
9+
{
10+
disallow: '/login',
11+
userAgent: '*'
12+
},
13+
{
14+
allow: '/',
15+
userAgent: '*'
16+
},
1017
],
11-
additionalSitemaps: [`${SITE_URL}/sitemap.xml`],
1218
},
13-
exclude: ['/login', '/dashboard', '/profile', '/settings', '/authors*', '/users*', '/languages*'],
19+
siteUrl: SITE_URL,
1420
};

frontend/package.json

+6-7
Original file line numberDiff line numberDiff line change
@@ -57,21 +57,20 @@
5757
"babel-jest": "^27.3.1",
5858
"color": "^3.1.3",
5959
"cross-env": "^7.0.3",
60-
"cypress": "9.1.0",
61-
"cypress-localstorage-commands": "^1.5.0",
60+
"cypress": "12.2.0",
61+
"cypress-localstorage-commands": "^2.2.2",
6262
"eslint": "7.30.0",
6363
"eslint-config-next": "11.0.1",
6464
"eslint-config-prettier": "^8.3.0",
6565
"eslint-plugin-jest-dom": "^3.9.2",
6666
"eslint-plugin-testing-library": "^5.0.0",
6767
"eslint-plugin-use-encapsulation": "^1.0.0",
68-
"eventsourcemock": "^2.0.0",
69-
"jest": "^27.3.1",
70-
"msw": "^0.35.0",
71-
"next-sitemap": "^1.6.203",
68+
"jest": "^29.3.1",
69+
"msw": "^0.49.2",
70+
"next-sitemap": "^3.1.43",
7271
"postcss": "^8.3.5",
7372
"prettier": "^2.3.2",
74-
"start-server-and-test": "^1.14.0",
73+
"start-server-and-test": "^1.15.2",
7574
"tailwindcss": "^2.2.19",
7675
"typescript": "4.5.5"
7776
},

0 commit comments

Comments
 (0)