Skip to content

Commit

Permalink
tests: add tests for valibot
Browse files Browse the repository at this point in the history
  • Loading branch information
chorobin committed Oct 20, 2024
1 parent df6f43c commit 2eb5980
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 34 deletions.
7 changes: 5 additions & 2 deletions examples/react/search-validator-adapters/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"dev": "vite --port=3001",
"build": "vite build && tsc --noEmit",
"serve": "vite preview",
"start": "vite"
"start": "vite",
"test:unit": "vitest"
},
"dependencies": {
"@tanstack/react-query": "^5.59.13",
Expand All @@ -26,6 +27,8 @@
"@types/react": "^18.2.47",
"@types/react-dom": "^18.2.18",
"@vitejs/plugin-react": "^4.3.2",
"vite": "^5.4.8"
"vite": "^5.4.8",
"@testing-library/jest-dom": "^6.5.0",
"@testing-library/react": "^16.0.1"
}
}
6 changes: 3 additions & 3 deletions examples/react/search-validator-adapters/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { RouterProvider, createRouter } from '@tanstack/react-router'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { routeTree } from './routeTree.gen'

const queryClient = new QueryClient()
export const queryClient = new QueryClient()

const router = createRouter({
export const router = createRouter({
routeTree,
context: {
queryClient,
Expand All @@ -19,7 +19,7 @@ declare module '@tanstack/react-router' {
}
}

function App() {
export function App() {
return <RouterProvider router={router} />
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createRootRoute, createRoute, Link } from '@tanstack/react-router'
import { Link } from '@tanstack/react-router'
import { expectTypeOf, test } from 'vitest'
import * as v from 'valibot'

import { router } from '../src/main'
import { Route as ValibotRoute } from '../src/routes/users/valibot.index'

Expand Down
8 changes: 0 additions & 8 deletions examples/react/search-validator-adapters/vite.config.js

This file was deleted.

15 changes: 15 additions & 0 deletions examples/react/search-validator-adapters/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { defineConfig } from 'vitest/config'
import react from '@vitejs/plugin-react'
import { TanStackRouterVite } from '@tanstack/router-plugin/vite'
import packageJson from './package.json'

export default defineConfig({
test: {
name: packageJson.name,
dir: './tests',
watch: false,
environment: 'jsdom',
typecheck: { enabled: true },
},
plugins: [TanStackRouterVite(), react()],
})
44 changes: 25 additions & 19 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2eb5980

Please sign in to comment.