Skip to content

Commit

Permalink
mock env properly; change log,error to trace
Browse files Browse the repository at this point in the history
  • Loading branch information
NewBieCoderXD committed Aug 22, 2024
1 parent fb065b8 commit 3ec01fd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/scraper/determineYearAndSemester.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export async function determineYearAndSemester($: cheerio.Root): Promise<void> {
const currentYearAndSemester = $('h2').first().text()
const split = /(\d+)\/(\d+)/.exec(currentYearAndSemester)
if (split == undefined) {
console.log('error cannot parse year and semester: ', split)
console.trace('error cannot parse year and semester: ', split)
return
}
const [_beforeSplit, currentYear, currentSemester] = split
Expand Down
2 changes: 1 addition & 1 deletion src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ client.on('interactionCreate', async (interaction: Interaction) => {
await interaction.reply('command not found')
}
} catch (e) {
console.error('error occured', e)
console.trace('error occured', e)
if (e instanceof Error) {
adminDM.send('error: ' + (e as Error).stack)
} else {
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/updateHandler.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { adminDM, client } from '@/server'
import updateHandler from '@/utils/updateHandler'
import { DiscordAPIError } from 'discord.js'

jest.mock("@/env/env");
jest.mock("@/env/env", ()=>{});
jest.mock('@/server', () => {
return {
client: {
Expand Down

0 comments on commit 3ec01fd

Please sign in to comment.