Testing Typscript
See original GitHub issueHey, I love how easy this was all to set up. Converting to typescript was even a breeze for the most part.
However, I can’t seem to get karma working with my typescript. I’ve tried configuring karma-typescript
myself but have failed for the last few hours.
I would really like to see some docs for setting up tests for typescript. The docs are great in most other places, but lack here.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:25 (15 by maintainers)
Top Results From Across the Web
TypeScript Unit Testing 101: A Developer's Guide - Testim.io
TypeScript unit testing is a bit more involved than testing regular JavaScript, but it's just as vital. Learn more about it in this...
Read more >Unit testing JavaScript and TypeScript - Visual Studio (Windows)
In most TypeScript scenarios, you can debug a unit test by setting a breakpoint in TypeScript code, right-clicking a test in Test Explorer,...
Read more >How to Test TypeScript with Jest - Medium
In this post, I will show the necessary steps to test your TypeScript code using a popular JavaScript testing framework Jest and also ......
Read more >Testing TypeScript apps using Jest - LogRocket Blog
Jest is a simple, lightweight testing framework that provides a variety of testing capabilities to JavaScript and TypeScript projects. It ...
Read more >Writing Well-Structured Unit Test in TypeScript
The purpose of this post is to discover the implementation of writing unit test using Jest, a... Tagged with typescript, testing, javascript ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I share your feeling of not wanting to use webpack or any bundler during development/testing. That’s a primary goal for us as well. The core problem is that for many tools running code unbundled does not work out of the box. So while things work just fine when you run it in the browser, it doesn’t when you use some tools.
The problem with karma is that it doesn’t serve any files it didn’t know about beforehand. Because we want to use the module loader of the browser, we can’t and shouldn’t know the dependency tree beforehand.
It took quite some effort getting this to work, but we did it with
karma-esm
. Unfortunately this has the side effect of not running the karma preprocessors since we’re bypassing karma for serving files.So to summarize:
karma-esm
plugin)But they don’t both work together yet.
https://open-wc.org/testing/karma-esm.html#testing-typescript