Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixup! src: fix JSError inspection
  • Loading branch information
Matheus Marchini authored and mmarchini committed Sep 11, 2018
commit 6fdfd26a5b94067d3617c8ac231fb063374ad232
19 changes: 18 additions & 1 deletion test/plugin/inspect-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,24 @@ const hashMapTests = {
// .error=0x0000392d5d661119:<Object: Error>

This comment was marked as off-topic.

This comment was marked as off-topic.

'error': {
re: /.error=(0x[0-9a-f]+):<Object: Error>/,
desc: '.error Error property'
desc: '.error Error property',
validator(t, sess, addresses, name, cb) {
const address = addresses[name];
sess.send(`v8 inspect ${address}`);

sess.linesUntil(/}>/, (err, lines) => {
if (err) return cb(err);
lines = lines.join('\n');

let codeMatch = lines.match(/code=(0x[0-9a-f]+):<String: "ERR_TEST">/i);
t.ok(codeMatch, 'hashmap.error.code should be "ERR_TEST"');

let errnoMatch = lines.match(/errno=<Smi: 1>/i);
t.ok(errnoMatch, 'hashmap.error.errno should be 1');

cb(null);
});
}
},
// .array=0x000003df9cbe7919:<Array: length=6>,
'array': {
Expand Down