Skip to content

Commit

Permalink
Update dependency ava to v6 (#309)
Browse files Browse the repository at this point in the history
* Update dependency ava to v6

* Fix test

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Xiao <michael.xiao@smartcontract.com>
  • Loading branch information
renovate[bot] and mxiao-cll authored Nov 28, 2024
1 parent f54f08e commit 917424f
Show file tree
Hide file tree
Showing 4 changed files with 430 additions and 228 deletions.
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"@types/yeoman-generator": "5.2.14",
"@typescript-eslint/eslint-plugin": "8.16.0",
"@typescript-eslint/parser": "8.16.0",
"ava": "5.3.1",
"ava": "6.2.0",
"axios-mock-adapter": "1.22.0",
"c8": "10.1.2",
"eslint": "9.15.0",
Expand All @@ -67,11 +67,13 @@
"files": [
"test/**/*.test.ts"
],
"extensions": [
"ts"
],
"extensions": {
"mjs": true,
"ts": "commonjs"
},
"require": [
"ts-node/register"
"ts-node/register",
"./test/_force-exit.mjs"
],
"workerThreads": false,
"environmentVariables": {
Expand Down
6 changes: 6 additions & 0 deletions test/_force-exit.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import process from 'node:process';
import { registerCompletionHandler } from 'ava';

registerCompletionHandler(() => {
process.exit();
});
16 changes: 8 additions & 8 deletions test/validation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ test.serial('omitted optional param returns 200', async (t) => {
})

test.serial('duplicate params in definition fails', async (t) => {
const error: AdapterInputError | undefined = t.throws(() => {
const error = t.throws(() => {
new InputParameters({
base: {
type: 'string',
Expand Down Expand Up @@ -528,7 +528,7 @@ test.serial('non-required number allows default 0', async (t) => {
})

test.serial('missing dependency fails validation', async (t) => {
const error: AdapterInputError | undefined = t.throws(() => {
const error = t.throws(() => {
t.context.adapterEndpoint.inputParameters = new InputParameters({
base: {
type: 'string',
Expand All @@ -543,7 +543,7 @@ test.serial('missing dependency fails validation', async (t) => {
})

test.serial('missing exclusion fails validation', async (t) => {
const error: AdapterInputError | undefined = t.throws(() => {
const error = t.throws(() => {
t.context.adapterEndpoint.inputParameters = new InputParameters({
base: {
type: 'string',
Expand All @@ -558,7 +558,7 @@ test.serial('missing exclusion fails validation', async (t) => {
})

test.serial('dependency on required param fails validation', async (t) => {
const error: AdapterInputError | undefined = t.throws(() => {
const error = t.throws(() => {
t.context.adapterEndpoint.inputParameters = new InputParameters({
base: {
type: 'string',
Expand All @@ -581,7 +581,7 @@ test.serial('dependency on required param fails validation', async (t) => {
})

test.serial('exclusion of required param fails validation', async (t) => {
const error: AdapterInputError | undefined = t.throws(() => {
const error = t.throws(() => {
t.context.adapterEndpoint.inputParameters = new InputParameters({
base: {
type: 'string',
Expand All @@ -601,7 +601,7 @@ test.serial('exclusion of required param fails validation', async (t) => {
})

test.serial('aliases of different properties with common values fail validation', async (t) => {
const error: AdapterInputError | undefined = t.throws(() => {
const error = t.throws(() => {
t.context.adapterEndpoint.inputParameters = new InputParameters({
base: {
type: 'string',
Expand All @@ -623,7 +623,7 @@ test.serial('aliases of different properties with common values fail validation'
})

test.serial('throws on empty options array', async (t) => {
const error: AdapterInputError | undefined = t.throws(() => {
const error = t.throws(() => {
t.context.adapterEndpoint.inputParameters = new InputParameters({
base: {
type: 'string',
Expand All @@ -637,7 +637,7 @@ test.serial('throws on empty options array', async (t) => {
})

test.serial('throws on repeated options', async (t) => {
const error: AdapterInputError | undefined = t.throws(() => {
const error = t.throws(() => {
t.context.adapterEndpoint.inputParameters = new InputParameters({
base: {
type: 'string',
Expand Down
Loading

0 comments on commit 917424f

Please sign in to comment.