Files
overleaf-cep/services/docstore/test/acceptance/js/HealthCheckerTest.js
Andrew Rumble a1f1ca2028 Merge pull request #29948 from overleaf/ar/docstore-conversion-to-esm
[docstore] conversion to esm

GitOrigin-RevId: 9d255047bd7ae25f2b0b38f3a721741e8a0b7ad8
2025-12-03 09:05:42 +00:00

28 lines
759 B
JavaScript

import mongodb from '../../../app/js/mongodb.js'
import DocstoreApp from './helpers/DocstoreApp.js'
import DocstoreClient from './helpers/DocstoreClient.js'
import { expect } from 'chai'
const { db } = mongodb
describe('HealthChecker', function () {
beforeEach('start', async function () {
await DocstoreApp.ensureRunning()
})
beforeEach('clear docs collection', async function () {
await db.docs.deleteMany({})
})
let res
beforeEach('run health check', async function () {
res = await DocstoreClient.healthCheck()
})
it('should return 200', function () {
res.status.should.equal(200)
})
it('should not leave any cruft behind', async function () {
expect(await db.docs.find({}).toArray()).to.deep.equal([])
})
})