Skip to content

Commit

Permalink
Made git pre-push hook to use --runInBand Jest parameter if WSL=true.…
Browse files Browse the repository at this point in the history
… Using --runInBand makes testCI pass in WSL environment
  • Loading branch information
umeetiusbaar committed Oct 30, 2023
1 parent e66f1d8 commit de565ed
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,18 @@ Then either rebuild the docker container or run `yarn update-runtime-env` as dis

In the cloud instances, dev uses Helsinki AD identification while others use Suomi.fi.

### Windows Subsystem for Linux (WSL)

If you use WSL as your local development environment and you bump into pre-push validation errors
in `git push` that other developers (with e.g. Mac) do not have, you could try to set `WSL=true`
in your local environment, e.g. in `~/.huskyrc` (Husky git hooks automatically loads this file):

```
export WSL=true
```

This setting adds `--runInBand` parameter for Jest tests (see https://jestjs.io/docs/cli#--runinband).

## Excel for translations

You can export an Excel-file with current translations. This can then be sent to translators.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"pre-push": "yarn run type-check && yarn testCI"
"pre-push": "yarn run type-check && if test \"$WSL\" = \"true\" ; then yarn testCI --runInBand ; else yarn testCI ; fi"
}
},
"lint-staged": {
Expand Down

0 comments on commit de565ed

Please sign in to comment.