monounity / karma-typescript

Simplifying running unit tests with coverage for Typescript projects.
313 stars 109 forks source link

Failed to resolve module specifier of dependency #337

Open tpluscode opened 5 years ago

tpluscode commented 5 years ago

I'm trying to add karma-typescript to a project using @open-wc/testing. For example, on test file starts with

import { expect } from '@open-wc/testing'

When running tests I get

Uncaught TypeError: Failed to resolve module specifier "@open-wc/testing". Relative references must start with either "/", "./", or "../".

I tried adding the @open-wc files to karmaTypescriptConfig.include but it did not help.

qingxiang-jia commented 4 years ago

I encountered the same issue with ES6, may be due to the same cause?

tpluscode commented 4 years ago

FWIW, I changed my setup from using karma-typescript to @babel/preset-typescript. A much more stable configuration with solid support for code coverage and debugging.

qingxiang-jia commented 4 years ago

Thanks for the updates. I changed my configuration to what my coworker has and it works. I didn't dig deep and see why it didn't work.