Skip to content

Custom transformer on top of ts-jest #2721

Answered by ahnpnl
acalvo asked this question in Q&A
Discussion options

You must be logged in to vote

To work with Jest 27, your jest-file-transformer.js must have this structure

const tsJestTransformer = require('ts-jest').createTransformer();

module.exports = { 
    createTransformer: () => {
        return {
             process: function (src, filename, config, options) {
                   return tsJestTransformer.process(myCustomTransform(src), filename, config, options)
             }
        }
   }
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ahnpnl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants