test: make sure tests fail properly instead of timing out (#24316)

This commit is contained in:
Milan Burda 2020-07-01 00:10:36 +02:00 committed by GitHub
parent 451086d7f2
commit c6db47182a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 1484 additions and 1367 deletions

View file

@ -305,8 +305,12 @@ describe('protocol module', () => {
it('can access request headers', (done) => {
protocol.registerHttpProtocol(protocolName, (request) => {
expect(request).to.have.property('headers');
done();
try {
expect(request).to.have.property('headers');
done();
} catch (e) {
done(e);
}
});
ajax(protocolName + '://fake-host');
});
@ -597,8 +601,12 @@ describe('protocol module', () => {
it('can access request headers', (done) => {
protocol.interceptHttpProtocol('http', (request) => {
expect(request).to.have.property('headers');
done();
try {
expect(request).to.have.property('headers');
done();
} catch (e) {
done(e);
}
});
ajax('http://fake-host');
});