2021-06-25 14:46:02 +02:00
|
|
|
module ArangoMock {
|
|
|
|
const arangodb: any = {}
|
|
|
|
|
|
|
|
arangodb.Database = function () {
|
|
|
|
this.query = jest.fn(() => ({
|
|
|
|
all: jest.fn(),
|
|
|
|
}))
|
|
|
|
this.collection = jest.fn(() => "collection")
|
|
|
|
this.close = jest.fn()
|
|
|
|
}
|
|
|
|
|
2022-01-20 09:17:08 +01:00
|
|
|
// @ts-ignore
|
2021-06-25 14:46:02 +02:00
|
|
|
arangodb.aql = (strings, ...args) => {
|
|
|
|
let str = strings.join("{}")
|
|
|
|
|
|
|
|
for (let arg of args) {
|
|
|
|
str = str.replace("{}", arg)
|
|
|
|
}
|
|
|
|
|
|
|
|
return str
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = arangodb
|
|
|
|
}
|