budibase/packages/server/__mocks__/arangojs.ts

26 lines
503 B
TypeScript
Raw Normal View History

2024-03-20 12:46:39 +01:00
// eslint-disable-next-line @typescript-eslint/no-unused-vars
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
}