1
0
Fork 0
mirror of synced 2024-06-01 10:09:48 +12:00

Remove uses of console in tests.

This commit is contained in:
Sam Rose 2024-03-18 13:43:43 +00:00
parent 89ebd1d017
commit ae0eda21a5
No known key found for this signature in database
3 changed files with 0 additions and 16 deletions

View file

@ -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 () => {

View file

@ -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

View file

@ -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()