Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No tests found - exit code 1 #62

Closed
bastibuck opened this issue May 1, 2019 · 5 comments · Fixed by #65 or #71
Closed

No tests found - exit code 1 #62

bastibuck opened this issue May 1, 2019 · 5 comments · Fixed by #65 or #71
Labels
kind: bug Something isn't working

Comments

@bastibuck
Copy link
Contributor

Current Behavior

After installing tsdx globally and creating a new project I ran npm test and it prompts the following to console:

No tests found, exiting with code 1
Run with `--passWithNoTests` to exit with code 0
In C:\dev\hidash
  13 files checked.
  testMatch: C:/dev/hidash/test/**\?(*.)(spec|test).{ts,tsx} - 0 matches
  testPathIgnorePatterns: \\node_modules\\ - 13 matches
  testRegex:  - 0 matches
Pattern:  - 0 matches

Also when filtering for blah.test.ts manually it won't show up.

Expected behavior

To get the default test to run and pass after installing out of the box.

Your environment

Software Version(s)
TSDX 0.5.4
TypeScript as bundled
Browser (not involved)
npm 6.7.0
Operating System Windows 10
@PabloSzx
Copy link
Contributor

PabloSzx commented May 1, 2019

I have the same issue.

edit: tested using npx and uninstalling tsdx globally and it doesn't work either.

@PabloSzx
Copy link
Contributor

PabloSzx commented May 1, 2019

I upgraded to "tsdx": "^0.5.5" and i still have the same error, but it instead of watching file changes, just returns "error Command failed with exit code 1."
@jaredpalmer

@bastibuck
Copy link
Contributor Author

Same for me, taking a closer look now

@bastibuck
Copy link
Contributor Author

I created the PR above. Someone should verify it still works on MacOS. Not sure why the other solution didn't work but this one does and should do the same thing.

@bastibuck
Copy link
Contributor Author

Also I'd prefer the default behaviour to become --watchAll again as it wasn't the cause of this bug if you agree

jaredpalmer pushed a commit that referenced this issue May 1, 2019
* fix testMatch to find test files correctly

The problem occured in #62 and seems to come from this part: `?(*.)`.
Applying the changes in this PR finds the files correctly and runs tests for `.ts` and `.tsx` files inside root and subfolders within `/test/`.

Can't check if this still works on other OS than Windows though. 

```
PS C:\dev\hidash> npm test

> [email protected] test C:\dev\hidash
> tsdx test

 PASS  test/blah.test.ts
 PASS  test/fix/make.test.tsx

Test Suites: 2 passed, 2 total
Tests:       2 passed, 2 total
Snapshots:   0 total
Time:        3.362s
Ran all test suites.
```

* Update createJestConfig.ts
@agilgur5 agilgur5 added the kind: bug Something isn't working label Oct 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Something isn't working
Projects
None yet
3 participants