2021-03-16 08:45:39 +13:00
|
|
|
const aws = {}
|
|
|
|
|
2021-05-03 19:31:09 +12:00
|
|
|
const response = (body) => () => ({ promise: () => body })
|
2021-03-16 08:45:39 +13:00
|
|
|
|
|
|
|
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({
|
2021-03-17 02:54:39 +13:00
|
|
|
Contents: {},
|
2021-03-16 08:45:39 +13:00
|
|
|
})
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
aws.DynamoDB = { DocumentClient }
|
2021-03-17 02:54:39 +13:00
|
|
|
aws.S3 = S3
|
2021-03-16 08:45:39 +13:00
|
|
|
aws.config = { update: jest.fn() }
|
|
|
|
|
|
|
|
module.exports = aws
|