1
0
Fork 0
mirror of synced 2024-06-02 10:34:40 +12:00
budibase/packages/server/src/integrations/tests/s3.spec.ts

29 lines
628 B
TypeScript

const AWS = require("aws-sdk")
import { default as S3Integration } from "../s3"
jest.mock("aws-sdk")
class TestConfiguration {
integration: any
constructor(config: any = {}) {
this.integration = new S3Integration.integration(config)
}
}
describe("S3 Integration", () => {
let config: any
beforeEach(() => {
config = new TestConfiguration()
})
it("calls the read method with the correct params", async () => {
const response = await config.integration.read({
bucket: "test",
})
expect(config.integration.client.listObjects).toHaveBeenCalledWith({
Bucket: "test",
})
})
})