From ba4a3a6106788cb08d5ecfb7f9c7b2fef91eb580 Mon Sep 17 00:00:00 2001 From: Emelia Smith Date: Tue, 3 Dec 2024 23:44:02 +0100 Subject: [PATCH] chore: fix outdated tests and ts-expect-error for notIncludeDeepMembers --- src/assert.ts | 8 +++----- tests/assert/assert.spec.ts | 16 ++++++++-------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/assert.ts b/src/assert.ts index eb05368..726fbc6 100644 --- a/src/assert.ts +++ b/src/assert.ts @@ -1515,12 +1515,10 @@ export class Assert extends Macroable implements AssertContract { * ) // fails */ notIncludeDeepMembers( - ...args: Parameters - ): ReturnType { + ...args: Parameters + ): ReturnType { this.incrementAssertionsCount() - - // @ts-expect-error not in @types/chai - return assert['notIncludeDeepMembers'](...args) + return assert.notIncludeDeepMembers(...args) } /** diff --git a/tests/assert/assert.spec.ts b/tests/assert/assert.spec.ts index 7a48438..1b25252 100644 --- a/tests/assert/assert.spec.ts +++ b/tests/assert/assert.spec.ts @@ -2023,19 +2023,19 @@ test.describe('assert', function () { expectError(function () { assert.closeTo([1.5] as any, 1.0, 0.5, 'blah') - }, 'blah: expected [ 1.5 ] to be a number') + }, 'blah: expected [ 1.5 ] to be numeric') expectError(function () { assert.closeTo(1.5, '1.0' as any, 0.5, 'blah') - }, 'blah: the arguments to closeTo or approximately must be numbers') + }, "blah: expected '1.0' to be numeric") expectError(function () { assert.closeTo(1.5, 1.0, true as any, 'blah') - }, 'blah: the arguments to closeTo or approximately must be numbers') + }, 'blah: expected true to be numeric') expectError(function () { assert.closeTo(1.5, 1.0, undefined as any, 'blah') - }, 'blah: the arguments to closeTo or approximately must be numbers, and a delta is required') + }, 'blah: A `delta` value is required for `closeTo`') }) test('approximately', function () { @@ -2055,19 +2055,19 @@ test.describe('assert', function () { expectError(function () { assert.approximately([1.5] as any, 1.0, 0.5) - }, 'expected [ 1.5 ] to be a number') + }, 'expected [ 1.5 ] to be numeric') expectError(function () { assert.approximately(1.5, '1.0' as any, 0.5, 'blah') - }, 'blah: the arguments to closeTo or approximately must be numbers') + }, "blah: expected '1.0' to be numeric") expectError(function () { assert.approximately(1.5, 1.0, true as any, 'blah') - }, 'blah: the arguments to closeTo or approximately must be numbers') + }, 'blah: expected true to be numeric') expectError(function () { assert.approximately(1.5, 1.0, undefined as any, 'blah') - }, 'blah: the arguments to closeTo or approximately must be numbers, and a delta is required') + }, 'blah: A `delta` value is required for `closeTo`') }) test('sameMembers', function () {