1
Fork 0

typescript(option): test: wrote tests for isNone

Signed-off-by: prescientmoon <git@moonythm.dev>
This commit is contained in:
Matei Adriel 2019-12-25 15:06:19 +02:00 committed by prescientmoon
parent 941263e82b
commit a649904d4e
Signed by: prescientmoon
SSH key fingerprint: SHA256:UUF9JT2s8Xfyv76b8ZuVL7XrmimH4o49p4b+iexbVH4

View 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)
})
})