Remove uses of console in tests.
This commit is contained in:
parent
89ebd1d017
commit
ae0eda21a5
|
@ -12,15 +12,6 @@ class TestConfiguration {
|
|||
}
|
||||
}
|
||||
|
||||
function disableConsole() {
|
||||
jest.spyOn(console, "error")
|
||||
// @ts-ignore
|
||||
console.error.mockImplementation(() => {})
|
||||
|
||||
// @ts-ignore
|
||||
return console.error.mockRestore
|
||||
}
|
||||
|
||||
describe("MongoDB Integration", () => {
|
||||
let config: any
|
||||
let indexName = "Users"
|
||||
|
@ -96,8 +87,6 @@ describe("MongoDB Integration", () => {
|
|||
})
|
||||
|
||||
it("throws an error when an invalid query.extra.actionType is passed for each method", async () => {
|
||||
const restore = disableConsole()
|
||||
|
||||
const query = {
|
||||
extra: { collection: "testCollection", actionType: "deleteOne" },
|
||||
}
|
||||
|
@ -109,7 +98,6 @@ describe("MongoDB Integration", () => {
|
|||
error = err
|
||||
}
|
||||
expect(error).toBeDefined()
|
||||
restore()
|
||||
})
|
||||
|
||||
it("creates ObjectIds if the field contains a match on ObjectId", async () => {
|
||||
|
|
|
@ -81,9 +81,6 @@ describe("migrations", () => {
|
|||
expect(events.screen.created).toBeCalledTimes(2)
|
||||
expect(events.backfill.appSucceeded).toBeCalledTimes(2)
|
||||
|
||||
const processor = events.processors.analyticsProcessor.processEvent
|
||||
console.log(processor)
|
||||
|
||||
// to make sure caching is working as expected
|
||||
expect(
|
||||
events.processors.analyticsProcessor.processEvent
|
||||
|
|
|
@ -43,7 +43,6 @@ describe("/api/global/email", () => {
|
|||
}
|
||||
expect(res.body.message).toBeDefined()
|
||||
const testUrl = nodemailer.getTestMessageUrl(res.body)
|
||||
console.log(`${purpose} URL: ${testUrl}`)
|
||||
expect(testUrl).toBeDefined()
|
||||
response = await fetch(testUrl)
|
||||
text = await response.text()
|
||||
|
|
Loading…
Reference in New Issue