Skip to content
This repository was archived by the owner on Jun 2, 2023. It is now read-only.

Commit 8d04284

Browse files
committed
update(docs): README
1 parent febeaee commit 8d04284

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

README.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ A quick look at the top-level files and directories you'll see in this project.
5656

5757
.
5858
├── node_modules
59+
├── __mock__
60+
├── coverage
61+
├── jest-helpers
5962
├── scripts
6063
├── src
6164
├── static
@@ -68,17 +71,26 @@ A quick look at the top-level files and directories you'll see in this project.
6871
├── gatsby-node.js
6972
├── gatsby-ssr.js
7073
├── gatsby-wrap-root-element.js
74+
├── jest.config.js
7175
├── package-lock.json
7276
├── package.json
7377
├── tsconfig.json
7478
└── README.md
7579

80+
- **`/__mock__`** - jest global mocks directory.
81+
82+
- **`/.build/jest-temp`** - jest unit tests cache directory.
83+
7684
- **`/.build/.i18nExtractedMessages`** - i18n messages extracted from the code and those messages will be used to generate the JSON translation files.
7785

7886
- **`/.cache`** - files manages by the Gatsby used to build the output on the **`/public`** folder.
7987

8088
- **`/node_modules`** - This directory contains all of the modules of code that your project depends on (npm packages) are automatically installed.
8189

90+
- **`/coverage`** - output of jest unit tests coverage reports.
91+
92+
- **`/jest-helpers`** - jest setup helpers.
93+
8294
- **`/public`** - Gatsby output directory, the content of this folder after the build flow must be copied to the server.
8395

8496
- **`/scripts`** - contains font icons generation, the translations manager and the path prefix helper.
@@ -210,6 +222,8 @@ A quick look at the top-level files and directories you'll see in this project.
210222

211223
- test the production outputed version: `npm run serve`
212224

225+
- run the jest unit tests and generate the coverage report: `npm run unit-tests`
226+
213227
## 🎓 Learning Gatsby
214228

215229
Looking for more guidance? Full documentation for Gatsby lives [on the website](https://www.gatsbyjs.org/). Here are some places to start:
@@ -239,3 +253,53 @@ Looking for more guidance? Full documentation for Gatsby lives [on the website](
239253
- [Gatsby Docs - Environment Variables](www.gatsbyjs.org/docs/environment-variables/)
240254

241255
- [Building Apps with Gatsby](https://www.gatsbyjs.org/docs/building-apps-with-gatsby/)
256+
257+
## 🧪Jest unit tests
258+
259+
This project has unit tests support that runs on top of the [Jest](https://jestjs.io/) - ( [Docs](https://jestjs.io/docs/en/getting-started) | [API](https://jestjs.io/docs/en/api) ).
260+
261+
The jest unit tests will be executed right before the gatsby-build on the build flow `npm run build` or you can execute it anytime with the following commands: `npm run unit-tests`, `jest` and if you what to keep it running use `jest --watch`;
262+
263+
### Useful links related to TypeScript + React + Jest
264+
265+
- [[GitHub] facebook/jest - TypeScript](https://github.com/facebook/jest/tree/master/examples/typescript)
266+
267+
- [Add Testing | Gatsby.js Doc](https://www.gatsbyjs.org/docs/testing/)
268+
269+
- [Unit Testing | Gatsby.js Doc](https://www.gatsbyjs.org/docs/unit-testing/)
270+
271+
---
272+
273+
- [Understanding Jest Mocks | Rick Hanlon II - Medium](https://medium.com/@rickhanlonii/understanding-jest-mocks-f0046c68e53c)
274+
275+
- [Configuring Jest to show code coverage for all of your files](https://joshtronic.com/2017/10/24/configuring-jest-to-show-code-coverage-for-all-of-your-files/)
276+
277+
- [Best kept Jest secret: Testing only changed files with coverage reports | @stipsan - Medium](https://medium.com/@stipsan/best-kept-jest-secret-testing-only-changed-files-with-coverage-reports-3affc8b4d30f)
278+
279+
---
280+
281+
- [Using Jest with TypeScript](https://basarat.gitbooks.io/typescript/docs/testing/jest.html)
282+
283+
- [Testing TypeScript with Jest](https://rjzaworski.com/2016/12/testing-typescript-with-jest)
284+
285+
- [[GitHub] rjz/typescript-react-redux](https://github.com/rjz/typescript-react-redux)
286+
287+
- [Mocking TypeScript classes with Jest | David Guijarro - Medium](https://medium.com/@davguij/mocking-typescript-classes-with-jest-8ef992170d1d)
288+
289+
- [[GitHub] davguij/typescript-jest-mocked-classes](https://github.com/davguij/typescript-jest-mocked-classes)
290+
291+
- [Debugging with TypeScript, Jest, ts-jest and Visual Studio Code](https://medium.com/@mtiller/debugging-with-typescript-jest-ts-jest-and-visual-studio-code-ef9ca8644132)
292+
293+
- [TypeScript - jest (ts-jest) | typescript Tutorial](https://riptutorial.com/typescript/example/29207/jest--ts-jest-)
294+
295+
- [[GitHub] kulshekhar/ts-jest](https://github.com/kulshekhar/ts-jest) - TypeScript preprocessor with sourcemap support for Jest
296+
297+
- [[GitHub] zeit / next.js - Testing with typescript + jest + ts-jest #8663](https://github.com/zeit/next.js/issues/8663) - tip to how to solve the jsx parsing problem
298+
299+
- [[GitHub] jest-community / jest-junit](https://github.com/jest-community/jest-junit) - A Jest reporter that creates compatible junit xml files
300+
301+
---
302+
303+
- [Testing in React with Jest and Enzyme: An Introduction | @rossbulat - Medium](https://medium.com/@rossbulat/testing-in-react-with-jest-and-enzyme-an-introduction-99ce047dfcf8)
304+
305+
- [Test Driven Development in React with Jest and Enzyme | @rossbulat - Medium](https://medium.com/@rossbulat/testing-in-react-with-jest-and-enzyme-an-introduction-99ce047dfcf8)

0 commit comments

Comments
 (0)