Skip to content

Commit

Permalink
Updates for v5 (#111)
Browse files Browse the repository at this point in the history
* update script

* pre-commit
  • Loading branch information
gurgunday authored and jsumners committed Jun 17, 2024
1 parent 9bcfd87 commit a46b852
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 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
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,18 @@
"main": "index.js",
"type": "commonjs",
"dependencies": {
"ajv": "^8.0.0",
"fastify-plugin": "^4.0.0"
"ajv": "^8.12.0",
"fastify-plugin": "^4.5.1"
},
"types": "types/index.d.ts",
"devDependencies": {
"@types/node": "^20.1.1",
"@fastify/pre-commit": "^2.1.0",
"@types/node": "^20.12.7",
"ajv-errors": "^3.0.0",
"ajv-formats": "^3.0.1",
"fastify": "^4.2.1",
"standard": "^17.0.0",
"tap": "^16.3.0",
"fastify": "^4.26.2",
"standard": "^17.1.0",
"tap": "^18.7.2",
"tsd": "^0.31.0"
},
"scripts": {
Expand Down
12 changes: 6 additions & 6 deletions test/ajv.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,31 +77,31 @@ test('use ajv errors', async t => {
test('should throw an error if ajv.plugins is string', async t => {
t.plan(1)
const fastify = Fastify()
t.rejects(fastify.register(plugin, { ajv: { plugins: 'invalid' } }), 'ajv.plugins option should be an array, instead got \'string\'')
t.rejects(async () => fastify.register(plugin, { ajv: { plugins: 'invalid' } }), 'ajv.plugins option should be an array, instead got \'string\'')
})

test('should throw an error if ajv.plugins is null', async t => {
t.plan(1)
const fastify = Fastify()
t.rejects(fastify.register(plugin, { ajv: { plugins: null } }), 'ajv.plugins option should be an array, instead got \'object\'')
t.rejects(async () => fastify.register(plugin, { ajv: { plugins: null } }), 'ajv.plugins option should be an array, instead got \'object\'')
})

test('should throw an error if ajv.plugins is undefined', async t => {
t.plan(1)
const fastify = Fastify()
t.rejects(fastify.register(plugin, { ajv: { plugins: undefined } }), 'ajv.plugins option should be an array, instead got \'undefined\'')
t.rejects(async () => fastify.register(plugin, { ajv: { plugins: undefined } }), 'ajv.plugins option should be an array, instead got \'undefined\'')
})

test('should throw an error if ajv.plugins is boolean', async t => {
t.plan(1)
const fastify = Fastify()
t.rejects(fastify.register(plugin, { ajv: { plugins: false } }), 'ajv.plugins option should be an array, instead got \'boolean\'')
t.rejects(async () => fastify.register(plugin, { ajv: { plugins: false } }), 'ajv.plugins option should be an array, instead got \'boolean\'')
})

test('should throw an error if ajv.plugins is number', async t => {
t.plan(1)
const fastify = Fastify()
t.rejects(fastify.register(plugin, { ajv: { plugins: 0 } }), 'ajv.plugins option should be an array, instead got \'number\'')
t.rejects(async () => fastify.register(plugin, { ajv: { plugins: 0 } }), 'ajv.plugins option should be an array, instead got \'number\'')
})

test('use ajv formats with Ajv instance', async t => {
Expand Down Expand Up @@ -314,5 +314,5 @@ test('use ajv errors with 2019 Ajv instance', async t => {
test('should throw an error if ajv.plugins is not passed to instance and not array', async t => {
t.plan(1)
const fastify = Fastify()
t.rejects(fastify.register(plugin, { ajv: { plugins: 'invalid' } }), 'ajv.plugins option should be an array, instead got \'string\'')
t.rejects(async () => fastify.register(plugin, { ajv: { plugins: 'invalid' } }), 'ajv.plugins option should be an array, instead got \'string\'')
})

0 comments on commit a46b852

Please sign in to comment.