Skip to content

Commit

Permalink
feat(preset): adds 2 presets along the default one
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
huafu committed Sep 24, 2018
1 parent 3c325e8 commit 9f3d759
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 4 deletions.
5 changes: 1 addition & 4 deletions jest-preset.js
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
const createJestPreset = require('./dist/config/create-jest-preset')
.createJestPreset

module.exports = createJestPreset()
module.exports = require('./presets/default/jest-preset')
1 change: 1 addition & 0 deletions presets/create.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../dist/config/create-jest-preset').createJestPreset
3 changes: 3 additions & 0 deletions presets/default/jest-preset.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const create = require('../create')

module.exports = create()
7 changes: 7 additions & 0 deletions presets/js-with-babel/jest-preset.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const create = require('../create')

module.exports = create({ allowJs: false }, {
transform: {
'^.+\\.jsx?$': 'babel-jest',
},
})
3 changes: 3 additions & 0 deletions presets/js-with-ts/jest-preset.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const create = require('../create')

module.exports = create({allowJs: true})

0 comments on commit 9f3d759

Please sign in to comment.