From aade2d23d712b5fc7cd33c099b01d81ab4c4fe1a Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Wed, 25 Dec 2019 15:07:04 +0200 Subject: [PATCH] typescript(option): test: wrote tests for isSome Signed-off-by: prescientmoon --- typescript/option/src/helpers/isSome.test.ts | 22 ++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 typescript/option/src/helpers/isSome.test.ts diff --git a/typescript/option/src/helpers/isSome.test.ts b/typescript/option/src/helpers/isSome.test.ts new file mode 100644 index 0000000..b1f2361 --- /dev/null +++ b/typescript/option/src/helpers/isSome.test.ts @@ -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) + }) +})