How do I debug a “[object ErrorEvent] thrown” error in my Karma/Jasmine tests?

后端 未结 17 2314
生来不讨喜
生来不讨喜 2020-12-04 09:51

I have several failing tests that only output [object ErrorEvent] thrown. I don\'t see anything in the console that helps me pinpoint the offending code. Is t

17条回答
  •  星月不相逢
    2020-12-04 10:01

    It appeared to be an async problem, because after I added enough its in one of my component specs, I was able to get a usable error message which pointed to a file and line within that file (it was related to paramMap.

    In the spec that tested ParamMap, I just added:

      describe('this test', () => {
        it('will succeed', () => {
          expect(true).toBeTruthy();
        });
    
        it('will succeed', () => {
          expect(true).toBeTruthy();
        });
    
        it('will succeed', () => {
          expect(true).toBeTruthy();
        });
    
        it('will succeed', () => {
          expect(true).toBeTruthy();
        });
      });
    

提交回复
热议问题