1
0
Fork 0
mirror of synced 2024-07-04 05:50:57 +12:00
budibase/packages/server/__mocks__/arangojs.js

22 lines
366 B
JavaScript
Raw Normal View History

2021-03-17 02:54:39 +13:00
const arangodb = {}
2021-05-03 19:31:09 +12:00
arangodb.Database = function () {
2021-03-17 02:54:39 +13:00
this.query = jest.fn(() => ({
all: jest.fn(),
}))
this.collection = jest.fn(() => "collection")
this.close = jest.fn()
}
arangodb.aql = (strings, ...args) => {
let str = strings.join("{}")
for (let arg of args) {
str = str.replace("{}", arg)
}
return str
}
module.exports = arangodb