diff --git a/test/parallel/test-net-connect-handle-econnrefused.js b/test/parallel/test-net-connect-handle-econnrefused.js index 3c7310b4752d72..c1ccfc23384caf 100644 --- a/test/parallel/test-net-connect-handle-econnrefused.js +++ b/test/parallel/test-net-connect-handle-econnrefused.js @@ -31,6 +31,6 @@ server.close(common.mustCall(() => { const c = net.createConnection(port); c.on('connect', common.mustNotCall()); c.on('error', common.mustCall((e) => { - assert.strictEqual('ECONNREFUSED', e.code); + assert.strictEqual(e.code, 'ECONNREFUSED'); })); }));