karma icon indicating copy to clipboard operation
karma copied to clipboard

fix(config): remove ts-node register() call to allow custom configuration

Open mlegenhausen opened this issue 6 years ago • 4 comments

Calling require('ts-node').register() to determine if typescript is available prevents the custom configuration of the register call described in the documentation. I removed the unnecessary register call and fixed the missing module.exports assignment in the documentation.

mlegenhausen avatar Feb 20 '19 11:02 mlegenhausen

The only easy workaround that I can think of is forking karma to disable the register() call (like in that PR).

trusktr avatar Jun 19 '19 21:06 trusktr

In my use case, because Karma and it's configuration are located inside node_modules because my CLI tool uses Karma to run a project's tests, it complicates things: for example, the karma.config.js can't make an accurate guess as to which tsconfig.json file a project may be using, in order to extend it and disable allowJs and checkJs.

trusktr avatar Jun 19 '19 21:06 trusktr

Can we please have this merged. It is blocking a PR in Angular builders that allows custom webpack configuration in Angular.

https://github.com/just-jeb/angular-builders/pull/824

muuvmuuv avatar Dec 08 '20 08:12 muuvmuuv

It seems the problem was fixed via https://github.com/karma-runner/karma/commit/474f4e1caff469cce87f19a11d9179e4e05552f9. Now it should be possible to define a JS configuration that can call ts-node's register function without interfering with the karma register call.

I am currently unable to confirm if this solved the described problem cause I am not working anymore on any karma dependent project.

mlegenhausen avatar May 14 '21 09:05 mlegenhausen