1
Fork 0

typescript(option): test: wrote tests for isSome

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

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