Skip to content

Commit 09cac4a

Browse files
authored
Fix tests in Node.js v16 (fastify#4597)
1 parent 562332a commit 09cac4a

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

.github/workflows/package-manager-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
strategy:
1616
matrix:
1717
# Maintenance and active LTS
18-
node-version: [14, 16]
18+
node-version: [14, 16, 18]
1919
os: [ubuntu-latest]
2020

2121
steps:
@@ -43,7 +43,7 @@ jobs:
4343
strategy:
4444
matrix:
4545
# Maintenance and active LTS
46-
node-version: [14, 16]
46+
node-version: [14, 16, 18]
4747
os: [ubuntu-latest]
4848

4949
steps:

test/logger.test.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,17 @@ before(async function () {
2828
[localhost, localhostForURL] = await helper.getLoopbackHost()
2929
})
3030

31-
teardown(() => {
32-
files.forEach((file) => {
33-
try {
34-
fs.unlinkSync(file)
35-
} catch (e) {
36-
console.log(e)
37-
}
31+
if (process.env.CI) {
32+
teardown(() => {
33+
files.forEach((file) => {
34+
try {
35+
fs.unlinkSync(file)
36+
} catch (e) {
37+
console.log(e)
38+
}
39+
})
3840
})
39-
})
41+
}
4042

4143
test('defaults to info level', t => {
4244
let fastify = null

0 commit comments

Comments
 (0)