mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2025-07-28 20:00:10 +02:00

* [docstore] DocManager.getDocLines returns flat content * [docstore] peekDoc throws NotFoundError, skip check in HttpController * [docstore] getFullDoc throws NotFoundError, skip check in HttpController * [docstore] migrate HealthChecker to async/await * [docstore] migrate HttpController to async/await * [docstore] remove .promises/callbackify wrapper from all the modules GitOrigin-RevId: a9938b03cdd2b5e80c2c999039e8f63b20d59dc5
28 lines
786 B
JavaScript
28 lines
786 B
JavaScript
const { db } = require('../../../app/js/mongodb')
|
|
const DocstoreApp = require('./helpers/DocstoreApp')
|
|
const DocstoreClient = require('./helpers/DocstoreClient')
|
|
const { expect } = require('chai')
|
|
|
|
describe('HealthChecker', function () {
|
|
beforeEach('start', function (done) {
|
|
DocstoreApp.ensureRunning(done)
|
|
})
|
|
beforeEach('clear docs collection', async function () {
|
|
await db.docs.deleteMany({})
|
|
})
|
|
let res
|
|
beforeEach('run health check', function (done) {
|
|
DocstoreClient.healthCheck((err, _res) => {
|
|
res = _res
|
|
done(err)
|
|
})
|
|
})
|
|
|
|
it('should return 200', function () {
|
|
res.statusCode.should.equal(200)
|
|
})
|
|
|
|
it('should not leave any cruft behind', async function () {
|
|
expect(await db.docs.find({}).toArray()).to.deep.equal([])
|
|
})
|
|
})
|