Closed qiluo closed 6 years ago
I've set up my test exactly like this example repo, everything worked properly until I added an image element into html, e.g.
<ion-row> <img style="height:16px; width:16px" src="assets/icon/star-16.png" *ngFor="let star of item.stars" /> </ion-row>
When npm run test, always got
npm run test
ERROR in ./src/pages/home/home.html Module not found: Error: Can't resolve './assets/icon/star-16.png' in '/Users/xxx/Dev/ionic-apps/my-app/src/pages/home' @ ./src/pages/home/home.html 1:2111-2147 @ ./src/pages/home/home.ts ... @ ./src/app/app.component.ts @ ./src/app/app.component.spec.ts @ ./src \.spec\.ts @ ./test-config/karma-test-shim.js webpack: Failed to compile.
I'm new to Karma and Webpack, any idea?
I've set up my test exactly like this example repo, everything worked properly until I added an image element into html, e.g.
When
npm run test
, always gotI'm new to Karma and Webpack, any idea?