Skip to content

Commit 83db46a

Browse files
inigomarquinezjonchurchctcpip
authored
ci: fix errors in ci github action for node 8 and 9 (#523)
* ci: fix errors in ci github action for node 8 and 9 * ci: remove minor version on node 22 * ci: remove minor versions * 🧪 skip query test on node 21 Co-authored-by: Chris de Almeida <[email protected]> --------- Co-authored-by: Jon Church <[email protected]> Co-authored-by: Chris de Almeida <[email protected]>
1 parent 9d4e212 commit 83db46a

File tree

2 files changed

+51
-27
lines changed

2 files changed

+51
-27
lines changed

.github/workflows/ci.yml

+35-23
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ jobs:
3232
- Node.js 17.x
3333
- Node.js 18.x
3434
- Node.js 19.x
35+
- Node.js 20.x
36+
- Node.js 21.x
37+
- Node.js 22.x
3538

3639
include:
3740
- name: Node.js 0.8
@@ -48,77 +51,86 @@ jobs:
4851
4952

5053
- name: io.js 1.x
51-
node-version: "1.8"
54+
node-version: "1"
5255
5356

5457
- name: io.js 2.x
55-
node-version: "2.5"
58+
node-version: "2"
5659
5760

5861
- name: io.js 3.x
59-
node-version: "3.3"
62+
node-version: "3"
6063
6164

6265
- name: Node.js 4.x
63-
node-version: "4.9"
66+
node-version: "4"
6467
6568

6669
- name: Node.js 5.x
67-
node-version: "5.12"
70+
node-version: "5"
6871
6972

7073
- name: Node.js 6.x
71-
node-version: "6.17"
74+
node-version: "6"
7275
7376

7477
- name: Node.js 7.x
75-
node-version: "7.10"
78+
node-version: "7"
7679
7780

7881
- name: Node.js 8.x
79-
node-version: "8.17"
80-
82+
node-version: "8"
83+
8184

8285
- name: Node.js 9.x
83-
node-version: "9.11"
84-
86+
node-version: "9"
87+
8588

8689
- name: Node.js 10.x
87-
node-version: "10.24"
90+
node-version: "10"
8891
8992

9093
- name: Node.js 11.x
91-
node-version: "11.15"
94+
node-version: "11"
9295
9396

9497
- name: Node.js 12.x
95-
node-version: "12.22"
98+
node-version: "12"
9699
97100

98101
- name: Node.js 13.x
99-
node-version: "13.14"
102+
node-version: "13"
100103
101104

102105
- name: Node.js 14.x
103-
node-version: "14.21"
106+
node-version: "14"
104107

105108
- name: Node.js 15.x
106-
node-version: "15.14"
109+
node-version: "15"
107110

108111
- name: Node.js 16.x
109-
node-version: "16.19"
112+
node-version: "16"
110113

111114
- name: Node.js 17.x
112-
node-version: "17.9"
115+
node-version: "17"
113116

114117
- name: Node.js 18.x
115-
node-version: "18.14"
118+
node-version: "18"
116119

117120
- name: Node.js 19.x
118-
node-version: "19.7"
121+
node-version: "19"
122+
123+
- name: Node.js 20.x
124+
node-version: "20"
125+
126+
- name: Node.js 21.x
127+
node-version: "21"
128+
129+
- name: Node.js 22.x
130+
node-version: "22"
119131

120132
steps:
121-
- uses: actions/checkout@v3
133+
- uses: actions/checkout@v4
122134

123135
- name: Install Node.js ${{ matrix.node-version }}
124136
shell: bash -eo pipefail -l {0}
@@ -209,7 +221,7 @@ jobs:
209221
needs: test
210222
runs-on: ubuntu-latest
211223
steps:
212-
- uses: actions/checkout@v3
224+
- uses: actions/checkout@v4
213225

214226
- name: Install lcov
215227
shell: bash

test/body-parser.js

+16-4
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,25 @@ describe('bodyParser()', function () {
7373
})
7474
})
7575

76+
function getMajorVersion (versionString) {
77+
return versionString.split('.')[0]
78+
}
79+
80+
function shouldSkipQuery (versionString) {
81+
// Skipping HTTP QUERY tests on Node 21, it is reported in http.METHODS on 21.7.2 but not supported
82+
// update this implementation to run on supported versions of 21 once they exist
83+
// upstream tracking https://github.com/nodejs/node/issues/51562
84+
// express tracking issue: https://github.com/expressjs/express/issues/5615
85+
return getMajorVersion(versionString) === '21'
86+
}
87+
7688
methods.slice().sort().forEach(function (method) {
77-
if (method === 'connect') {
78-
// except CONNECT
79-
return
80-
}
89+
if (method === 'connect') return
8190

8291
it('should support ' + method.toUpperCase() + ' requests', function (done) {
92+
if (method === 'query' && shouldSkipQuery(process.versions.node)) {
93+
this.skip()
94+
}
8395
request(this.server)[method]('/')
8496
.set('Content-Type', 'application/json')
8597
.set('Content-Length', '15')

0 commit comments

Comments
 (0)