Skip to content

Commit c836e23

Browse files
committed
Added DNS lookup failed error
1 parent 28ce63c commit c836e23

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/errors.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@ const testDb = require('./helpers');
66

77
tap.test('Connect to an invalid host', (test) => {
88
const zongji = new ZongJi({
9-
host: '127.0.0.2', // Non existent host
9+
host: 'wronghost',
1010
user: 'wronguser',
1111
password: 'wrongpass'
1212
});
1313

1414
zongji.on('error', function (error) {
1515
console.log('Real Error was:', error);
16-
test.ok(['ENOTFOUND', 'ETIMEDOUT'].indexOf(error.code) !== -1);
16+
// 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);
1718
test.end();
1819
});
1920

0 commit comments

Comments
 (0)