Skip to content

Commit

Permalink
Merge 9a5d5d2 into 0fbcea9
Browse files Browse the repository at this point in the history
  • Loading branch information
depfu[bot] committed Nov 11, 2019
2 parents 0fbcea9 + 9a5d5d2 commit e4742bc
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"mocha": "^6.1.4",
"nyc": "^14.0.0",
"pem": "^1.13.1",
"prettier": "~1.18.2",
"prettier": "~1.19.1",
"request": "^2.53.0",
"semver": "^6.0.0",
"sinon": "^7.0.0",
Expand Down
52 changes: 40 additions & 12 deletions test/unexpectedMitm.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,10 @@ describe('unexpectedMitm', () => {
'<any> when delayed a little bit <assertion>',
(expect, subject) =>
expect.promise(run => {
setTimeout(run(() => expect.shift()), 1);
setTimeout(
run(() => expect.shift()),
1
);
})
);

Expand Down Expand Up @@ -279,7 +282,12 @@ describe('unexpectedMitm', () => {
http.get({ host: 'example.com', agent }).on(
'response',
run(response => {
response.on('data', () => {}).on('end', run(() => {}));
response
.on('data', () => {})
.on(
'end',
run(() => {})
);
})
);
}),
Expand Down Expand Up @@ -314,7 +322,12 @@ describe('unexpectedMitm', () => {
http.get({ host: 'example.com' }).on(
'response',
run(response => {
response.on('data', () => {}).on('end', run(() => {}));
response
.on('data', () => {})
.on(
'end',
run(() => {})
);
})
);
}),
Expand Down Expand Up @@ -796,7 +809,10 @@ describe('unexpectedMitm', () => {
issueGetAndConsume(
'http://www.google.com/',
run(() => {
issueGetAndConsume('http://www.google.com/', run(() => {}));
issueGetAndConsume(
'http://www.google.com/',
run(() => {})
);
})
);
}),
Expand Down Expand Up @@ -920,7 +936,10 @@ describe('unexpectedMitm', () => {
expect(
() =>
expect.promise(run => {
issueGetAndConsume('http://www.google.com/', run(() => {}));
issueGetAndConsume(
'http://www.google.com/',
run(() => {})
);
}),
'with http mocked out',
{
Expand Down Expand Up @@ -1021,7 +1040,10 @@ describe('unexpectedMitm', () => {
.on('error', () => {
expect.fail('request unexpectedly errored');
})
.on('response', run(() => {}))
.on(
'response',
run(() => {})
)
.end();
})
)
Expand Down Expand Up @@ -1538,9 +1560,12 @@ describe('unexpectedMitm', () => {
expect(
expect(
() =>
expect('http://www.google.com/foo', 'to yield response', 200).then(
() =>
expect('http://www.google.com/foo', 'to yield response', 200)
expect(
'http://www.google.com/foo',
'to yield response',
200
).then(() =>
expect('http://www.google.com/foo', 'to yield response', 200)
),
'with http mocked out',
[],
Expand All @@ -1554,9 +1579,12 @@ describe('unexpectedMitm', () => {
'to equal',
'expected\n' +
'() =>\n' +
" expect('http://www.google.com/foo', 'to yield response', 200).then(\n" +
' () =>\n' +
" expect('http://www.google.com/foo', 'to yield response', 200)\n" +
' expect(\n' +
" 'http://www.google.com/foo',\n" +
" 'to yield response',\n" +
' 200\n' +
' ).then(() =>\n' +
" expect('http://www.google.com/foo', 'to yield response', 200)\n" +
' )\n' +
'with http mocked out [] not to error\n' +
'\n' +
Expand Down

0 comments on commit e4742bc

Please sign in to comment.