Skip to content

Commit

Permalink
test: update test file according to updated dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
jojoee committed Sep 13, 2024
1 parent 2f16e10 commit a317210
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/index.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
const {
test,
expect,
describe
} = require('@jest/globals')
const {
bahttext,
bahtxtGrammarFix: grammarFix,
Expand All @@ -9,6 +14,8 @@ const googleSheetTestCases = require('../misc/testcases.json').map(item => {
item[groupedTestCasesKey] = `${item.category}-${item.case}`
return item
})

/* eslint-disable-next-line no-undef */
jest.autoMockOff()

// TODO: move to somewhere else
Expand Down Expand Up @@ -110,9 +117,8 @@ describe('bahttext', () => {
for (const [groupedName, testCases] of Object.entries(groupedTestCases)) {
test(`imported Google Sheets: ${groupedName}`, () => {
for (let i = 0; i < testCases.length; i++) {
const customMessage = JSON.stringify(testCases[i])
const number = Number(testCases[i].number)
expect(bahttext(number), customMessage).toBe(testCases[i].text)
expect(bahttext(number)).toBe(testCases[i].text)
}
})
}
Expand Down

0 comments on commit a317210

Please sign in to comment.