From 4d49b6ab8b813564c4395eb2917d42f891847461 Mon Sep 17 00:00:00 2001 From: Mohammed Bilal Shareef Date: Thu, 21 Mar 2024 02:16:57 +0530 Subject: [PATCH] Update for v5 (#299) --- .github/workflows/ci.yml | 2 +- .taprc | 4 ---- package.json | 22 +++++++++++----------- test/hooks.test.js | 2 +- 4 files changed, 13 insertions(+), 17 deletions(-) delete mode 100644 .taprc diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0610c55..582175c 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: lint: true license-check: true diff --git a/.taprc b/.taprc deleted file mode 100644 index 4e76693..0000000 --- a/.taprc +++ /dev/null @@ -1,4 +0,0 @@ -ts: false -jsx: false -coverage: true -flow: true diff --git a/package.json b/package.json index 520c660..f0a189a 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "type": "commonjs", "types": "types/index.d.ts", "scripts": { - "coverage": "tap --cov --coverage-report=html test", + "coverage": "tap --coverage-report=html test", "lint": "standard", "lint:fix": "standard --fix", "test": "npm run test:unit && npm run test:typescript", @@ -31,19 +31,19 @@ }, "homepage": "https://github.com/fastify/fastify-cors#readme", "devDependencies": { - "@fastify/pre-commit": "^2.0.2", - "@types/node": "^20.1.0", - "@typescript-eslint/eslint-plugin": "^7.1.1", - "@typescript-eslint/parser": "^7.1.1", + "@fastify/pre-commit": "^2.1.0", + "@types/node": "^20.11.30", + "@typescript-eslint/eslint-plugin": "^7.3.1", + "@typescript-eslint/parser": "^7.3.1", "cors": "^2.8.5", - "fastify": "^4.0.0-rc.2", - "standard": "^17.0.0", - "tap": "16.3.9", - "tsd": "^0.30.0", - "typescript": "^5.0.2" + "fastify": "^4.26.2", + "standard": "^17.1.0", + "tap": "18.7.1", + "tsd": "^0.30.7", + "typescript": "^5.4.2" }, "dependencies": { - "fastify-plugin": "^4.0.0", + "fastify-plugin": "^4.5.1", "mnemonist": "0.39.8" }, "tsd": { diff --git a/test/hooks.test.js b/test/hooks.test.js index 0dd2778..0ccc75b 100644 --- a/test/hooks.test.js +++ b/test/hooks.test.js @@ -9,7 +9,7 @@ test('Should error on invalid hook option', async (t) => { t.plan(1) const fastify = Fastify() - t.rejects(fastify.register(cors, { hook: 'invalid' }), new TypeError('@fastify/cors: Invalid hook option provided.')) + t.rejects(async () => fastify.register(cors, { hook: 'invalid' }), new TypeError('@fastify/cors: Invalid hook option provided.')) }) test('Should set hook onRequest if hook option is not set', async (t) => {