Skip to content

Commit

Permalink
chore: drop v14 support (#454)
Browse files Browse the repository at this point in the history
* chore: drop v14 support

* fix: heapprofiler test with --dest and --name
  • Loading branch information
RafaelGSS authored Jun 28, 2023
1 parent 95e73e6 commit 5c22d67
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node-version: [14, 16, 18, 19]
node-version: [16, 18, 20]

runs-on: ${{matrix.os}}
steps:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ To avoid that behavior you can either quote ("--", '--') or escape (`--`) the do
## Supported Node.js versions

Clinic.js relies heavily on Node.js core instrumentation available in later versions.
Currently the supported Node.js versions are `>= 14`.
Currently the supported Node.js versions are `>= 16`.

## Examples and Demos

Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
"lint": "standard --fix | snazzy"
},
"dependencies": {
"@clinic/bubbleprof": "^9.0.0",
"@clinic/doctor": "^10.0.0",
"@clinic/flame": "^12.0.0",
"@clinic/heap-profiler": "^4.0.0",
"@clinic/bubbleprof": "^10.0.0",
"@clinic/doctor": "^11.0.0",
"@clinic/flame": "^13.0.0",
"@clinic/heap-profiler": "^5.0.0",
"any-shell-escape": "^0.1.1",
"async": "^3.0.1",
"autocannon": "^7.5.0",
Expand Down
44 changes: 37 additions & 7 deletions test/cli-heapprofiler-full.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const url = require('url')
const fs = require('fs')
const path = require('path')
const async = require('async')
const test = require('tap').test
const { test } = require('tap')
const cli = require('./cli.js')

test('clinic heapprofiler -- node - no issues', function (t) {
Expand Down Expand Up @@ -78,7 +78,7 @@ test('clinic heapprofiler --on-port', function (t) {
'heapprofiler',
'--no-open',
'--on-port',
'autocannon localhost:$PORT -d 2',
'node -p "\'Hello world\'"',
'--',
'node',
path.join(__dirname, 'server.js')
Expand All @@ -89,9 +89,10 @@ test('clinic heapprofiler --on-port', function (t) {
const dirname = stdout.match(/(\.clinic[/\\]\d+.clinic-heapprofiler)/)[1]
const fullpath = url.pathToFileURL(fs.realpathSync(path.resolve(tempdir, dirname)))

t.ok(stderr.indexOf('Running 2s test @ http://localhost:') > -1)
t.equal(stdout.split('\n')[0], 'Analysing data')
t.equal(stdout.split('\n')[1], `Generated HTML file is ${fullpath}.html`)
const [hello, analysing, generated] = stdout.split('\n')
t.equal(hello, 'Hello world')
t.equal(analysing, 'Analysing data')
t.equal(generated, `Generated HTML file is ${fullpath}.html`)
t.end()
}
)
Expand Down Expand Up @@ -143,8 +144,37 @@ test('clinic heapprofiler -- node - configure output destination', function (t)
function (err, stdout, stderr, tempdir) {
t.error(err)

t.ok(fs.statSync(path.join(tempdir, 'test-heapprofiler-destination.clinic-heapprofiler')).isFile())
t.ok(fs.statSync(path.join(tempdir, 'test-heapprofiler-destination.clinic-heapprofiler.html')).isFile())
t.ok(fs.statSync(path.join(tempdir, 'test-heapprofiler-destination.clinic-heapprofiler')).isDirectory())
t.end()
}
)
})

test('clinic heapprofiler -- node - configure output destination and name', function (t) {
cli(
{ relayStderr: false },
[
'clinic',
'heapprofiler',
'--no-open',
'--dest',
'test-heapprofiler-destination.clinic-heapprofiler',
'--name',
'test-name',
'--',
'node',
'-e',
'require("util").inspect(process)'
],
function (err, stdout, stderr, tempdir) {
t.error(err)

t.ok(fs.statSync(
path.join(
tempdir,
'test-heapprofiler-destination.clinic-heapprofiler',
'test-name.clinic-heapprofiler.html'
)).isFile())
t.end()
}
)
Expand Down

0 comments on commit 5c22d67

Please sign in to comment.