1

I'm writing unit tests with karma. In my angular code I have this string:

$http.get('data/config.json');

JSON files are places in src/data folder. When I am running tests the script can't load this data.

Btw, I tried this in my karma.conf:

files: [
    ...    
    {pattern: 'src/data/*.json', watched: true, included: false, served: true}
],

proxies: {
   '/data/': 'src/data'
}

And after running tests:

24 09 2015 13:49:30.361:WARN [proxy]: failed to proxy src/data/config.json (socket hang up)
Cœur
  • 32,421
  • 21
  • 173
  • 232
Alex
  • 51
  • 1
  • 5

0 Answers0