Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Source maps are not working #203

Closed
ryaa opened this issue Jan 3, 2017 · 4 comments
Closed

Source maps are not working #203

ryaa opened this issue Jan 3, 2017 · 4 comments

Comments

@ryaa
Copy link

ryaa commented Jan 3, 2017

Hi,

I created new project from here https://github.com/driftyco/ionic-starter-super and followed the instructions in the blog http://lathonez.github.io/2016/ionic-2-unit-testing/ to enable unit testing however faced couple issues. First, the source maps seems to be generated but when debugging unit tests it is not working. When you click on .ts file it opens js transpiled file - see attached

screen shot 2017-01-03 at 04 14 38

The other problem is that the test fails because there is an error in ionic slider - see attached
_this.slider is undefined. Not sure why this is happening

screen shot 2017-01-03 at 04 16 30

@lathonez
Copy link
Owner

lathonez commented Jan 3, 2017

Hey,

So the code coverage generator munges the source maps for some reason. If you run

ng test

instead of

npm test (implies --code-coverage)

you should see that the source maps work fine (just checked - I could replicate the behaviour).

If you can give me a link to your repo I'll try to help out with the slider undefined problem (please raise another issue).

EDIT - if you don't have ng-cli installed globally, ammend this line in package.json to remove the --code-coverage: https://github.com/lathonez/clicker/blob/master/package.json#L12

Thanks

@lathonez lathonez closed this as completed Jan 3, 2017
@lathonez
Copy link
Owner

lathonez commented Jan 3, 2017

angular/angular-cli#1799

So basically you can have debug, or coverage, but not both. I'll make it default to debug and do optional coverage

@lathonez
Copy link
Owner

lathonez commented Jan 3, 2017

Updated this repo and the blog

@ryaa
Copy link
Author

ryaa commented Jan 3, 2017

Thank you very much for a quick response. I confirm that debugging unit tests works after i removed --code-coverage
I also added another ticket for the second problem #204

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants