diff options
Diffstat (limited to 'deps/node/deps/node-inspect/test/cli/heap-profiler.test.js')
-rw-r--r-- | deps/node/deps/node-inspect/test/cli/heap-profiler.test.js | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/deps/node/deps/node-inspect/test/cli/heap-profiler.test.js b/deps/node/deps/node-inspect/test/cli/heap-profiler.test.js deleted file mode 100644 index ebd734e0..00000000 --- a/deps/node/deps/node-inspect/test/cli/heap-profiler.test.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; -const { test } = require('tap'); -const { readFileSync, unlinkSync } = require('fs'); - -const startCLI = require('./start-cli'); -const filename = 'node.heapsnapshot'; - -function cleanup() { - try { - unlinkSync(filename); - } catch (_) { - // Ignore. - } -} - -cleanup(); - -test('Heap profiler take snapshot', (t) => { - const cli = startCLI(['examples/empty.js']); - - function onFatal(error) { - cli.quit(); - throw error; - } - - // Check that the snapshot is valid JSON. - return cli.waitForInitialBreak() - .then(() => cli.waitForPrompt()) - .then(() => cli.command('takeHeapSnapshot()')) - .then(() => JSON.parse(readFileSync(filename, 'utf8'))) - .then(() => cleanup()) - .then(() => cli.quit()) - .then(null, onFatal); -}); |