Skip to content

Commit 61b9e2d

Browse files
authored
[ez][drci] Remove unused mock in test (#7079)
Realized this mock doesn't matter since we use `@aws-sdk/client-s3` not `aws-sdk` Some answers from chatgpt about mocking so I don't forget: `spyOn().mockImplementation` good for mocking single function in a file (also seems to be stricter typed) `jest.mock('./s3-wrapper/path/to/import')` + `(getS3Client as jest.Mock).mockImplementation(() => mockS3);` good for mocking entire file After jest29 (?) `mocked(func)` is basically the same as `(func as jest.Mock)` but with better typing?
1 parent c1eb200 commit 61b9e2d

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

torchci/test/drciBot.test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ describe("verify-drci-functionality", () => {
3030
const mockS3 = {
3131
send: jest.fn(),
3232
};
33-
jest.mock("aws-sdk", () => ({
34-
S3: jest.fn().mockImplementation(() => mockS3),
35-
}));
3633
const mockS3Client = jest.spyOn(getS3Client, "getS3Client");
3734
mockS3Client.mockImplementation(() => mockS3 as unknown as S3Client);
3835
});

0 commit comments

Comments
 (0)