Skip to content

Commit

Permalink
test: make func source test compatbile with v12
Browse files Browse the repository at this point in the history
The string stored in V8 with the function source code is different on
v12. Update the regexp used in our test to match older and newer
versions.

PR-URL: #326
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
mmarchini committed Jan 14, 2020
1 parent ecb8d0e commit fd9d2b0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions test/plugin/inspect-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,9 @@ const hashMapTests = {
// Include 'source:' and '>' to act as boundaries. (Avoid
// passing if the whole file it displayed instead of just
// the function we want.)
const arrowSource = 'source:\n' +
'function c.hashmap.(anonymous function)(a,b)=>{a+b}\n' +
'>';
const arrowSource = /source:\nfunction c.hashmap.(\(anonymous function\)|<computed>)\(a,b\)=>{a\+b}\n>/;

t.ok(lines.includes(arrowSource),
t.ok(lines.match(arrowSource),
'hashmap[25] should have the correct function source');
cb(null);
});
Expand Down

0 comments on commit fd9d2b0

Please sign in to comment.