Skip to content

Commit

Permalink
separate typecheck from runtime testing (#3647)
Browse files Browse the repository at this point in the history
* separate typecheck from runtime testing

* Fix tests

* Fix typechecking

* Remove failures

* Test on latest and next TS only

---------

Co-authored-by: Misha Kaletsky <[email protected]>
Co-authored-by: Colin McDonnell <[email protected]>
  • Loading branch information
3 people authored Jul 18, 2024
1 parent c6bb75f commit 957da06
Show file tree
Hide file tree
Showing 9 changed files with 156 additions and 226 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
matrix:
node: ["latest"]
typescript: ["5.0", "next"]
typescript: ["latest", "next"]
name: Test with TypeScript ${{ matrix.typescript }} on Node ${{ matrix.node }}
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 2 additions & 0 deletions experiments/oops.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// @ts-nocheck

// a less object-oriented approach

interface ZodDef {
Expand Down
2 changes: 2 additions & 0 deletions experiments/replacer.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// @ts-nocheck

import type { z } from "../packages/zod/src/index";

type Tagged = z.ZodType & { _tag: string };
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"tslib": "^2.3.1",
"tsx": "^4.15.4",
"typescript": "5.5.3",
"vitest": "^1.6.0"
"vitest": "2.0.3"
},
"lint-staged": {
"src/*.ts": ["biome format --write", "biome lint --apply"],
Expand Down
3 changes: 3 additions & 0 deletions packages/zod/tests/types.test-d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { z } from "../src/index";

z;
4 changes: 2 additions & 2 deletions packages/zod/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineConfig, mergeConfig } from "vitest/config";
import { defineProject, mergeConfig } from "vitest/config";
import rootConfig from "../../vitest.root";

export default mergeConfig(rootConfig, defineConfig({})) as object;
export default mergeConfig(rootConfig, defineProject({})) as object;
359 changes: 142 additions & 217 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions vitest.root.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ import { type UserConfig, defineConfig } from "vitest/config";

export default defineConfig({
test: {
include: ["**/*.test.ts"],
isolate: false,
watch: false,
isolate: false,
typecheck: {
enabled: true,
ignoreSourceErrors: true,
include: ["**/*.test.ts"],
ignoreSourceErrors: false,
},
},
}) as UserConfig;
2 changes: 1 addition & 1 deletion vitest.workspace.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default ["packages/*"] as [string];
export default ["packages/*"] as string[];

0 comments on commit 957da06

Please sign in to comment.