1
0
Fork 0
mirror of synced 2024-07-01 12:30:41 +12:00
budibase/packages/server/__mocks__/aws-sdk.js
Keviin Åberg Kultalahti 4ec2e7d01f lint:fix
2021-05-03 09:31:09 +02:00

39 lines
636 B
JavaScript

const aws = {}
const response = (body) => () => ({ promise: () => body })
function DocumentClient() {
this.put = jest.fn(response({}))
this.query = jest.fn(
response({
Items: [],
})
)
this.scan = jest.fn(
response({
Items: [
{
Name: "test",
},
],
})
)
this.get = jest.fn(response({}))
this.update = jest.fn(response({}))
this.delete = jest.fn(response({}))
}
function S3() {
this.listObjects = jest.fn(
response({
Contents: {},
})
)
}
aws.DynamoDB = { DocumentClient }
aws.S3 = S3
aws.config = { update: jest.fn() }
module.exports = aws