From eb02bb77b93ef215a3e475e4ffcb9cfb99aba985 Mon Sep 17 00:00:00 2001 From: RafaelGSS Date: Wed, 23 Mar 2022 23:25:29 -0300 Subject: [PATCH] fix: use package version as output on on-port --- test/cli-heapprofiler-full.test.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/cli-heapprofiler-full.test.js b/test/cli-heapprofiler-full.test.js index fe8ef45..9eccba3 100644 --- a/test/cli-heapprofiler-full.test.js +++ b/test/cli-heapprofiler-full.test.js @@ -7,6 +7,8 @@ const async = require('async') const test = require('tap').test const cli = require('./cli.js') +const pkg = require('../package.json') + test('clinic heapprofiler -- node - no issues', function (t) { // collect data cli( @@ -78,7 +80,7 @@ test('clinic heapprofiler --on-port', function (t) { 'heapprofiler', '--no-open', '--on-port', - 'echo "on port was called"', + 'clinic -v', '--', 'node', path.join(__dirname, 'server.js') @@ -89,7 +91,7 @@ test('clinic heapprofiler --on-port', function (t) { const dirname = stdout.match(/(\.clinic[/\\]\d+.clinic-heapprofile)/)[1] const fullpath = url.pathToFileURL(fs.realpathSync(path.resolve(tempdir, dirname))) - t.equal(stdout.split('\n')[0], 'on port was called') + t.equal(stdout.split('\n')[0], `v${pkg.version}`) t.equal(stdout.split('\n')[1], 'Analysing data') t.equal(stdout.split('\n')[2], `Generated HTML file is ${fullpath}.html`) t.end()