| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -95,10 +95,7 @@ describe('TLS callback exception handling', () => { | |||
| 95 | 95 | reject(e); | |
| 96 | 96 | } | |
| 97 | 97 | })); | |
| 98 | - | ||
| 99 | - server.on('secureConnection', common.mustNotCall(() => { | ||
| 100 | - reject(new Error('secureConnection should not fire')); | ||
| 101 | - })); | ||
| 98 | + server.on('secureConnection', common.mustNotCall('secureConnection listener')); | ||
| 102 | 99 | ||
| 103 | 100 | await new Promise((res) => server.listen(0, res)); | |
| 104 | 101 | ||
@@ -113,7 +110,7 @@ describe('TLS callback exception handling', () => { | |||
| 113 | 110 | }), | |
| 114 | 111 | }); | |
| 115 | 112 | ||
| 116 | - client.on('error', () => {}); | ||
| 113 | + client.on('error', common.mustCall()); | ||
| 117 | 114 | ||
| 118 | 115 | await promise; | |
| 119 | 116 | }); | |
@@ -307,9 +304,7 @@ describe('TLS callback exception handling', () => { | |||
| 307 | 304 | } | |
| 308 | 305 | })); | |
| 309 | 306 | ||
| 310 | - server.on('secureConnection', common.mustNotCall(() => { | ||
| 311 | - reject(new Error('secureConnection should not fire')); | ||
| 312 | - })); | ||
| 307 | + server.on('secureConnection', common.mustNotCall('secureConnection should not fire')); | ||
| 313 | 308 | ||
| 314 | 309 | await new Promise((res) => server.listen(0, res)); | |
| 315 | 310 | ||
@@ -324,7 +319,7 @@ describe('TLS callback exception handling', () => { | |||
| 324 | 319 | }), | |
| 325 | 320 | }); | |
| 326 | 321 | ||
| 327 | - client.on('error', () => {}); | ||
| 322 | + client.on('error', common.mustCall()); | ||
| 328 | 323 | ||
| 329 | 324 | await promise; | |
| 330 | 325 | }); | |
@@ -354,10 +349,7 @@ describe('TLS callback exception handling', () => { | |||
| 354 | 349 | reject(e); | |
| 355 | 350 | } | |
| 356 | 351 | })); | |
| 357 | - | ||
| 358 | - server.on('secureConnection', common.mustNotCall(() => { | ||
| 359 | - reject(new Error('secureConnection should not fire')); | ||
| 360 | - })); | ||
| 352 | + server.on('secureConnection', common.mustNotCall('secureConnection listener')); | ||
| 361 | 353 | ||
| 362 | 354 | await new Promise((res) => server.listen(0, res)); | |
| 363 | 355 | ||
@@ -368,7 +360,7 @@ describe('TLS callback exception handling', () => { | |||
| 368 | 360 | ALPNProtocols: ['http/1.1', 'h2'], | |
| 369 | 361 | }); | |
| 370 | 362 | ||
| 371 | - client.on('error', () => {}); | ||
| 363 | + client.on('error', common.mustCall()); | ||
| 372 | 364 | ||
| 373 | 365 | await promise; | |
| 374 | 366 | }); | |
@@ -397,10 +389,8 @@ describe('TLS callback exception handling', () => { | |||
| 397 | 389 | reject(e); | |
| 398 | 390 | } | |
| 399 | 391 | })); | |
| 392 | + server.on('secureConnection', common.mustNotCall('secureConnection listener')); | ||
| 400 | 393 | ||
| 401 | - server.on('secureConnection', common.mustNotCall(() => { | ||
| 402 | - reject(new Error('secureConnection should not fire')); | ||
| 403 | - })); | ||
| 404 | 394 | await new Promise((res) => server.listen(0, res)); | |
| 405 | 395 | ||
| 406 | 396 | const client = tls.connect({ | |
@@ -410,7 +400,7 @@ describe('TLS callback exception handling', () => { | |||
| 410 | 400 | ALPNProtocols: ['http/1.1'], | |
| 411 | 401 | }); | |
| 412 | 402 | ||
| 413 | - client.on('error', () => {}); | ||
| 403 | + client.on('error', common.mustCall()); | ||
| 414 | 404 | ||
| 415 | 405 | await promise; | |
| 416 | 406 | }); | |
@@ -429,9 +419,7 @@ describe('TLS callback exception handling', () => { | |||
| 429 | 419 | ||
| 430 | 420 | const { promise, resolve, reject } = createTestPromise(); | |
| 431 | 421 | ||
| 432 | - server.on('secureConnection', common.mustNotCall(() => { | ||
| 433 | - reject(new Error('secureConnection should not fire')); | ||
| 434 | - })); | ||
| 422 | + server.on('secureConnection', common.mustNotCall('secureConnection listener')); | ||
| 435 | 423 | ||
| 436 | 424 | await new Promise((res) => server.listen(0, res)); | |
| 437 | 425 | ||
@@ -473,9 +461,7 @@ describe('TLS callback exception handling', () => { | |||
| 473 | 461 | ||
| 474 | 462 | const { promise, resolve, reject } = createTestPromise(); | |
| 475 | 463 | ||
| 476 | - server.on('secureConnection', common.mustNotCall(() => { | ||
| 477 | - reject(new Error('secureConnection should not fire')); | ||
| 478 | - })); | ||
| 464 | + server.on('secureConnection', common.mustNotCall('secureConnection listener')); | ||
| 479 | 465 | ||
| 480 | 466 | await new Promise((res) => server.listen(0, res)); | |
| 481 | 467 | ||
@@ -526,10 +512,7 @@ describe('TLS callback exception handling', () => { | |||
| 526 | 512 | reject(e); | |
| 527 | 513 | } | |
| 528 | 514 | })); | |
| 529 | - | ||
| 530 | - server.on('secureConnection', () => { | ||
| 531 | - reject(new Error('secureConnection should not fire')); | ||
| 532 | - }); | ||
| 515 | + server.on('secureConnection', common.mustNotCall('secureConnection listener')); | ||
| 533 | 516 | ||
| 534 | 517 | await new Promise((res) => server.listen(0, res)); | |
| 535 | 518 | ||
@@ -540,7 +523,7 @@ describe('TLS callback exception handling', () => { | |||
| 540 | 523 | rejectUnauthorized: false, | |
| 541 | 524 | }); | |
| 542 | 525 | ||
| 543 | - client.on('error', () => {}); | ||
| 526 | + client.on('error', common.mustCall()); | ||
| 544 | 527 | ||
| 545 | 528 | await promise; | |
| 546 | 529 | }); | |
@@ -573,10 +556,7 @@ describe('TLS callback exception handling', () => { | |||
| 573 | 556 | reject(e); | |
| 574 | 557 | } | |
| 575 | 558 | })); | |
| 576 | - | ||
| 577 | - server.on('secureConnection', () => { | ||
| 578 | - reject(new Error('secureConnection should not fire')); | ||
| 579 | - }); | ||
| 559 | + server.on('secureConnection', common.mustNotCall('secureConnection listener')); | ||
| 580 | 560 | ||
| 581 | 561 | await new Promise((res) => server.listen(0, res)); | |
| 582 | 562 | ||
@@ -587,7 +567,7 @@ describe('TLS callback exception handling', () => { | |||
| 587 | 567 | rejectUnauthorized: false, | |
| 588 | 568 | }); | |
| 589 | 569 | ||
| 590 | - client.on('error', () => {}); | ||
| 570 | + client.on('error', common.mustCall()); | ||
| 591 | 571 | ||
| 592 | 572 | await promise; | |
| 593 | 573 | }); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments