Skip to content

Commit 3f61c8e

Browse files
committed
04/01: add custom matcher solution
1 parent e929301 commit 3f61c8e

22 files changed

+472
-798
lines changed

β€Žexercises/04.assertions/01.solution.custom-matchers/index.htmlβ€Ž

Lines changed: 0 additions & 15 deletions
This file was deleted.

β€Žexercises/04.assertions/01.solution.custom-matchers/package.jsonβ€Ž

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,14 @@
22
"type": "module",
33
"name": "exercises_04.assertions_01.solution.custom-matchers",
44
"scripts": {
5-
"dev": "vite",
6-
"test": "vitest",
7-
"build": "vite build"
8-
},
9-
"dependencies": {
10-
"react": "^19.0.0",
11-
"react-dom": "^19.0.0"
5+
"test": "vitest"
126
},
137
"devDependencies": {
14-
"@tailwindcss/vite": "^4.0.7",
15-
"@types/react": "^19.0.6",
16-
"@types/react-dom": "^19.0.3",
17-
"@vitejs/plugin-react": "^4.3.4",
18-
"@vitest/browser": "^3.0.5",
19-
"tailwindcss": "^4.0.7",
8+
"@types/node": "^22.13.10",
209
"vite": "^6.0.7",
21-
"vitest": "^3.0.5",
22-
"vitest-browser-react": "^0.0.4"
10+
"vitest": "^3.0.5"
11+
},
12+
"dependencies": {
13+
"zod": "^3.24.2"
2314
}
2415
}

β€Žexercises/04.assertions/01.solution.custom-matchers/public/vite.svgβ€Ž

Lines changed: 0 additions & 1 deletion
This file was deleted.

β€Žexercises/04.assertions/01.solution.custom-matchers/src/app.tsxβ€Ž

Lines changed: 0 additions & 38 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import type { User } from './schemas'
2+
3+
/**
4+
* Returns the user with the given ID.
5+
*/
6+
export async function fetchUser(id: string): Promise<User> {
7+
return {
8+
id,
9+
name: 'John Maverick',
10+
}
11+
}

β€Žexercises/04.assertions/01.solution.custom-matchers/src/file-preview.test.tsxβ€Ž

Lines changed: 0 additions & 9 deletions
This file was deleted.

β€Žexercises/04.assertions/01.solution.custom-matchers/src/file-preview.tsxβ€Ž

Lines changed: 0 additions & 20 deletions
This file was deleted.

β€Žexercises/04.assertions/01.solution.custom-matchers/src/index.cssβ€Ž

Lines changed: 0 additions & 13 deletions
This file was deleted.

β€Žexercises/04.assertions/01.solution.custom-matchers/src/main.tsxβ€Ž

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import z from 'zod'
2+
3+
export const userSchema = z.object({
4+
id: z.string(),
5+
name: z.string(),
6+
})
7+
8+
export type User = z.infer<typeof userSchema>

0 commit comments

Comments
Β (0)