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();