Skip to content

Commit

Permalink
docs: fix testing description
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-zaremba committed Aug 18, 2022
1 parent fef80b6 commit 7229f19
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,26 @@ Each package has rich test suites. Whenever you add something new make sure you

Restarting tests by hand is a bit more time consuming. We are using `mocha` framework to execute tests. It has a very useful feature: `mocha --watch` -- which will monitor for all file changes and re-execute tests when a file changed without adding a time overhead to start node and load all TypeScript modules.

To execute tests in a workspace (eg `packages/runtime`) run:
To execute tests in a package (eg `packages/runtime`) run:

```
cd packages/runtime
yarn build
yarn run test
```

To execute and watch tests in a workspace (eg `packages/runtime`) run:
NOTE: you always have to build the typescript files first. If you are in a development mode, then it's worth to run build in a _watch_ mode (will watch for file changes and automatically recompile project, very fast). You can combine it with a watch mode for tests:

```
# in the project root:
yarn build:watch
# in new terminal:
cd packages/runtime
yarn run test -w
```

To execute tests in all workspaces, run the following from the root directory:
To execute tests in all workspace projects, run the following from the root directory:

```
yarn run test
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"build": "yarn workspaces foreach -t run build",
"build:apidocs": "yarn workspaces foreach -t run build:docs",
"build:apidocs-push": "yarn workspaces foreach -t run build:docs; git add docs; git ci -am 'generating api docs' -n; HUSKY=0 git push -f",
"watch": "tsc --build --watch packages/web packages/runtime packages/algob",
"build:watch": "tsc --build --watch packages/web packages/runtime packages/algob",
"test": "yarn workspaces foreach -p run test",
"test:watch": "yarn workspaces foreach run test:watch:p",
"format": "prettier --loglevel warn --write .",
Expand Down

0 comments on commit 7229f19

Please sign in to comment.