Skip to content

Commit fd9d2b0

Browse files
committed
test: make func source test compatbile with v12
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>
1 parent ecb8d0e commit fd9d2b0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

test/plugin/inspect-test.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,9 @@ const hashMapTests = {
4848
// Include 'source:' and '>' to act as boundaries. (Avoid
4949
// passing if the whole file it displayed instead of just
5050
// the function we want.)
51-
const arrowSource = 'source:\n' +
52-
'function c.hashmap.(anonymous function)(a,b)=>{a+b}\n' +
53-
'>';
51+
const arrowSource = /source:\nfunction c.hashmap.(\(anonymous function\)|<computed>)\(a,b\)=>{a\+b}\n>/;
5452

55-
t.ok(lines.includes(arrowSource),
53+
t.ok(lines.match(arrowSource),
5654
'hashmap[25] should have the correct function source');
5755
cb(null);
5856
});

0 commit comments

Comments
 (0)