-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add ability to define tsconfig.json path (#19)
- Loading branch information
1 parent
bc566e0
commit f5100dd
Showing
5 changed files
with
75 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,17 @@ | ||
import { createJestRunner } from 'create-jest-runner'; | ||
import cosmiconfig from 'cosmiconfig'; | ||
|
||
module.exports = createJestRunner(require.resolve('./runTsc')); | ||
const explorer = cosmiconfig('jest-runner-tsc'); | ||
|
||
const getExtraOptions = () => { | ||
const searchedFor = explorer.searchSync(); | ||
if (!searchedFor || typeof searchedFor.config === 'undefined') { | ||
return {}; | ||
} | ||
|
||
return searchedFor.config; | ||
}; | ||
|
||
module.exports = createJestRunner(require.resolve('./runTsc'), { | ||
getExtraOptions, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters