question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Expecting existing DebugElement toBeFalsy creates circular reference in Jasmine

See original GitHub issue

I’m submitting a … (check one with “x”)

[X ] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior When you test to see if a DebugElement that exists but shouldn’t is falsey, Jasmine churns on Plunker but eventually returns sort of. On Angular-CLI on WebStorm, it will keep cycling with a circular reference as it tries to print out the DebugElement to compare it to falsey. It’s actually hard to figure out that’s what happens because it just scrolls and scrolls and the only chance you have to Ctrl-C is when karma is restarting after it gets fed up.

Expected behavior String representation of debug element should be able to be written to console in a reasonable amount of time.

Minimal reproduction of the problem with instructions https://plnkr.co/edit/6a7iKt80GAVdhW9MRrPx

What is the motivation / use case for changing the behavior? People who embrace test first development will write the minimal template without the *ng directive that hides it under testing circumstances.

Please tell us about your environment: Windows 10, Webstorm 2016.2.4 Angular-CLI 1.0.0-beta.20-4

  • Angular version: 2.0.X Locally I have 2.1.0, but I’m assuming that since I forked your plunk for the steps to reproduce, it’s still an issue.

  • Browser: Edge, but I imagine it’s all

  • Language: [all | TypeScript X.X | ES6/7 | ES5] TS

  • Node (for AoT issues): node --version =

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:12
  • Comments:19 (6 by maintainers)

github_iconTop GitHub Comments

13reactions
psxvoidcommented, Oct 5, 2017

It’s still an issue in angular 4.4.4

screenclip

5reactions
dwilchescommented, Feb 4, 2018

I hit this bug today in Angular 4.2.4. While this issue gets addressed, I posted a workaround here: https://stackoverflow.com/questions/44301315/karma-error-no-captured-browser-open-http-localhost9876/48606192

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular 2 CLI Jasmine unit test fails when using beforeAll ...
debugElement.componentInstance; }); it('should create the app', async(() => { expect(app).toBeTruthy(); })); it(`should have as title 'app ...
Read more >
Getting to know fixture.debugElement : Angular Unit Testing
DebugElement is an Angular class that contains all kinds of references and methods relevant to investigate an element as well as component fixture....
Read more >
Basics of testing components - Angular
The ComponentFixture is a test harness for interacting with the created component and its corresponding element. Access the component instance through the ...
Read more >
Angular Testing you don't scare me - Blexin
The first time I opened a test file, which we usually find after creating a new project using Angular CLI, I felt a...
Read more >
angular/angular - Gitter
@mlc-mlapis also one thing to mention, I'm rendering that component via ... I'm getting an error formGroup expects a FormGroup instance.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found