Treat the search endpoint as a fetch when running tests as lucene doesn't exist

This commit is contained in:
Andrew Kingston 2021-09-29 17:36:53 +01:00
parent 908d4b75d8
commit a50d46ba32
1 changed files with 5 additions and 0 deletions

View File

@ -351,6 +351,11 @@ exports.bulkDestroy = async ctx => {
}
exports.search = async ctx => {
// Fetch the whole table when running tests, as search doesn't work
if (env.isTest()) {
return { rows: await exports.fetch(ctx) }
}
const appId = ctx.appId
const { tableId } = ctx.params
const db = new CouchDB(appId)