Skip to content
This repository was archived by the owner on Oct 18, 2024. It is now read-only.

Commit 8faf91a

Browse files
committed
development docs
1 parent d9390b9 commit 8faf91a

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

README.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@
1414

1515
Interweb is a collection of powerful tools designed to simplify and streamline your development process for web and TypeScript projects.
1616

17+
- [Packages](#packages)
18+
- [@interweb/build](#interwebbuild)
19+
- [@interweb/ts-json-schema](#interwebts-json-schema)
20+
- [Development](#development)
21+
- [Project Setup](#project-setup)
22+
- [Running Tests](#running-tests)
23+
- [Jest Watch Mode](#jest-watch-mode)
24+
- [Workflow Tips](#workflow-tips)
25+
- [License](#license)
26+
1727
## Packages
1828

1929
This monorepo contains the following packages:
@@ -44,6 +54,58 @@ npm install @interweb/ts-json-schema
4454

4555
[Read more about @interweb/ts-json-schema](./packages/ts-json-schema)
4656

57+
## Development
58+
59+
This section explains how to set up the project for development and how to run tests.
60+
61+
### Project Setup
62+
63+
To bootstrap the project, run the following commands from the root of the monorepo:
64+
65+
```sh
66+
yarn
67+
yarn build
68+
yarn symlink
69+
```
70+
71+
This will install dependencies, build all packages, and create symlinks between them.
72+
73+
### Running Tests
74+
75+
To run tests for a specific package, navigate to the package directory and use the `test:watch` script. For example, to run tests for `@interweb/build`:
76+
77+
```sh
78+
cd ./packages/build
79+
yarn test:watch
80+
```
81+
82+
This command leverages Jest's watch mode, which provides a convenient interface for running tests.
83+
84+
### Jest Watch Mode
85+
86+
Jest watch mode offers several useful hotkeys to control test execution:
87+
88+
- `a` - Run all tests
89+
- `f` - Run only failed tests
90+
- `p` - Filter by a filename regex pattern
91+
- `t` - Filter by a test name regex pattern
92+
- `q` - Quit watch mode
93+
- `Enter` - Trigger a test run
94+
95+
Here are some examples of how to use these hotkeys:
96+
97+
1. Press `p`, then type `utils` to run tests only in files with "utils" in their name.
98+
2. Press `t`, then type `should calculate` to run only tests with "should calculate" in their description.
99+
3. Press `a` to run all tests again after filtering.
100+
101+
These hotkeys make it easy to focus on specific tests or files during development.
102+
103+
### Workflow Tips
104+
105+
1. Keep the test runner in watch mode while you're developing. This provides instant feedback as you make changes.
106+
2. Use the `p` and `t` filters to focus on the specific area you're working on. This can significantly speed up the test-debug cycle.
107+
3. Remember to run all tests (`a`) before committing changes to ensure you haven't inadvertently broken anything elsewhere in the package.
108+
47109
## License
48110

49111
Interweb Build is [MIT licensed](./LICENSE).

0 commit comments

Comments
 (0)