From 547225d9d317c5c48238e3a332be06c44b91c54b Mon Sep 17 00:00:00 2001 From: James Sumners <321201+jsumners@users.noreply.github.com> Date: Tue, 2 Jul 2024 06:49:54 -0400 Subject: [PATCH] Merge `next` into `master` (#227) * upgrade for fastify 5 (#225) * upgrade for fastify 5 (#225) * update fastify deps --------- Co-authored-by: Cristian Barlutiu --- .github/workflows/ci.yml | 2 +- package.json | 22 +++++++++++----------- test/auth.test.js | 10 ++++++++-- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7b00276..5395d92 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/package.json b/package.json index b270b00..0df59d7 100644 --- a/package.json +++ b/package.json @@ -32,19 +32,19 @@ "license": "MIT", "devDependencies": { "@fastify/jwt": "^8.0.0", - "@fastify/leveldb": "^5.0.1", - "@fastify/pre-commit": "^2.0.2", - "@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.31.0" + "@fastify/leveldb": "^6.0.0-pre.fv5.1", + "@fastify/pre-commit": "^2.1.0", + "@fastify/type-provider-json-schema-to-ts": "^4.0.0-pre.fv5.1", + "@fastify/type-provider-typebox": "^5.0.0-pre.fv5.1", + "@types/node": "^20.11.30", + "fastify": "^5.0.0-alpha.3", + "rimraf": "^5.0.5", + "standard": "^17.1.0", + "tap": "^18.7.1", + "tsd": "^0.30.7" }, "dependencies": { - "fastify-plugin": "^4.0.0", + "fastify-plugin": "^5.0.0-pre.fv5.1", "reusify": "^1.0.4" }, "publishConfig": { diff --git a/test/auth.test.js b/test/auth.test.js index 33b6b31..22aba2e 100644 --- a/test/auth.test.js +++ b/test/auth.test.js @@ -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 => {