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>
This commit is contained in:
Anna Henningsen 2017-05-26 17:53:06 +02:00
parent 8741e3c750
commit 1dc3272bb9
No known key found for this signature in database
GPG key ID: D8B9F5AEAE84E4CF
36 changed files with 234 additions and 306 deletions

View file

@ -26,12 +26,9 @@ const parser = new HTTPParser(REQUEST);
const as = hooks.activitiesOfTypes('HTTPPARSER');
const httpparser = as[0];
assert.strictEqual(
as.length, 1,
'1 httpparser created synchronously when creating new httpparser');
assert.strictEqual(typeof httpparser.uid, 'number', 'uid is a number');
assert.strictEqual(typeof httpparser.triggerId,
'number', 'triggerId is a number');
assert.strictEqual(as.length, 1);
assert.strictEqual(typeof httpparser.uid, 'number');
assert.strictEqual(typeof httpparser.triggerId, 'number');
checkInvocations(httpparser, { init: 1 }, 'when created new Httphttpparser');
parser[kOnHeadersComplete] = common.mustCall(onheadersComplete);