Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bumped Fastify v4 #111

Merged
merged 2 commits into from
May 10, 2022
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
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