From 78810698947f9d2f607fb29f8fc55b86c080826d Mon Sep 17 00:00:00 2001 From: Richer <32590310+richerfu@users.noreply.github.com> Date: Sun, 13 Oct 2024 13:33:47 +0800 Subject: [PATCH] test: fix some test case (#2301) --- examples/napi/__tests__/strict.spec.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/napi/__tests__/strict.spec.ts b/examples/napi/__tests__/strict.spec.ts index e7c2c239..7dadc692 100644 --- a/examples/napi/__tests__/strict.spec.ts +++ b/examples/napi/__tests__/strict.spec.ts @@ -95,21 +95,21 @@ test('should validate boolean value', (t) => { }) test('should validate date', (t) => { - if (Number(process.versions.napi) >= 5) { + if (Number(process.versions.napi) < 5) { return t.pass() } const fx = new Date('2016-12-24') - t.is(validateDate(new Date()), fx.valueOf()) + t.is(validateDate(fx), fx.valueOf()) t.is(validateDateTime(fx), 1) // @ts-expect-error t.throws(() => validateDate(1), { code: 'InvalidArg', - message: 'Expected a Date value', + message: 'Expected a Date object', }) // @ts-expect-error t.throws(() => validateDateTime(2), { code: 'InvalidArg', - message: 'Expected a Date value', + message: 'Expected a Date object', }) })