typescript(option): test: wrote tests for isSome
Signed-off-by: prescientmoon <git@moonythm.dev>
This commit is contained in:
parent
a649904d4e
commit
aade2d23d7
22
typescript/option/src/helpers/isSome.test.ts
Normal file
22
typescript/option/src/helpers/isSome.test.ts
Normal file
|
@ -0,0 +1,22 @@
|
|||
import { expect } from 'chai'
|
||||
import { None } from '../types'
|
||||
import { someX } from '../../test/constants'
|
||||
import { isSome } from './isSome'
|
||||
|
||||
describe('The isSome helper', () => {
|
||||
it('should return true when given Some', () => {
|
||||
// act
|
||||
const result = isSome(someX)
|
||||
|
||||
// assert
|
||||
expect(result).to.equal(true)
|
||||
})
|
||||
|
||||
it('should return false when given None', () => {
|
||||
// act
|
||||
const result = isSome(None)
|
||||
|
||||
// assert
|
||||
expect(result).to.equal(false)
|
||||
})
|
||||
})
|
Loading…
Reference in a new issue