test-debugger-heap-profiler.js
Imports Node.js common test helperimports fs
SHA-256c9b71e8caac09dee636473bb555c07d21c557e27950f27be4d440a596c0d7c89
MaleculeH₂(Cm₂F)Md₂(InPa)
Evidence
1'use strict';
2const common = require('../common');
3
4common.skipIfInspectorDisabled();
5
6const fixtures = require('../common/fixtures');
7const startCLI = require('../common/debugger');
8const tmpdir = require('../common/tmpdir');
9const path = require('path');
10
11tmpdir.refresh();
12
13const { readFileSync } = require('fs');
14
15const filename = path.join(tmpdir.path, 'node.heapsnapshot');
⋯8 lines
26 await cli.command('takeHeapSnapshot()');
27 JSON.parse(readFileSync(filename, 'utf8'));
28 // Check that two simultaneous snapshots don't step all over each other.
29 // Refs: https://github.com/nodejs/node/issues/39555
30 await cli.command('takeHeapSnapshot(); takeHeapSnapshot()');
31 JSON.parse(readFileSync(filena …
33:4… await cli.quit();
34 }
35 }
36
37 // Check that the snapshot is valid JSON.
38 waitInitialBreak().then(common.mustCall());
39}