Categories
Mastering Development

Issue trying to setup jest: application code compiles fine but test code doesn’t

I am trying to migrate to jest and I am facing typescript issues… I have 3 tsconfig files: tsconfig.json (base config) tsconfig.lib.json (application config) tsconfig.jest-spec.json (jest-dedicated test config) Please note that there are also karma/jasmine dedicated tsconfig files but those are irrelevant. I have separated the jest tests from the karma ones. tsconfig.json { "compileOnSave": […]

Categories
Mastering Development

How to setup jest with node_modules that use es6

I have a very simple test: describe(‘sanity’, () => { it(‘sanity’, () => { expect(true).toBeTruthy() }) }) And I’m receiving the following error: FAIL spec/javascript/sanity_test.js ● Test suite failed to run Jest encountered an unexpected token This usually means that you are trying to import a file which Jest cannot parse, e.g. it’s not plain […]