Skip to content

Commit

Permalink
fix: small change to remove uneccessary code from tests (#41)
Browse files Browse the repository at this point in the history
* fix: small change to remove uneccessary code from tests

* fix: linting fix
  • Loading branch information
April-Bates-Dev authored Aug 25, 2023
1 parent 1bd4f52 commit f624de7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,8 @@ const { mockFrom } = vi.hoisted(() => ({
mockFrom: vi.fn(),
}));

vi.mock("@aws-sdk/lib-dynamodb", async () => {
const actualModule = await vi.importActual<object>("@aws-sdk/lib-dynamodb");

vi.mock("@aws-sdk/lib-dynamodb", () => {
return {
...actualModule,
DynamoDBDocumentClient: vi.fn().mockReturnValue({
from: mockFrom,
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@ mockPublish.mockReturnValue({
eventId: "mockEventId",
});

vi.mock("src/classes/Event", async () => {
const actualModule = await vi.importActual<object>("src/classes/Event");

vi.mock("src/classes/Event", () => {
return {
...actualModule,
Event: vi.fn().mockReturnValue({
publish: mockPublish,
}),
Expand Down
7 changes: 1 addition & 6 deletions src/classes/__tests__/Event.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,8 @@ const { mockSend } = vi.hoisted(() => ({
mockSend: vi.fn(),
}));

vi.mock("@aws-sdk/client-eventbridge", async () => {
const actualModule = await vi.importActual<object>(
"@aws-sdk/client-eventbridge",
);

vi.mock("@aws-sdk/client-eventbridge", () => {
return {
...actualModule,
EventBridgeClient: vi.fn().mockReturnValue({
send: mockSend,
}),
Expand Down

0 comments on commit f624de7

Please sign in to comment.