-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Karma seems to disregard .ts files #3066
Comments
karma-runner is a nodejs process that runs plugins based on your config, starts a server, launches a browser, and directs the browser to the server. None of these steps work with TypeScript. Therefore literally "karma seems to disregard .ts files" is working as designed: .ts files don't work in this system. Various plugins and tools that run before karma can transform .ts files to .js files allowing TypeScript to be used for tests, code under test, config and plugins. So your problem has to be either in your config or in one of the plugins or tools you use. Run your code with |
The idea behind the used setup that the transpiling happens artifact-free, i.e. without any Does this mean if I wanted to use Karma in this context I'd need a transpilation step that creates |
No, I am saying that what ever your issue is, karma-runner source code can't fix it. Your issue is very unlikely to be resolved here. By running with the debug settings and studying the output you can track down your issue. It is mostly likely a configuration setting relating to one of the plugins. |
I have the exact opposite, only .ts files are run but not .js files. |
Expected behaviour
I am trying to run a testsuite that is composed of TypeScript and JavaScript files. They are all named following a
*.test.*
pattern (i.e.foo.test.js
andbar.test.ts
). I would expect Karma to run all matching files.TypeScript is being handled using
karma-browserify
and thetsify
plugin.Actual behaviour
Instead, only files ending with
.js
are being run. Compilation of TypeScript sources works correctly though as.js
-tests are able to consume the sources.Environment Details
karma --version
):karma.config.js
fileSteps to reproduce the behaviour
karma-browserify
and thetsify
plugin.ts
suffixThis issue over at
karma-browserify
makes me think the overall approach is viable. I don't know if this is a regression since then or if I am doing something wrong.The text was updated successfully, but these errors were encountered: