diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 39b13b28..bb41213c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -29,6 +29,10 @@ jobs: - name: Check types run: bun run check:typescript + - name: Check test types + run: bun run check:typescript:test + working-directory: packages/uniwind + - name: Check linting run: bun run lint diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 502fe499..b2b8965e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -67,6 +67,10 @@ jobs: - name: Check types run: bun run check:typescript + - name: Check test types + run: bun run check:typescript:test + working-directory: packages/uniwind + - name: Check linting and formatting run: bun run lint diff --git a/packages/uniwind/package.json b/packages/uniwind/package.json index 7c8d529b..ec2f8a9e 100644 --- a/packages/uniwind/package.json +++ b/packages/uniwind/package.json @@ -15,6 +15,7 @@ "precommit": "bun lint", "build": "unbuild", "check:typescript": "tsc --noEmit", + "check:typescript:test": "tsc --project tsconfig.test.json --noEmit", "lint": "oxlint src", "lint:fix": "oxlint src --fix", "format": "dprint fmt", diff --git a/packages/uniwind/tests/e2e/getWebStyles.test.ts b/packages/uniwind/tests/e2e/getWebStyles.test.ts index 6758945c..cac0703e 100644 --- a/packages/uniwind/tests/e2e/getWebStyles.test.ts +++ b/packages/uniwind/tests/e2e/getWebStyles.test.ts @@ -18,10 +18,10 @@ async function getWebStyles( context: UniwindContextType = { scopedTheme: null, rtl: null, variables: null }, ) { return page.evaluate( - ([cls, ctx]) => { - return window.__uniwind.getWebStyles(cls, undefined, ctx) + ({ className, context }) => { + return window.__uniwind.getWebStyles(className, undefined, context) }, - [className, context], + { className, context }, ) } diff --git a/packages/uniwind/tests/native/utils.ts b/packages/uniwind/tests/native/utils.ts index 97de0fbd..e6f05ae5 100644 --- a/packages/uniwind/tests/native/utils.ts +++ b/packages/uniwind/tests/native/utils.ts @@ -1,7 +1,7 @@ import { render } from '@testing-library/react-native' import * as React from 'react' import { StyleSheet } from 'react-native' -import type { RNStyle } from '../../../src/core/types' +import type { RNStyle } from '../../src/core/types' export const renderUniwind = (component: React.ReactElement) => { const renderResult = render(component) diff --git a/packages/uniwind/tsconfig.test.json b/packages/uniwind/tsconfig.test.json index 09f8de9d..1a95aad1 100644 --- a/packages/uniwind/tsconfig.test.json +++ b/packages/uniwind/tsconfig.test.json @@ -3,11 +3,16 @@ "compilerOptions": { "jsx": "react-jsx", "esModuleInterop": true, - "allowSyntheticDefaultImports": true + "allowSyntheticDefaultImports": true, + "noUncheckedIndexedAccess": false, + "rootDir": "." }, "include": [ "./src", "./types.d.ts", "./tests" + ], + "exclude": [ + "./tests/type-test" ] } diff --git a/turbo.json b/turbo.json index 0b72bbe9..1d51694e 100644 --- a/turbo.json +++ b/turbo.json @@ -10,6 +10,7 @@ "interactive": true }, "check:typescript": {}, + "uniwind#check:typescript:test": {}, "lint": {}, "//#check:format": {}, "circular:check": {}, @@ -17,6 +18,7 @@ "dependsOn": [ "lint", "check:typescript", + "uniwind#check:typescript:test", "circular:check", "test:native", "test:web",