diff --git a/ava.config.js b/ava.config.mjs similarity index 100% rename from ava.config.js rename to ava.config.mjs diff --git a/examples/napi-compat-mode/__test__/object.spec.ts.snap b/examples/napi-compat-mode/__test__/object.spec.ts.snap index e16ea220..bfbba2af 100644 Binary files a/examples/napi-compat-mode/__test__/object.spec.ts.snap and b/examples/napi-compat-mode/__test__/object.spec.ts.snap differ diff --git a/examples/napi-compat-mode/__test__/serde/ser.spec.ts.snap b/examples/napi-compat-mode/__test__/serde/ser.spec.ts.snap index 66afca61..85e3135b 100644 Binary files a/examples/napi-compat-mode/__test__/serde/ser.spec.ts.snap and b/examples/napi-compat-mode/__test__/serde/ser.spec.ts.snap differ diff --git a/examples/napi-compat-mode/__test__/string.spec.ts.snap b/examples/napi-compat-mode/__test__/string.spec.ts.snap index 1bb78848..37ff3527 100644 Binary files a/examples/napi-compat-mode/__test__/string.spec.ts.snap and b/examples/napi-compat-mode/__test__/string.spec.ts.snap differ diff --git a/examples/napi-compat-mode/__test__/throw.spec.ts b/examples/napi-compat-mode/__test__/throw.spec.ts index 9a0f97b3..4ecf601e 100644 --- a/examples/napi-compat-mode/__test__/throw.spec.ts +++ b/examples/napi-compat-mode/__test__/throw.spec.ts @@ -8,7 +8,7 @@ test('should be able to throw error from native', (t) => { test('should be able to throw error from native with reason', (t) => { const reason = 'Fatal' - t.throws(() => bindings.testThrowWithReason(reason), null, reason) + t.throws(() => bindings.testThrowWithReason(reason), void 0, reason) }) test('should throw if argument type is not match', (t) => { diff --git a/examples/napi/__test__/typegen.spec.ts.snap b/examples/napi/__test__/typegen.spec.ts.snap index fbdb529d..1730c624 100644 Binary files a/examples/napi/__test__/typegen.spec.ts.snap and b/examples/napi/__test__/typegen.spec.ts.snap differ diff --git a/examples/napi/__test__/values.spec.ts b/examples/napi/__test__/values.spec.ts index c0a010fc..2745b850 100644 --- a/examples/napi/__test__/values.spec.ts +++ b/examples/napi/__test__/values.spec.ts @@ -85,7 +85,7 @@ test('number', (t) => { t.throws( // @ts-expect-error () => fibonacci(''), - null, + void 0, 'Expect value to be Number, but received String', ) }) @@ -154,7 +154,7 @@ test('class factory', (t) => { const error = t.throws(() => new ClassWithFactory()) t.true( - error.message.startsWith( + error!.message.startsWith( 'Class contains no `constructor`, can not new it!', ), ) @@ -178,7 +178,7 @@ test('callback', (t) => { t.throws( // @ts-expect-error () => getCwd(), - null, + void 0, 'Expect value to be Function, but received Undefined', ) @@ -233,7 +233,7 @@ test('Option', (t) => { }) test('Result', (t) => { - t.throws(() => throwError(), null, 'Manual Error') + t.throws(() => throwError(), void 0, 'Manual Error') }) test('function ts type override', (t) => { @@ -337,7 +337,10 @@ test('external', (t) => { const ext2 = createExternalString('wtf') // @ts-expect-error const e = t.throws(() => getExternal(ext2)) - t.is(e.message, 'T on `get_value_external` is not the type of wrapped object') + t.is( + e!.message, + 'T on `get_value_external` is not the type of wrapped object', + ) }) const AbortSignalTest = @@ -417,7 +420,7 @@ Napi4Test('throw error from thread safe function', async (t) => { threadsafeFunctionThrowError(reject) }) const err = await t.throwsAsync(throwPromise) - t.is(err.message, 'ThrowFromNative') + t.is(err!.message, 'ThrowFromNative') }) Napi4Test('resolve value from thread safe function fatal mode', async (t) => { diff --git a/examples/napi/__test__/values.spec.ts.snap b/examples/napi/__test__/values.spec.ts.snap index f5678bc0..0575b65e 100644 Binary files a/examples/napi/__test__/values.spec.ts.snap and b/examples/napi/__test__/values.spec.ts.snap differ