Skip to content

Commit b264661

Browse files
committed
test: use 'node' rather than 'jsdom' as the jest testEnvironment
1 parent 781d55b commit b264661

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,10 @@
118118
"prepublishOnly": "npm run build",
119119
"test-integration": "mocha test/integration",
120120
"test-unit": "jest test/unit/",
121-
"test-unit-travis": "jest --silent --runInBand test/unit/",
121+
"test-unit-travis": "jest --silent --runInBand test/unit/ && codecov",
122122
"test": "npm run test-unit && npm run test-integration && nyc report --reporter=html",
123123
"test-travis": "npm run test-unit-travis && nyc mocha test/integration/ --grep @slow --invert && nyc report --reporter=html",
124-
"report-coverage": "nyc report --reporter=text-lcov > coverage.lcov && ./node_modules/.bin/codecov",
124+
"report-coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov",
125125
"watch-doc": "nodemon --watch ./ --ext js,tmpl,json --ignore dist/ --ignore doc/ --ignore test/ --ignore examples/ --exec npm run doc",
126126
"watch": "npm run test-unit -- --watch",
127127
"watchify": "watchify index.js --standalone Watson --outfile dist/watson.js --debug --verbose"
@@ -146,6 +146,7 @@
146146
},
147147
"jest": {
148148
"collectCoverage": true,
149-
"coverageDirectory": "./coverage/"
149+
"coverageDirectory": "./coverage/",
150+
"testEnvironment": "node"
150151
}
151152
}

test/unit/requestWrapper.test.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
/**
2-
* @jest-environment node
3-
*/
4-
5-
// the above comment instructs jest to use a node, rather than browser, environment
6-
// the sendRequest method uses the environment to determine if running in the browser
7-
// and uses special handling if it is. the tests will fail without the above comment
8-
91
'use strict';
102

113
const sendRequest = require('../../lib/requestwrapper').sendRequest;

0 commit comments

Comments
 (0)