From 049dac8a50f54b959a0b0118bd9db71d01fcef5f Mon Sep 17 00:00:00 2001 From: James Sumners <321201+jsumners@users.noreply.github.com> Date: Tue, 9 Jul 2024 16:17:28 -0400 Subject: [PATCH] Merge `next` into `master` (#339) * Update for Fastify v5 (#332) * Update for Fastify v5 * remove --cov arg, enabled by default * update @fastify/pre-commit to latest * enable coverage * ignored coverage error * Update for Fastify v5 (#332) * Update for Fastify v5 * remove --cov arg, enabled by default * update @fastify/pre-commit to latest * enable coverage * ignored coverage error * update fastify deps --------- Co-authored-by: Cristian Barlutiu --- .github/workflows/ci.yml | 2 +- jwt.js | 5 ++--- package.json | 18 +++++++++--------- 3 files changed, 12 insertions(+), 13 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/jwt.js b/jwt.js index 4e8779e..f541dd1 100644 --- a/jwt.js +++ b/jwt.js @@ -216,14 +216,13 @@ function fastifyJwt (fastify, options, next) { } catch (error) { // Ignoring the else branch because it's not possible to test it, // it's just a safeguard for future changes in the fast-jwt library - /* istanbul ignore next */ if (error.code === TokenError.codes.malformed) { throw new AuthorizationTokenInvalidError(error.message) } else if (error.code === TokenError.codes.invalidType) { throw new AuthorizationTokenInvalidError(error.message) - } else { + } /* c8 ignore start */ else { throw error - } + } /* c8 ignore stop */ } } diff --git a/package.json b/package.json index 8f848a8..0260238 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "test": "npm run lint && npm run test:unit && npm run test:typescript", "test:typescript": "tsd", "test:unit": "tap", - "test:unit:report": "tap --cov --coverage-report=html", + "test:unit:report": "tap --coverage-report=html", "test:unit:verbose": "tap -Rspec" }, "repository": { @@ -33,18 +33,18 @@ "homepage": "https://github.com/fastify/fastify-jwt#readme", "dependencies": { "@fastify/error": "^4.0.0", - "@lukeed/ms": "^2.0.0", + "@lukeed/ms": "^2.0.2", "fast-jwt": "^4.0.0", - "fastify-plugin": "^4.0.0", + "fastify-plugin": "^5.0.0-pre.fv5.1", "steed": "^1.1.3" }, "devDependencies": { - "@fastify/cookie": "^9.0.4", - "@fastify/pre-commit": "^2.0.2", - "@types/node": "^20.1.1", - "fastify": "^4.0.0-rc.2", - "standard": "^17.0.0", - "tap": "^16.0.0", + "@fastify/cookie": "^10.0.0-pre.fv5.1", + "@fastify/pre-commit": "^2.1.0", + "@types/node": "^20.11.29", + "fastify": "^5.0.0-alpha.3", + "standard": "^17.1.0", + "tap": "^18.7.1", "tsd": "^0.31.0" }, "publishConfig": {