Is it possible to use Jest with multiple presets at the same time? Presets are just plain Javascript objects, so in many circumstances you may simply merge them. For example, that’s how I’m enabling ts-jest and jest-puppeteer simultaneously:
1 2 3 4 5 6 7 8 9 10 | const merge = require('merge') const ts_preset = require('ts-jest/jest-preset') const puppeteer_preset = require('jest-puppeteer/jest-preset') module.exports = merge.recursive(ts_preset, puppeteer_preset, { globals: { test_url: `http://${process.env.HOST || '127.0.0.1'}: ${process.env.PORT || 3000}`, }, }) |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.