Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ module.exports = App
```js
'use strict'

const { test } = require('tap')
const { test } = require('node:test')
const Fastify = require('fastify')
const App = require('./app.js')

Expand All @@ -339,7 +339,7 @@ test('connect to /', async (t) => {

const fastify = Fastify()
fastify.register(App)
t.teardown(fastify.close.bind(fastify))
t.after(() => fastify.close())
await fastify.ready()

const ws = await fastify.injectWS('/', {headers: { "api-key" : "some-random-key" }})
Expand All @@ -351,7 +351,7 @@ test('connect to /', async (t) => {
})
ws.send('hi from client')

t.assert(await promise, 'hi from server')
t.assert.deepStrictEqual(await promise, 'hi from server')
// Remember to close the ws at the end
ws.terminate()
})
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"lint": "eslint",
"lint:fix": "eslint --fix",
"test": "npm run test:unit && npm run test:typescript",
"test:unit": "tap",
"test:unit": "c8 --100 node --test",
"test:typescript": "tsd"
},
"repository": {
Expand Down Expand Up @@ -60,12 +60,12 @@
"@fastify/type-provider-typebox": "^5.0.0",
"@types/node": "^22.0.0",
"@types/ws": "^8.5.10",
"c8": "^10.1.3",
"eslint": "^9.17.0",
"fastify": "^5.0.0",
"fastify-tsconfig": "^3.0.0",
"neostandard": "^0.12.0",
"split2": "^4.2.0",
"tap": "^18.7.1",
"tsd": "^0.31.0"
},
"dependencies": {
Expand Down
Loading