Skip to content

Commit

Permalink
isNumber test
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasoppermann committed Apr 19, 2024
1 parent b21bcd4 commit e53ec2f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/filters/isNumber.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import {getMockToken} from '../test-utilities'
import {isNumber} from './isNumber'

describe('Filter: isNumber', () => {
it('returns true if $type property is `number`', () => {
expect(isNumber(getMockToken({$type: 'number'}))).toStrictEqual(true)
})

it('returns false if $type property is not `number`', () => {
expect(isNumber(getMockToken({$type: 'pumpkin'}))).toStrictEqual(false)
})

it('returns false if $type property is falsy', () => {
expect(isNumber(getMockToken({$type: false}))).toStrictEqual(false)
expect(isNumber(getMockToken({$type: undefined}))).toStrictEqual(false)
expect(isNumber(getMockToken({$type: null}))).toStrictEqual(false)
})
})

0 comments on commit e53ec2f

Please sign in to comment.