Skip to content

Commit

Permalink
perf: remove loggers in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
star0202 committed Apr 6, 2023
1 parent 27a5518 commit 2d8d6f7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 23 deletions.
7 changes: 1 addition & 6 deletions tests/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
import { Neis } from '../src'
import { Logger } from 'tslog'

export const logger = new Logger()

export const neis = new Neis({
logger: logger,
})
export const neis = new Neis()
8 changes: 1 addition & 7 deletions tests/meal.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { logger, neis } from '.'
import { neis } from '.'
import type { Meal } from '../src'

describe('Meal', () => {
Expand All @@ -12,8 +12,6 @@ describe('Meal', () => {
data.push(await school.getMealOne({ MLSV_YMD: '20230331' }))
}

logger.info(data)

expect(data).toMatchObject<Meal[]>(data)
})

Expand All @@ -25,8 +23,6 @@ describe('Meal', () => {

const data = await school.getMealOne({ MLSV_YMD: '20230331' })

logger.info(data)

expect(data).toMatchObject<Meal>(data)
})

Expand All @@ -46,8 +42,6 @@ describe('Meal', () => {
origin: meal.getOrigin(),
}

logger.info(data)

expect(data.cal).toBe(901.4)
expect(data.dish).toMatchObject<string[]>(data.dish)
expect(data.dishName).toMatchObject<string[]>(data.dishName)
Expand Down
6 changes: 1 addition & 5 deletions tests/schedule.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { logger, neis } from '.'
import { neis } from '.'
import type { ScheduleInfo } from '../src/types'

describe('Schedule', () => {
Expand All @@ -12,8 +12,6 @@ describe('Schedule', () => {
data.push(await school.getScheduleOne({ AY_YMD: '20230301' }))
}

logger.info(data)

expect(data).toMatchObject<ScheduleInfo[]>(data)
})

Expand All @@ -25,8 +23,6 @@ describe('Schedule', () => {

const data = await school.getScheduleOne({ AY_YMD: '20230301' })

logger.info(data)

expect(data).toMatchObject<ScheduleInfo>(data)
})
})
6 changes: 1 addition & 5 deletions tests/school.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { logger, neis } from '.'
import { neis } from '.'
import type { School } from '../src'

describe('School', () => {
Expand All @@ -7,8 +7,6 @@ describe('School', () => {
ATPT_OFCDC_SC_CODE: 'B10',
})

logger.info(data)

expect(data).toMatchObject<School[]>(data)
})

Expand All @@ -18,8 +16,6 @@ describe('School', () => {
SD_SCHUL_CODE: '7091455',
})

logger.info(data)

expect(data).toMatchObject<School>(data)
})
})

0 comments on commit 2d8d6f7

Please sign in to comment.