code-chronicles-code / code-chronicles-code/leetcode-curriculum

Add tests for `numericIdZodType` utility

Aperta
#334 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
good first issue tests
Lingua principale
TypeScript
Stelle
20
Fork
12
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

[Zod](https://zod.dev/) is a library for validating and parsing data. `numericIdZodType` is a utility we use to validate and parse numeric IDs, it accepts positive integers or the string representation of a positive integer.

This issue involves adding a file `workspaces/util/src/__tests__/numericIdZodType-test.ts`, for testing the `numericIdZodType` utility. Specifically, we care about testing the `parse` function, so stuff like:

```ts
expect(numericIdZodType.parse(123)).toBe(123);
expect(() => numericIdZodType.parse(-123)).toThrow(/* some error */);
```

To see some PRs that add tests, take a look at #288 and #290 for inspiration.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.