1
Fork 0

typescript(option): test: wrote tests for get

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

View file

@ -0,0 +1,22 @@
import { expect } from 'chai'
import { get } from './get'
import { None } from '../types'
import { someX, x } from '../../test/constants'
describe('The get helper', () => {
it('should throw when given None', () => {
// act
const callable = () => get(None)
// assert
expect(callable).to.throw()
})
it('should return the innter value when given Some', () => {
// act
const result = get(someX)
// assert
expect(result).to.equal(x)
})
})