mirror of
https://github.com/tenrok/axios.git
synced 2026-06-05 16:42:32 +03:00
fix(dns): fixed lookup error handling; (#6175)
This commit is contained in:
@@ -9,6 +9,7 @@ import util from 'util';
|
||||
import assert from 'assert';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import {lookup} from 'dns';
|
||||
let server, proxy;
|
||||
import AxiosError from '../../../lib/core/AxiosError.js';
|
||||
import FormDataLegacy from 'form-data';
|
||||
@@ -2216,5 +2217,13 @@ describe('supports http with nodejs', function () {
|
||||
|
||||
assert.strictEqual(data, payload);
|
||||
});
|
||||
|
||||
it('should handle errors', () => {
|
||||
return assert.rejects(async () => {
|
||||
await axios.get('https://no-such-domain-987654.com', {
|
||||
lookup
|
||||
});
|
||||
}, /ENOTFOUND/);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user