Skip to content

Commit eeced3d

Browse files
authored
Upgrade Cypress to version 15 (#70)
1 parent d933841 commit eeced3d

File tree

8 files changed

+68
-28
lines changed

8 files changed

+68
-28
lines changed

.github/workflows/deploy.yml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,33 @@ jobs:
2525
runs-on: ubuntu-latest
2626
steps:
2727
- name: Checkout
28-
uses: actions/checkout@v4
28+
uses: actions/checkout@v5
2929

3030
- name: Setup npm cache
3131
uses: actions/cache@v4
3232
with:
3333
path: '~/.npm'
34-
key: ${{ runner.os }}-node
34+
key: ${{ runner.os }}-node-24-${{ hashFiles('**/package.json') }}
3535
restore-keys: |
36-
${{ runner.os }}-node
36+
${{ runner.os }}-node-24-
37+
38+
- name: Setup Node
39+
uses: actions/setup-node@v5
40+
with:
41+
node-version: '24'
42+
43+
- name: Install dependencies
44+
run: |
45+
npm install
3746
3847
- name: Install Cypress
3948
run: |
40-
npm install [email protected]
41-
./node_modules/.bin/cypress install
49+
npm run cypress:install
4250
43-
- name: Run Cypress
51+
- name: Run test
4452
run: |
45-
./node_modules/.bin/cypress run
53+
npm test
54+
4655
deploy:
4756
needs: [test]
4857
environment:
@@ -51,11 +60,11 @@ jobs:
5160
runs-on: ubuntu-latest
5261
steps:
5362
- name: Checkout
54-
uses: actions/checkout@v4
63+
uses: actions/checkout@v5
5564
- name: Setup Pages
5665
uses: actions/configure-pages@v5
5766
- name: Upload artifact
58-
uses: actions/upload-pages-artifact@v3
67+
uses: actions/upload-pages-artifact@v4
5968
with:
6069
# Upload entire repository
6170
path: '.'

.github/workflows/test.yml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,29 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout
13-
uses: actions/checkout@v4
13+
uses: actions/checkout@v5
1414

1515
- name: Setup npm cache
1616
uses: actions/cache@v4
1717
with:
1818
path: '~/.npm'
19-
key: ${{ runner.os }}-node
19+
key: ${{ runner.os }}-node-24-${{ hashFiles('**/package.json') }}
2020
restore-keys: |
21-
${{ runner.os }}-node
21+
${{ runner.os }}-node-24-
22+
23+
- name: Setup Node
24+
uses: actions/setup-node@v5
25+
with:
26+
node-version: '24'
27+
28+
- name: Install dependencies
29+
run: |
30+
npm install
2231
2332
- name: Install Cypress
2433
run: |
25-
npm install [email protected]
26-
./node_modules/.bin/cypress install
34+
npm run cypress:install
2735
28-
- name: Run Cypress
36+
- name: Run test
2937
run: |
30-
./node_modules/.bin/cypress run
38+
npm test

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Software Heritage (SWH) archive, which will improve findability in searches.
3737

3838
### Functionalities
3939

40-
- helpers while completing the form, for example a reference list of SDPX
40+
- helpers while completing the form, for example a reference list of SPDX
4141
licenses
4242
- a validation mechanism after submission
4343
- the possibility to use all the CodeMeta terms and Schema.org terms
@@ -84,19 +84,20 @@ then open [http://localhost:8000/](http://localhost:8000/) in your web browser.
8484
In addition to manual testing, we have automated tests to check for bugs
8585
quickly, using [Cypress](https://www.cypress.io/).
8686

87-
To run them, first install Cypress:
87+
To run them, first make sure you have npm and Cypress installed on your system.
88+
From the project root, run:
8889

8990
```shell
9091
sudo apt install npm # or the equivalent on your system
91-
npx [email protected] install
92+
npm run cypress:install
9293
```
9394

9495
Then, run the tests:
9596

9697
```shell
97-
98+
npm test
9899
```
99100

100101
## Contributed by
101102

102-
![Image description](https://annex.softwareheritage.org/public/logo/software-heritage-logo-title-motto.svg)
103+
![Software Heritage](https://annex.softwareheritage.org/public/logo/software-heritage-logo-title-motto.svg)

cypress.config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const { defineConfig } = require('cypress')
2+
3+
module.exports = defineConfig({
4+
e2e: {
5+
specPattern: 'cypress/integration/**/*.js',
6+
supportFile: 'cypress/support/index.js',
7+
},
8+
})

cypress.json

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

cypress/integration/special_fields.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
*/
77

88
/*
9-
* Tests the author/contributor dynamic fieldsets
9+
* Tests fields that need special treatment.
10+
* For example, URLs and newlines handling.
1011
*/
1112

1213
"use strict";

cypress/integration/validation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
/*
9-
* Tests the basic features of the application.
9+
* Tests the validation of field values and CodeMeta document
1010
*/
1111

1212
"use strict";

package.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "codemeta-generator",
3+
"version": "3.0",
4+
"description": "Client-side web app to generate CodeMeta documents",
5+
"private": true,
6+
"scripts": {
7+
"test": "npx cypress run",
8+
"cypress:open": "npx cypress open",
9+
"cypress:install": "npx cypress install"
10+
},
11+
"engines": {
12+
"node": ">=20"
13+
},
14+
"devDependencies": {
15+
"cypress": "^15.3.0"
16+
},
17+
"license": "AGPL-3.0-or-later"
18+
}

0 commit comments

Comments
 (0)