| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent c5ee34e commit 977e228
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -25,9 +25,10 @@ const common = require('../common'); | |||
| 25 | 25 | if (!common.hasCrypto) | |
| 26 | 26 | common.skip('missing crypto'); | |
| 27 | 27 | ||
| 28 | - const tls = require('tls'); | ||
| 28 | + const assert = require('assert'); | ||
| 29 | 29 | const fs = require('fs'); | |
| 30 | 30 | const path = require('path'); | |
| 31 | + const tls = require('tls'); | ||
| 31 | 32 | ||
| 32 | 33 | // https://github.com/joyent/node/issues/1218 | |
| 33 | 34 | // uncatchable exception on TLS connection error | |
@@ -38,7 +39,10 @@ const path = require('path'); | |||
| 38 | 39 | const options = {cert: cert, key: key, port: common.PORT}; | |
| 39 | 40 | const conn = tls.connect(options, common.mustNotCall()); | |
| 40 | 41 | ||
| 41 | - conn.on('error', common.mustCall()); | ||
| 42 | + conn.on( | ||
| 43 | + 'error', | ||
| 44 | + common.mustCall((e) => { assert.strictEqual(e.code, 'ECONNREFUSED'); }) | ||
| 45 | + ); | ||
| 42 | 46 | } | |
| 43 | 47 | ||
| 44 | 48 | // SSL_accept/SSL_connect error handling | |
@@ -53,5 +57,8 @@ const path = require('path'); | |||
| 53 | 57 | ciphers: 'rick-128-roll' | |
| 54 | 58 | }, common.mustNotCall()); | |
| 55 | 59 | ||
| 56 | - conn.on('error', common.mustCall()); | ||
| 60 | + conn.on( | ||
| 61 | + 'error', | ||
| 62 | + common.mustCall((e) => { assert.strictEqual(e.code, 'ECONNREFUSED'); }) | ||
| 63 | + ); | ||
| 57 | 64 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments