test: write test codes with gh workflow

This commit is contained in:
Starcea 2024-08-10 17:08:53 +09:00
commit ce0ca5988e
No known key found for this signature in database
GPG key ID: B7A77E32374911E1
7 changed files with 56 additions and 5 deletions

15
tests/Timetable.test.ts Normal file
View file

@ -0,0 +1,15 @@
import assert from 'node:assert'
import test from 'node:test'
import { comcigan } from '.'
test('Get timetable by code', async () => {
const schools = await comcigan.searchSchools('중학교')
const timetable = await comcigan.getTimetable(schools[0].code)
assert(timetable)
})
test('Get timetable by school', async () => {
const schools = await comcigan.searchSchools('중학교')
const timetable = await schools[0].getTimetable()
assert(timetable)
})