Skip to content

Commit

Permalink
bumped Fastify v4 (#111)
Browse files Browse the repository at this point in the history
* bumped Fastify v4

* no more old nodes
  • Loading branch information
mcollina authored May 10, 2022
1 parent 92f43e4 commit 3d0c44d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ jobs:
strategy:
matrix:
node-version:
- 10
- 12
- 14
- 16
- 18
os:
- macos-latest
- ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions formbody.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ function formBodyPlugin (fastify, options, next) {
}

module.exports = fp(formBodyPlugin, {
fastify: '^3.0.0',
name: 'fastify-formbody'
fastify: '^4.0.0',
name: '@fastify/formbody'
})
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"devDependencies": {
"@types/node": "^17.0.0",
"codecov": "^3.7.2",
"fastify": "^3.3.0",
"fastify": "^4.0.0-rc.2",
"pre-commit": "^1.2.2",
"qs": "^6.5.1",
"request": "^2.88.0",
Expand Down
16 changes: 8 additions & 8 deletions test/integration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ test('succes route succeeds', (t) => {
res.send(Object.assign({}, req.body, { message: 'done' }))
})

fastify.listen(0, (err) => {
fastify.listen({ port: 0 }, (err) => {
if (err) tap.error(err)
fastify.server.unref()

Expand All @@ -42,7 +42,7 @@ test('cannot exceed body limit', (t) => {
res.send(Object.assign({}, req.body, { message: 'done' }))
})

fastify.listen(0, (err) => {
fastify.listen({ port: 0 }, (err) => {
if (err) tap.error(err)
fastify.server.unref()

Expand Down Expand Up @@ -76,7 +76,7 @@ test('cannot exceed body limit when Content-Length is not available', (t) => {
res.send(Object.assign({}, req.body, { message: 'done' }))
})

fastify.listen(0, (err) => {
fastify.listen({ port: 0 }, (err) => {
if (err) tap.error(err)
fastify.server.unref()

Expand Down Expand Up @@ -112,7 +112,7 @@ test('cannot exceed body limit set on Fastify instance', (t) => {
res.send(Object.assign({}, req.body, { message: 'done' }))
})

fastify.listen(0, (err) => {
fastify.listen({ port: 0 }, (err) => {
if (err) tap.error(err)
fastify.server.unref()

Expand All @@ -139,7 +139,7 @@ test('plugin bodyLimit should overwrite Fastify instance bodyLimit', (t) => {
res.send(Object.assign({}, req.body, { message: 'done' }))
})

fastify.listen(0, (err) => {
fastify.listen({ port: 0 }, (err) => {
if (err) tap.error(err)
fastify.server.unref()

Expand All @@ -161,7 +161,7 @@ test('plugin should throw if opts.parser is not a function', (t) => {
t.plan(2)
const fastify = Fastify()
fastify.register(plugin, { parser: 'invalid' })
fastify.listen(0, (err) => {
fastify.listen({ port: 0 }, (err) => {
t.ok(err)
t.match(err.message, /parser must be a function/)
fastify.server.unref()
Expand All @@ -177,7 +177,7 @@ test('plugin should not parse nested objects by default', (t) => {
res.send(Object.assign({}, req.body, { message: 'done' }))
})

fastify.listen(0, (err) => {
fastify.listen({ port: 0 }, (err) => {
if (err) tap.error(err)
fastify.server.unref()

Expand All @@ -204,7 +204,7 @@ test('plugin should allow providing custom parser as option', (t) => {
res.send(Object.assign({}, req.body, { message: 'done' }))
})

fastify.listen(0, (err) => {
fastify.listen({ port: 0 }, (err) => {
if (err) tap.error(err)
fastify.server.unref()

Expand Down

0 comments on commit 3d0c44d

Please sign in to comment.