|
14 | 14 |
|
15 | 15 | Interweb is a collection of powerful tools designed to simplify and streamline your development process for web and TypeScript projects.
|
16 | 16 |
|
| 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 | + |
17 | 27 | ## Packages
|
18 | 28 |
|
19 | 29 | This monorepo contains the following packages:
|
@@ -44,6 +54,58 @@ npm install @interweb/ts-json-schema
|
44 | 54 |
|
45 | 55 | [Read more about @interweb/ts-json-schema](./packages/ts-json-schema)
|
46 | 56 |
|
| 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 | + |
47 | 109 | ## License
|
48 | 110 |
|
49 | 111 | Interweb Build is [MIT licensed](./LICENSE).
|
0 commit comments