From 157d1c3ddca0d94698f7d5598cc777b7823a5095 Mon Sep 17 00:00:00 2001 From: Brian Grinstead Date: Sat, 25 Aug 2018 07:47:58 -0700 Subject: [PATCH] WIP add test for function --- test/index.spec.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/index.spec.ts b/test/index.spec.ts index 3ae4118..0203044 100644 --- a/test/index.spec.ts +++ b/test/index.spec.ts @@ -1,4 +1,5 @@ import TinyColor from '../src/public_api'; +import TinyColorDist from '../dist/public_api'; const { fromRatio, @@ -27,6 +28,12 @@ describe('TinyColor', () => { expect(r.toName()).toBe('red'); expect(r).toBeTruthy(); }); + it('should init with function', () => { + const r = TinyColorDist('red'); + expect(r).toBeInstanceOf(TinyColorDist); + expect(r.toName()).toBe('red'); + expect(r).toBeTruthy(); + }); it('should clone', () => { const color1 = new TinyColor('red'); const color2 = new TinyColor('red').clone();