Skip to content

Commit

Permalink
test: fix test-heapdump-zlib
Browse files Browse the repository at this point in the history
PR-URL: #34499
Refs: #34048
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
puzpuzpuz authored and MylesBorins committed Jul 27, 2020
1 parent 99a6487 commit 3f11ba1
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions test/pummel/test-heapdump-zlib.js
@@ -1,17 +1,28 @@
// Flags: --expose-internals
'use strict';
require('../common');
const common = require('../common');
const { validateSnapshotNodes } = require('../common/heap');
const zlib = require('zlib');

validateSnapshotNodes('Node / ZlibStream', []);
// eslint-disable-next-line no-unused-vars
const gunzip = zlib.createGunzip();

const gzip = zlib.createGzip();
validateSnapshotNodes('Node / ZlibStream', [
{
children: [
{ node_name: 'Zlib', edge_name: 'wrapped' },
{ node_name: 'Node / zlib_memory', edge_name: 'zlib_memory' }
{ node_name: 'Zlib', edge_name: 'wrapped' }
// No entry for memory because zlib memory is initialized lazily.
]
}
]);

gzip.write('hello world', common.mustCall(() => {
validateSnapshotNodes('Node / ZlibStream', [
{
children: [
{ node_name: 'Zlib', edge_name: 'wrapped' },
{ node_name: 'Node / zlib_memory', edge_name: 'zlib_memory' }
]
}
]);
}));

0 comments on commit 3f11ba1

Please sign in to comment.