Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

separate typecheck from runtime testing #3647

Merged
merged 5 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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[];