fix(config): remove ts-node register() call to allow custom configuration
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.
The only easy workaround that I can think of is forking karma to disable the register() call (like in that PR).
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.
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
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.