1
0
Fork 0
mirror of synced 2024-06-26 10:00:41 +12:00
budibase/packages/server/__mocks__/arangojs.ts
2022-01-20 09:17:08 +01:00

25 lines
441 B
TypeScript

module ArangoMock {
const arangodb: any = {}
arangodb.Database = function () {
this.query = jest.fn(() => ({
all: jest.fn(),
}))
this.collection = jest.fn(() => "collection")
this.close = jest.fn()
}
// @ts-ignore
arangodb.aql = (strings, ...args) => {
let str = strings.join("{}")
for (let arg of args) {
str = str.replace("{}", arg)
}
return str
}
module.exports = arangodb
}