We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 28ce63c commit c836e23Copy full SHA for c836e23
test/errors.js
@@ -6,14 +6,15 @@ const testDb = require('./helpers');
6
7
tap.test('Connect to an invalid host', (test) => {
8
const zongji = new ZongJi({
9
- host: '127.0.0.2', // Non existent host
+ host: 'wronghost',
10
user: 'wronguser',
11
password: 'wrongpass'
12
});
13
14
zongji.on('error', function (error) {
15
console.log('Real Error was:', error);
16
- test.ok(['ENOTFOUND', 'ETIMEDOUT'].indexOf(error.code) !== -1);
+ // When running in CI the error is EAI_AGAIN because the DNS lookup for the fake host fails
17
+ test.ok(['ENOTFOUND', 'ETIMEDOUT', 'EAI_AGAIN'].indexOf(error.code) !== -1);
18
test.end();
19
20
0 commit comments