Skip to content

Commit

Permalink
upgrade for fastify 5 (#225)
Browse files Browse the repository at this point in the history
  • Loading branch information
synapse authored Mar 20, 2024
1 parent e8d4580 commit 8ebb2de
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:

jobs:
test:
uses: fastify/workflows/.github/workflows/plugins-ci.yml@v3
uses: fastify/workflows/.github/workflows/plugins-ci.yml@v4.1.0
with:
license-check: true
lint: true
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@
"license": "MIT",
"devDependencies": {
"@fastify/jwt": "^8.0.0",
"@fastify/leveldb": "^5.0.1",
"@fastify/pre-commit": "^2.0.2",
"@fastify/leveldb": "^5.1.0",
"@fastify/pre-commit": "^2.1.0",
"@fastify/type-provider-json-schema-to-ts": "^3.0.0",
"@fastify/type-provider-typebox": "^4.0.0",
"@types/node": "^20.1.0",
"fastify": "^4.5.3",
"rimraf": "^5.0.0",
"standard": "^17.0.0",
"tap": "^16.3.0",
"tsd": "^0.30.0"
"@types/node": "^20.11.30",
"fastify": "^4.26.2",
"rimraf": "^5.0.5",
"standard": "^17.1.0",
"tap": "^18.7.1",
"tsd": "^0.30.7"
},
"dependencies": {
"fastify-plugin": "^4.0.0",
"fastify-plugin": "^4.5.1",
"reusify": "^1.0.4"
},
"publishConfig": {
Expand Down
10 changes: 8 additions & 2 deletions test/auth.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@ const Fastify = require('fastify')
const fastifyAuth = require('../auth')

test('registering plugin with invalid default relation', async (t) => {
t.plan(1)
t.plan(2)

const fastify = Fastify()
t.rejects(fastify.register(fastifyAuth, { defaultRelation: 'auth' }), 'The value of default relation should be one of [\'or\', \'and\']')
fastify.register(fastifyAuth, { defaultRelation: 'auth' })

fastify.ready((err) => {
t.ok(err)
t.equal(err.message, 'The value of default relation should be one of [\'or\', \'and\']')
})
})

test('Clean status code through auth pipeline', t => {
Expand Down

0 comments on commit 8ebb2de

Please sign in to comment.