Skip to content

Commit 243ae0d

Browse files
committed
Support testing on Node 8
1 parent 4d9f314 commit 243ae0d

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ node_js:
33
- node
44
- 10
55
- 9
6+
- 8
67
after_success:
78
- npm run-script test-travis

test/io/http-respond.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,14 @@ const server = http.createServer((req, res) => {
1515
if (req.url === '/no-callback') io.httpRespond({req, res, type, value: responseValue})
1616
else {
1717
io.httpRespond({req, res, type, value: responseValue}, err => {
18-
if (throwError) assert.errorMessage(err, 'Cannot set headers after they are sent to the client')
18+
if (throwError) {
19+
assert.instanceOf(err, Error)
20+
const {message} = err!
21+
assert(
22+
message === "Can't set headers after they are sent." || //Node 8 and before
23+
message === 'Cannot set headers after they are sent to the client' //Node 9 and after
24+
)
25+
}
1926
else {
2027
if (err) throw err
2128
}

0 commit comments

Comments
 (0)