Skip to content

Commit 7ae0dee

Browse files
Matheus Marchinijoyeecheung
authored andcommitted
test: more consistent test for findjsobjects -d (#188)
findjsobjects -d test relies on how the hidden-class it tests is built. Zlib is a builtin from Node.js, therefore we cannot be sure about the order attributes are assigned to the class, making its hidden-class unpredictable. Using a class from our fixtures (in this case, Class) makes the test more predictable across Node.js versions and across multiple Operating Systems. Ref: #186
1 parent 6dbd9dd commit 7ae0dee

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

test/scan-test.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function test(executable, core, t) {
3737

3838
sess.linesUntil(versionMark, (err, lines) => {
3939
t.error(err);
40-
t.ok(/\d+ Zlib/.test(lines.join('\n')), 'Zlib should be in findjsobjects');
40+
t.ok(/\d+ Class/.test(lines.join('\n')), 'Class should be in findjsobjects');
4141

4242
sess.send('v8 findjsobjects -d');
4343
// Just a separator
@@ -46,9 +46,8 @@ function test(executable, core, t) {
4646

4747
sess.linesUntil(versionMark, (err, lines) => {
4848
t.error(err);
49-
t.ok(/0 +0 Zlib/.test(lines.join('\n')), 'Zlib should be in findjsobjects -d');
50-
t.ok(/1 +0 Zlib: onerror/.test(lines.join('\n')),
51-
'"Zlib: onerror" should be in findjsobjects -d');
49+
t.ok(/3 +0 Class: x, y, hashmap/.test(lines.join('\n')),
50+
'"Class: x, y, hashmap" should be in findjsobjects -d');
5251

5352
sess.send('v8 findjsinstances Zlib');
5453
// Just a separator

0 commit comments

Comments
 (0)