Skip to content

Commit

Permalink
chore: update tests types
Browse files Browse the repository at this point in the history
  • Loading branch information
believer committed Nov 10, 2023
1 parent 22528fc commit ddd7c63
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions lib/__tests__/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@ import { describe, expect, test } from 'bun:test'
import { allBanks, bankName, clearingNumbers } from '../index'

describe('#bankName', () => {
test('handles undefined', () => {
// @ts-expect-error Testing invalid input
expect(bankName()).toEqual('')
})

test.each([
[undefined, ''],
['', ''],
[0, ''],
[52, ''],
Expand Down Expand Up @@ -77,12 +81,9 @@ describe('#bankName', () => {
['VP Securities A/S', 9956, 9956],
['Ålandsbanken', 2300, 2399],
])('%s (%s-%s)', (bank, min, max) => {
return new Array(1 + max - min)
.fill(0)
.map((_, i) => min + i)
.forEach((value) => {
expect(bankName(value)).toEqual(bank)
})
for (let i = min; i <= max; i++) {
expect(bankName(i)).toEqual(bank)
}
})

test.each([
Expand Down Expand Up @@ -117,6 +118,7 @@ describe('#bankName', () => {

describe('#clearingNumbers', () => {
test('handles undefined', () => {
// @ts-expect-error Testing invalid input
expect(clearingNumbers()).toEqual([])
})

Expand Down

0 comments on commit ddd7c63

Please sign in to comment.