diff --git a/eslint.config.js b/eslint.config.js index e4cad4b..6c99b74 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,2 +1,4 @@ import { configPkg } from '@adonisjs/eslint-config' -export default configPkg() +export default configPkg({ + ignores: ['coverage'], +}) diff --git a/package.json b/package.json index 5ca99e3..ba2a77e 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "version": "npm run build", "prepublishOnly": "npm run build", "release": "release-it", - "quick:test": "node --import=ts-node-maintained/register/esm --enable-source-maps bin/test.ts" + "quick:test": "node --import=ts-node-maintained/register/esm --enable-source-maps --test \"tests/**/*.spec.ts\"" }, "devDependencies": { "@adonisjs/eslint-config": "^2.0.0-beta.7", @@ -56,6 +56,7 @@ "dependencies": { "@poppinss/macroable": "^1.0.3", "@types/chai": "^5.0.1", + "assertion-error": "^2.0.1", "chai": "^5.1.2" }, "peerDependencies": { diff --git a/src/assert.ts b/src/assert.ts index 726fbc6..2750604 100644 --- a/src/assert.ts +++ b/src/assert.ts @@ -7,8 +7,9 @@ * file that was distributed with this source code. */ +import { assert, Assertion } from 'chai' import Macroable from '@poppinss/macroable' -import { assert, Assertion, AssertionError } from 'chai' +import { AssertionError } from 'assertion-error' import { subsetCompare } from './utils.js' import type { AssertContract, ChaiAssert } from './types.js' diff --git a/tests_helpers/index.ts b/tests_helpers/index.ts index bb501dd..dd4337c 100644 --- a/tests_helpers/index.ts +++ b/tests_helpers/index.ts @@ -9,6 +9,7 @@ import * as chai from 'chai' import { ErrorsPrinter } from '@japa/errors-printer' +import { AssertionError } from 'assertion-error' export async function wrapAssertions(fn: () => void | Promise) { try { @@ -42,10 +43,10 @@ export function expectError(fn: any, val?: any) { }) } - throw new chai.AssertionError('Invalid val') + throw new AssertionError('Invalid val') } - throw new chai.AssertionError('Expected an error') + throw new AssertionError('Expected an error') } /** @@ -71,8 +72,8 @@ export async function expectAsyncError(fn: any, val?: any) { }) } - throw new chai.AssertionError('Invalid val') + throw new AssertionError('Invalid val') } - throw new chai.AssertionError('Expected an error') + throw new AssertionError('Expected an error') }