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

testMatch and testRegex + presets #757

Merged
merged 13 commits into from
Sep 26, 2018

Conversation

huafu
Copy link
Collaborator

@huafu huafu commented Sep 24, 2018

  • fixes config:migrate results in error message #756 - CLI command config:migrates overrides testMatch if the user uses testRegex
  • adds 3 presets (see discussion in Regression: no typescript transformation/compilation possible for JavaScript files any more #740):
    • ts-jest/presets/default: same as the old ts-jest preset (the old one is now an alias to this one)
    • ts-jest/presets/js-with-ts: for users who have allowJs: true in their tsconfig file and wants js files to be compiled by TypeScript thru ts-jest
    • ts-jest/presets/js-with-babel: for users who want to have babel-jest to compile their js without going thru ts-jest
  • update the config:migrate CLI command so that it takes the appropriate preset
  • document the new presets
  • document the fact that presets uses testMatch as Jest defaults, so if one wants to use a preset AND testRegex (instead of testMatch), he must also set testMatch to null

If no moduleFileExtensions or testMatch is given to the createJestPreset
it'd fail
Default preset `ts-jest` becomes an alias to `ts-jest/presets/default`
which contains the same as previous `ts-jest` preset. Compilation of js
files can be done using the `ts-jest/presets/js-with-ts` or
`ts-jest/presets/js-with-babel` additional presets.
@huafu huafu added this to the 23.10.2 milestone Sep 24, 2018
@huafu huafu changed the title [wip] Test match and test regex [wip] testMatch and testRegex + presets Sep 24, 2018
@coveralls
Copy link

coveralls commented Sep 24, 2018

Pull Request Test Coverage Report for Build 1900

  • 31 of 34 (91.18%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 91.251%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/cli/config/migrate.ts 30 33 90.91%
Totals Coverage Status
Change from base Build 1896: 0.1%
Covered Lines: 996
Relevant Lines: 1042

💛 - Coveralls

@huafu huafu requested a review from kulshekhar September 25, 2018 16:40
@huafu huafu changed the title [wip] testMatch and testRegex + presets testMatch and testRegex + presets Sep 25, 2018
kulshekhar
kulshekhar previously approved these changes Sep 25, 2018
@huafu huafu merged commit e765875 into kulshekhar:master Sep 26, 2018
@huafu huafu deleted the testMatch-and-testRegex branch September 26, 2018 04:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

config:migrate results in error message
3 participants