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

Silent errors in test.ts #2640

Closed
renehamburger opened this issue Oct 11, 2016 · 4 comments
Closed

Silent errors in test.ts #2640

renehamburger opened this issue Oct 11, 2016 · 4 comments
Labels
P5 The team acknowledges the request but does not plan to address it, it remains open for discussion

Comments

@renehamburger
Copy link

I'm using angular-cli@1.0.0-beta.16, node@6.5.0 and karma@1.2.0 (on OS X El Capitan).

When an exception is thrown while the spec files and their dependencies are loaded in test.ts, the output __karma__.error() is barely helpful. In Chrome only 'ERROR' is printed to the node console and it's close to impossible to break on such a caught exception due to too many false positives. PhantomJS prints out a error stack but not the error message.

It would be great if you could log the error before re-throwing it.

In my case, @ngrx/effects@1.1.1 wasn't compatible with @angular@2.0.1, which was difficult to spot without sufficient error logging.

@anton-107
Copy link

@renehamburger how did you find the error? Also a bit stuck on this, hints on how to tackle these type of issues would be helpful

@renehamburger
Copy link
Author

You could add your own error logging by changing src/test.ts line 32 from

  .then(context => context.keys().map(context))

to

  .then(context => {
    try {
      return context.keys().map(context);
    } catch (e) {
      console.error(e.message, e.stack);
      throw e;
    }
  })

The error stack would refer to the bundled file though, which would make it less helpful. But the error message may be all you need to pinpoint the issue.

@filipesilva
Copy link
Contributor

@renehamburger would you be interested in submitting a PR with this change? I'd be happy to review it, but would require you to give a short example/repro step of how the reported error changed.

@filipesilva filipesilva added type: enhancement P5 The team acknowledges the request but does not plan to address it, it remains open for discussion labels Oct 17, 2016
renehamburger pushed a commit to renehamburger/angular-cli that referenced this issue Oct 19, 2016
renehamburger pushed a commit to renehamburger/angular-cli that referenced this issue Oct 19, 2016
renehamburger pushed a commit to renehamburger/angular-cli that referenced this issue Oct 20, 2016
renehamburger pushed a commit to renehamburger/angular-cli that referenced this issue Oct 20, 2016
MRHarrison pushed a commit to MRHarrison/angular-cli that referenced this issue Feb 9, 2017
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P5 The team acknowledges the request but does not plan to address it, it remains open for discussion
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants