Skip to content

Commit

Permalink
Merge branch 'main' into add-fp-ts
Browse files Browse the repository at this point in the history
  • Loading branch information
gunzip authored Feb 8, 2024
2 parents 29aa46c + afb9720 commit 786fa7b
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
12 changes: 12 additions & 0 deletions radar/tools/jest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: "Jest"
ring: hold
quadrant: "tools"
tags: [typescript, frontend, web, backend, testing]
---

[Jest](https://jestjs.io/) is a JavaScript Testing Framework with a focus on simplicity.

We choose to hold Jest because we are currently using it in our projects, but we are switching to Vitest. Vitest offers Typescript support out of the box, and it's a good fit for our projects, while Jest requires some additional configuration (ie. ts-jest, etc.).

As Vitest offers compatibility with most of the Jest API and ecosystem libraries, so in most projects, it should be a drop-in replacement for Jest. Moreover, Vitest gives you a faster run for your unit tests and a jump in DX thanks to the default watch mode using Vite instant Hot Module Reload (HMR).
21 changes: 21 additions & 0 deletions radar/tools/prettier.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: "Prettier"
ring: adopt
quadrant: "tools"
tags: [typescript, formatting]
---

[Prettier](https://prettier.io/) is an opinionated code formatter. It removes all original styling and ensures that all outputted code conforms to a consistent style.

## Use cases

- Automatically format code on save
- Format code in a CI/CD pipeline
- Format code in a pre-commit hook

## Reference of usage in our organization

Prettier is used in several TypeScript projects
in combination with ESLint:

https://github.com/search?q=org%3Apagopa+%22\%22prettier\%22%22+path%3A**%2Fpackage.json&type=code
22 changes: 22 additions & 0 deletions radar/tools/vitest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
title: "Vitest"
ring: adopt
quadrant: "tools"
tags: [typescript, frontend, web, backend, testing]
---

[Vitest](https://vitest.dev/) is a testing framework powered by Vite.

> Even if your library is not using Vite, Vitest is an interesting option as it gives you a faster run for your unit tests and a jump in DX thanks to the default watch mode using Vite instant Hot Module Reload (HMR).
> Vitest offers compatibility with most of the Jest API and ecosystem libraries, so in most projects, it should be a drop-in replacement for Jest.
## Use cases

- Unit testing in TypeScript projects

## Reference of usage in our organization

A list of repositories where Vitest is applied successful in a production environment:

https://github.com/search?q=org%3Apagopa+vitest%2Fconfig&type=code

0 comments on commit 786fa7b

Please sign in to comment.