Skip to content

Commit

Permalink
upgrade qmock to fix tests; 0.14.0
Browse files Browse the repository at this point in the history
  • Loading branch information
andrasq committed Jun 25, 2023
1 parent 4130686 commit d5b0d5c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/nodejs.yml
Expand Up @@ -7,23 +7,26 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
# github ci errors out on 0.8.x deps
node: [ 0.11.x, 12, 16, 5.8.0 ]
# 0.10 and 0.8 might need a newer qmock
node: [ 0.11.x, 6, 8, 12, 16, 5.8.0 ]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- run: npm install
# - run: npm install -g qnit npm@2.15.0
- run: npm test

- name: coverage
- name: npm test
run: test `node -v` '!=' 'v5.8.0' && npm test || true

- name: install nyc
if: ${{ matrix.node == '5.8.0' }}
run: npm install -g nyc@8.4.0

- name: test coverage
if: ${{ matrix.node == '5.8.0' }}
run: |
# test `node -v` = '5.8.0' || exit
npm install -g nyc@8.4.0
npm run coverage
run: npm run coverage

- name: upload coverage
if: ${{ matrix.node == '5.8.0' }}
uses: coverallsapp/github-action@v1.1.2
Expand Down
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -15,12 +15,12 @@
"dependencies": {
},
"devDependencies": {
"qmock": "0.16.3",
"qmock": "0.17.2",
"qnit": "x"
},

"scripts": {
"test": "qnit test.js",
"test": "node -v ; qnit test.js",
"coverage": "nyc --reporter lcov --reporter text npm test",
"clean": "rm -rf .nyc_output coverage"
}
Expand Down
5 changes: 0 additions & 5 deletions test.js
Expand Up @@ -187,8 +187,6 @@ module.exports = {

'options.maxRedirects': {
'retries the request': function(t) {
// FIXME: some kind of race, "this.socket.destroy is not a function", but only on github ci/cd and only w/ node-v16
t.skip();
qmock.mockHttp()
.when('http://hostname:1/foo')
.send(301, 'Moved.', { location: 'https://hostname2:22/bar' })
Expand All @@ -207,7 +205,6 @@ t.skip();
})
},
'redirects to defaults': function(t) {
t.skip();
qmock.mockHttp()
.when('proto://myhost:1234/foo')
.send(301, 'Moved.', { location: 'http://otherhost/bar' })
Expand All @@ -224,7 +221,6 @@ t.skip();
})
},
'redirects with all defaults': function(t) {
t.skip();
qmock.mockHttp()
.when('http://localhost/foo')
.send(301, 'Moved.', { location: '/bar' })
Expand All @@ -239,7 +235,6 @@ t.skip();
})
},
'errors out if too many redirects': function(t) {
t.skip();
qmock.mockHttp()
.when('http://hostname:80/foo')
.send(301, 'Moved.', { location: 'http://hostname:80/foo' });
Expand Down

0 comments on commit d5b0d5c

Please sign in to comment.