8000 Show fallback message for typescript jest preset if ts-jest is not in… by m0ksem · Pull Request #6418 · vuejs/vue-cli · GitHub
[go: up one dir, main page]

Skip to content

Show fallback message for typescript jest preset if ts-jest is not in… #6418

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

Merged
merged 2 commits into from
Apr 15, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Show fallback message for typescript jest preset if ts-jest is not in…
…stalled.
  • Loading branch information
m0ksem committed Apr 13, 2021
commit 96261c4b837d75f269ef49a6d6d466e8b92d651f
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
const deepmerge = require('deepmerge')
const defaultPreset = require('../default/jest-preset')

let tsJest = null
try {
tsJest = require('ts-jest')
} catch (e) {
throw new Error('Cannot resolve "ts-jest" module. Typescript preset requires "ts-jest" to be installed.')
}

module.exports = deepmerge(
defaultPreset,
{
moduleFileExtensions: ['ts', 'tsx'],
transform: {
'^.+\\.tsx?$': require.resolve('ts-jest')
'^.+\\.tsx?$': tsJest
}
}
)
0