From aea62204b6ffd8a23b8bbf3f78d14c03c57b4d6d Mon Sep 17 00:00:00 2001 From: Teemu Taskula Date: Tue, 1 Nov 2022 10:40:01 +0200 Subject: [PATCH] Fix test type issue --- src/tests/index.test.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/tests/index.test.tsx b/src/tests/index.test.tsx index f274d21..9532b51 100644 --- a/src/tests/index.test.tsx +++ b/src/tests/index.test.tsx @@ -1,6 +1,10 @@ import React from 'react'; import { render } from '@testing-library/react-native'; -import { createStitches } from '../internals'; +import { createStitches as _createStitches } from '../internals'; +import type { CreateStitches } from '../types'; + +// NOTE: the JSDoc types from the internal `createStitches` are not working properly +const createStitches = _createStitches as CreateStitches; describe('Basic', () => { it('Functionality of styled()', () => { @@ -15,8 +19,8 @@ describe('Basic', () => { const { toJSON } = render(); const result = toJSON(); - expect(result.type).toEqual('View'); - expect(result.props.style[0]).toMatchObject({ + expect(result?.type).toEqual('View'); + expect(result?.props.style[0]).toMatchObject({ backgroundColor: 'red', height: 100, width: 100,