1
0
Fork 0
mirror of synced 2024-07-08 15:56:23 +12:00
budibase/packages/server/__mocks__/aws-sdk.js
Martin McKeaveney 6ba84b420c dynamoDB tests
2021-03-15 19:45:39 +00:00

38 lines
617 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({
foo: {},
})
)
}
aws.DynamoDB = { DocumentClient }
aws.config = { update: jest.fn() }
module.exports = aws