Browse Source

correct exception spelling

http2
Vsevolod Strukchinsky 9 years ago
parent
commit
f7ab59459e
  1. 4
      test/arguments.js
  2. 4
      test/helpers.js

4
test/arguments.js

@ -27,7 +27,7 @@ test.before('setup', async t => {
test('url is required', async t => {
try {
await got();
t.fail('Exception is not thrown');
t.fail('Exception was not thrown');
} catch (err) {
t.regexTest(/Parameter `url` must be a string or object, not undefined/, err.message);
}
@ -55,7 +55,7 @@ test('overrides querystring from opts', async t => {
test('should throw with auth in url', async t => {
try {
await got(`https://test:45d3ps453@account.myservice.com/api/token`);
t.fail('Exception is not thrown');
t.fail('Exception was not thrown');
} catch (err) {
t.regexTest(/Basic authentication must be done with auth option/, err.message);
}

4
test/helpers.js

@ -32,14 +32,14 @@ test('promise mode', async t => {
try {
await got.get(`${s.url}/404`);
t.fail('Exception is not thrown');
t.fail('Exception was not thrown');
} catch (err) {
t.is(err.response.body, 'not found');
}
try {
await got.get('.com', {retries: 0});
t.fail('Exception is not thrown');
t.fail('Exception was not thrown');
} catch (err) {
t.ok(err);
}

Loading…
Cancel
Save