angular - Ionic 2 : Error with test and images -


i try test ionic 2 app jasmine , karma. when run 'npm test' have error :

c:\xampp\htdocs\myapp>npm test  > ionic-hello-world@ test c:\xampp\htdocs\myapp > karma start ./test-config/karma.conf.js   webpack: compiled successfully. webpack: compiling... ts-loader: using typescript@2.0.9 , c:\xampp\htdocs\myapp\tsconfig.json 28 03 2017 14:24:17.950:warn [karma]: no captured browser, open http://localhost:9876/  error in ./src/pages/login/login.html module not found: error: can't resolve './assets/images/fr.svg' in 'c:\xampp\htdocs\myapp\src\pages\login'  @ ./src/pages/login/login.html 1:1614-1647  @ ./src/pages/login/login.ts  @ ./src/app/app.component.ts  @ ./src/app/app.component.spec.ts  @ ./src \.spec\.ts  @ ./test-config/karma-test-shim.js  error in ./src/pages/login/login.html module not found: error: can't resolve './assets/images/ch.svg' in 'c:\xampp\htdocs\myapp\src\pages\login'  @ ./src/pages/login/login.html 1:1832-1865  @ ./src/pages/login/login.ts  @ ./src/app/app.component.ts  @ ./src/app/app.component.spec.ts  @ ./src \.spec\.ts  @ ./test-config/karma-test-shim.js  error in ./src/pages/load-screen/load-screen.html module not found: error: can't resolve './assets/images/logo-yellow.svg' in 'c:\xampp\htdocs\myapp\src\pages\load-screen'  @ ./src/pages/load-screen/load-screen.html 1:94-136  @ ./src/pages/load-screen/load-screen.ts  @ ./src/pages/login/login.ts  @ ./src/app/app.component.ts  @ ./src/app/app.component.spec.ts  @ ./src \.spec\.ts  @ ./test-config/karma-test-shim.js webpack: failed compile. 28 03 2017 14:24:17.974:info [karma]: karma v1.5.0 server started @ http://0.0.0.0:9876/ 28 03 2017 14:24:17.975:info [launcher]: launching browser chrome unlimited concurrency 28 03 2017 14:24:18.036:info [launcher]: starting browser chrome 28 03 2017 14:24:21.892:info [chrome 56.0.2924 (windows 10 0.0.0)]: connected on socket z7t5aawcca3ydbsdaaaa id 37780347 chrome 56.0.2924 (windows 10 0.0.0) error   uncaught error: cannot find module "./assets/images/logo-yellow.svg"   @ webpack:///src/pages/load-screen/load-screen.html:1:0 <- karma-test-shim.js:150313 chrome 56.0.2924 (windows 10 0.0.0) error   uncaught error: cannot find module "./assets/images/logo-yellow.svg"   @ webpack:///src/pages/load-screen/load-screen.html:1:0 <- karma-test-shim.js:150313 chrome 56.0.2924 (windows 10 0.0.0): executed 0 of 0 error (1.349 secs / 0 secs) 

the problem path images in projet. don't understand why it's considerate module.

in fact, if remove path images in project, tests works. need keep images...

there example image's path in html :

<ion-content padding>   <div class="loading-screen">     <img src="assets/images/logo-yellow.svg"><br><br>     <label>{{this.translate.get('mod-appfine-data_loading')}}</label><br>     <label>{{this.translate.get('mod-appfine-thanks_wait')}}</label><br>     <ion-spinner name="crescent" ></ion-spinner>   </div> </ion-content> 

someone have idea fix ?

my solution right path in var , call var in code. work me.


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -