summaryrefslogtreecommitdiff
path: root/test/async-hooks/test-writewrap.js
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2017-05-26 17:53:06 +0200
committerAnna Henningsen <anna@addaleax.net>2017-06-03 23:08:24 +0200
commit1dc3272bb9c2ecd442efd5b978a852a7da31c1e9 (patch)
treed835fa61e0503a8b5c4405c03003085129c2d0fe /test/async-hooks/test-writewrap.js
parent8741e3c7501cbe66696bd3fad4a0a923e76ba11d (diff)
downloadandroid-node-v8-1dc3272bb9c2ecd442efd5b978a852a7da31c1e9.tar.gz
android-node-v8-1dc3272bb9c2ecd442efd5b978a852a7da31c1e9.tar.bz2
android-node-v8-1dc3272bb9c2ecd442efd5b978a852a7da31c1e9.zip
test: improve async hooks test error messages
Improve error messages in the async hooks tests, mostly by removing unhelpful `message` parameters for assertions. PR-URL: https://github.com/nodejs/node/pull/13243 Reviewed-By: Kunal Pathak <kunal.pathak@microsoft.com> Reviewed-By: Andreas Madsen <amwebdk@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Diffstat (limited to 'test/async-hooks/test-writewrap.js')
-rw-r--r--test/async-hooks/test-writewrap.js19
1 files changed, 8 insertions, 11 deletions
diff --git a/test/async-hooks/test-writewrap.js b/test/async-hooks/test-writewrap.js
index 89e5cfbb13..eabb61847f 100644
--- a/test/async-hooks/test-writewrap.js
+++ b/test/async-hooks/test-writewrap.js
@@ -27,12 +27,10 @@ const server = tls
.on('secureConnection', common.mustCall(onsecureConnection))
.listen(common.PORT);
-assert.strictEqual(hooks.activitiesOfTypes('WRITEWRAP').length, 0,
- 'no WRITEWRAP when server created');
+assert.strictEqual(hooks.activitiesOfTypes('WRITEWRAP').length, 0);
function onlistening() {
- assert.strictEqual(hooks.activitiesOfTypes('WRITEWRAP').length, 0,
- 'no WRITEWRAP when server is listening');
+ assert.strictEqual(hooks.activitiesOfTypes('WRITEWRAP').length, 0);
//
// Creating client and connecting it to server
//
@@ -40,20 +38,19 @@ function onlistening() {
.connect(common.PORT, { rejectUnauthorized: false })
.on('secureConnect', common.mustCall(onsecureConnect));
- assert.strictEqual(hooks.activitiesOfTypes('WRITEWRAP').length, 0,
- 'no WRITEWRAP when client created');
+ assert.strictEqual(hooks.activitiesOfTypes('WRITEWRAP').length, 0);
}
function checkDestroyedWriteWraps(n, stage) {
const as = hooks.activitiesOfTypes('WRITEWRAP');
- assert.strictEqual(as.length, n, n + ' WRITEWRAPs when ' + stage);
+ assert.strictEqual(as.length, n, `${n} WRITEWRAPs when ${stage}`);
function checkValidWriteWrap(w) {
- assert.strictEqual(w.type, 'WRITEWRAP', 'write wrap');
- assert.strictEqual(typeof w.uid, 'number', 'uid is a number');
- assert.strictEqual(typeof w.triggerId, 'number', 'triggerId is a number');
+ assert.strictEqual(w.type, 'WRITEWRAP');
+ assert.strictEqual(typeof w.uid, 'number');
+ assert.strictEqual(typeof w.triggerId, 'number');
- checkInvocations(w, { init: 1 }, 'when ' + stage);
+ checkInvocations(w, { init: 1 }, `when ${stage}`);
}
as.forEach(checkValidWriteWrap);
}