Skip to content

Commit 6c0ceba

Browse files
committed
type test
1 parent d50c1fb commit 6c0ceba

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

index.test-d.ts

+10
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
ConfigurationError,
1818
ResponseError,
1919
FileError,
20+
ApiError,
2021
} from './index';
2122
import {
2223
APIGatewayProxyEvent,
@@ -255,3 +256,12 @@ const fileError = new FileError('File not found', {
255256
syscall: 'open',
256257
});
257258
expectType<FileError>(fileError);
259+
expectType<string>(fileError.message);
260+
expectType<string>(fileError.name);
261+
expectType<string | undefined>(fileError.stack);
262+
263+
const apiError = new ApiError('Api error', 500);
264+
expectType<ApiError>(apiError);
265+
expectType<string>(apiError.message);
266+
expectType<number | undefined>(apiError.code);
267+
expectType<any>(apiError.detail);

0 commit comments

Comments
 (0)