code-chunks / angular2-logger

A log4j inspired logger for angular 2.
MIT License
144 stars 41 forks source link

Using with a Service tested from Karma/Jasmine #163

Closed paulkeogh closed 7 years ago

paulkeogh commented 7 years ago

Hi,

I have just installed angular2-logger and have followed the README. I am try to run a Jasmine test under Karma to test a service into which I have injected a Logger instance. It fails and I see;

02 04 2017 23:38:11.950:WARN [web-server]: 404: /base/node_modules/angular2-logger/core.js [1] Chrome 57.0.2987 (Windows 10 0.0.0) ERROR [1] { [1] "__zone_symbol__error": { [1] "originalStack": "Error: Fetch error: 404 Not Found\n Instantiating node_modules/angular2-logger/core.js\n Loading app/services/snapshot.service.js\n Loading app/test/snapshot.service.2.s pec.js\n Loading app/test/snapshot.service.2.spec.js", [1] "zoneAwareStack": "Error: Fetch error: 404 Not Found\n Instantiating node_modules/angular2-logger/core.js\n Loading app/services/snapshot.service.js\n Loading app/test/snapshot.service.2. spec.js\n Loading app/test/snapshot.service.2.spec.js" [1] }, [1] "stack": "Error: Fetch error: 404 Not Found", [1].....

I am very new to NG and don't understand why it is trying to reference from /base... I can see the angular2-logger package installed into node_modules under the root of my project.

langley-agm commented 7 years ago

Hi @paulkeogh

It will certainly not find it under /base I'm not sure why is your setup looking for it in there. Can't really help you without an example where I can see your issue.