Skip to content

Commit

Permalink
fixup! src: fix JSError inspection
Browse files Browse the repository at this point in the history
  • Loading branch information
Matheus Marchini committed Aug 8, 2018
1 parent 901e3cf commit 4f4d193
Showing 1 changed file with 18 additions and 1 deletion.
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>
'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

0 comments on commit 4f4d193

Please sign in to comment.