Skip to content

Commit b9436ac

Browse files
committed
chore: configure jest
1 parent b2bcc4c commit b9436ac

File tree

6 files changed

+6991
-1227
lines changed

6 files changed

+6991
-1227
lines changed

README.md

+20
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
✔️  **Typescript:** Built-in TypeScript support
1818

19+
✔️  **Jest:** Built-in Jest support
20+
1921
## Getting started
2022

2123
This is a starter template for building applications with Vite and React. Click `use this template` and start working right away.
@@ -60,6 +62,24 @@ The API is comptabile with [Stormkit](https://www.stormkit.io). [Check the docs]
6062
If you need to host the API elsewhere, you'll need to change the [vite.config.api.ts](./vite.config.api.ts) file and create a bundle from it. You may
6163
also need to write an entry point that calls the appropriate function based on the route.
6264

65+
## Test
66+
67+
Jest is already preconfigured to work with this repository. Simply run:
68+
69+
```bash
70+
$ npm run test
71+
$ yarn test
72+
$ pnpm run test
73+
```
74+
75+
to execute all tests. You can add the `--watch` flag to keep listening to changes while testing:
76+
77+
```bash
78+
$ npm run test -- --watch
79+
$ yarn test --watch
80+
$ pnpm run test --watch
81+
```
82+
6383
## Community
6484

6585
Here's a curated list of websites using this framework. Please feel free to add your own:

babel.config.cjs

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = { presets: ["@babel/preset-env"] };

jest.config.cjs

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
preset: "ts-jest",
3+
transform: {
4+
"^.+\\.(ts|tsx)?$": "ts-jest",
5+
"^.+\\.(js|jsx)$": "babel-jest",
6+
},
7+
};

0 commit comments

Comments
 (0)