Skip to content

Commit

Permalink
Use err.code to make test more reliable
Browse files Browse the repository at this point in the history
  • Loading branch information
dyladan committed Nov 30, 2023
1 parent 3e2fcda commit 317c93d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,8 @@ describe('PrometheusExporter', () => {
.get('http://localhost:9464/metrics', res => {
errorHandler(done)(new Error('unreachable'));
})
.on('error', err => {
assert(`${err}`.match('ECONNREFUSED'));
.on('error', (err: any) => {
assert.equal(err.code, 'ECONNREFUSED');
done();
});
});
Expand Down

0 comments on commit 317c93d

Please sign in to comment.