opened
DriesCruyskens
username_0
<!--
Please take a look at the issue templates at https://github.com/Human-Connection/Human-Connection/issues/new/choose
before submitting a new issue. Following one of the issue templates will ensure maintainers can route your request efficiently.

Thanks!
-->

## 💬 Issue
<!-- Describe your Issue in detail. -->
Hi all, 

I think the third option/command for running a single unit test in the webapp should be
`yarn test path/to/component.spec.js`
instead of
`yarn run path/to/component.spec.js`
I got neither to work on windows but the 'run' command does at least run using WSL. The fact that it doesn't work on windows isn't too bad but documentation should be fixed if this is indeed a typo. I will gladly create a pull request if assigned to me.

Here is the link to the actual location:
https://github.com/Human-Connection/Human-Connection/blob/master/webapp/testing.md#unit-tests

command line outputs:
**WSL**
```bash
$ yarn run pages/post/_id/_slug/index.spec.js
yarn run v1.22.4
error Command "pages/post/_id/_slug/index.spec.js" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
```
```bash
$ yarn test pages/post/_id/_slug/index.spec.js 
yarn run v1.22.4
$ jest pages/post/_id/_slug/index.spec.js
 PASS  pages/post/_id/_slug/index.spec.js (10.164s)
<omitted>
```
**Powershell:**
```powershell
PS> yarn run .\pages\post\_id\_slug\index.spec.js
yarn run v1.22.4
error Command ".\\pages\\post\\_id\\_slug\\index.spec.js" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
```

```powershell
PS> yarn test .\pages\post\_id\_slug\index.spec.js
yarn run v1.22.4
$ jest .\pages\post\_id\_slug\index.spec.js
No tests found, exiting with code 1
Run with `--passWithNoTests` to exit with code 0
In C:\Users\dries\Documents\open source\Human-Connection\webapp
  367 files checked.
  testMatch: **/?(*.)+(spec|test).js?(x) - 82 matches
  testPathIgnorePatterns: \\node_modules\\ - 367 matches
  testRegex:  - 0 matches
Pattern: .\pages\post\_id\_slug\index.spec.js - 0 matches
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
```
Wrong unit test command in webapp documentation.
issue
created
Tirokk
username_1
This is indeed a typo @username_0 . 🐛

Originally it was
`$ yarn run test <XXX>`
and now its
`$ yarn test <XXX>`

Why it’s not working on Windows and no tests found I can not tell.
May @ogerly knows more about it?

I assigned you to this issue. Glad you care for it! 🙏🏼
comment
closed
Tirokk
username_1
issue