Skip to content

Commit

Permalink
Fix testMatch to find test files correctly (#71)
Browse files Browse the repository at this point in the history
* 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

> hidash@0.1.0 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
  • Loading branch information
bastibuck authored and jaredpalmer committed May 1, 2019
1 parent c817400 commit a2365db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/createJestConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export function createJestConfig(
transformIgnorePatterns: ['[/\\\\]node_modules[/\\\\].+\\.(js|jsx)$'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
collectCoverageFrom: ['src/**/*.{ts,tsx}'],
testMatch: ['<rootDir>/test/**/?(*.)(spec|test).{ts,tsx}'],
testMatch: ['<rootDir>/test/**/*.(spec|test).{ts,tsx}'],
testURL: 'http://localhost',
rootDir,
watchPlugins: [
Expand Down

0 comments on commit a2365db

Please sign in to comment.