Skip to content

Commit e811a43

Browse files
committed
chore: add extra property to test
1 parent d6a82d5 commit e811a43

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/smithy-client/src/exceptions.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,23 @@ it("ServiceException extends from Error", () => {
1313

1414
it("ExceptionOptionType allows specifying message", () => {
1515
class SomeException extends ServiceException {
16+
readonly code: string;
1617
constructor(opts: ExceptionOptionType<SomeException, ServiceException>) {
1718
super({
1819
name: "SomeException",
1920
$fault: "client",
2021
...opts,
2122
});
23+
this.code = opts.code;
2224
}
2325
}
2426
const exception = new SomeException({
2527
message: "message",
28+
code: "code",
2629
$metadata: {},
2730
});
2831
expect(exception.message).toBe("message");
32+
expect(exception.code).toBe("code");
2933
});
3034

3135
describe("decorateServiceException", () => {

0 commit comments

Comments
 (0)