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