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