1

How to include templateURL in angular directive testing with Jasmine. I know there is way with karma but i am not using Karma . So any specific way of doing this?

future
  • 352
  • 2
  • 6
  • 19
  • If you are not using Karma, what testing framework are you using? It is all up to the framework being used – Dalorzo Sep 14 '14 at 22:51
  • I have been through the same with chutzpah.. I could do it only by creating a wrapper for XMlHtppRequest and load the template and cache it. – PSL Sep 14 '14 at 22:52
  • I am using Jasmine with chutzpah extension in VS for unit testing and protractor for e2e Testing. – future Sep 14 '14 at 22:52
  • @PSL so there is nothing like adding as a reference in testSpec? as per mentioned on Chuzpah's site help ? – future Sep 14 '14 at 22:54
  • @future I think that is for loading html templates, but in the case where we want to test directives or something with templateUrl it had to be in the angular templatecache... Atleast, i could not get it to work, so had to create a utility myself.. But i am alse eager to see if we get an answer to your question that has a better solution... – PSL Sep 14 '14 at 22:58
  • Can you file an issue and attach a repro of this scenario at https://github.com/mmanela/chutzpah. I will then take a look and see if I can add anything to Chutzpah to make this easier/better. – Matthew Manela Sep 16 '14 at 14:17
  • @PSL http://stackoverflow.com/questions/26645708/template-url-directive-unit-testing-without-karma how to create wrapper for XMIHttp and cache the template ? – future Oct 30 '14 at 17:19
  • @future That is exactly i am also doing now. Probably might switch back to karma.. :( Is it not working for you? – PSL Oct 30 '14 at 17:25
  • Nops :/ Karma not approved by my company's Baap TEAM...LOL(No other Option) – future Oct 30 '14 at 17:29
  • I got this working, see my answer here: http://stackoverflow.com/a/28554489/11019 – evan w Feb 17 '15 at 04:18
  • possible duplicate of [How can I test a directive using templateUrl in Chutzpah's headless browser](http://stackoverflow.com/questions/19313645/how-can-i-test-a-directive-using-templateurl-in-chutzpahs-headless-browser) – carlin.scott Sep 24 '15 at 17:04

0 Answers0