Jasmine error - Uncaught [Object Object] thrown

Asked

Viewed 100 times

-2

When I run my test I get the following error Uncaught [object Object] thrown Every time the test is run he says the error is in a different location, I can’t understand the reason. Sometimes the test goes by without this error but are few times the biggest problem is that the description of this error is not very descriptive.Here is an example photo:

Editing

Every time I run the tests I get the same error: inserir a descrição da imagem aqui

however each time in a different place and in a different test, for example this photo test passed the previous test, however while running the test again the error appeared in it (as in the photo). His code is as follows:

   it('Given_invalidCnpj_When_RegisterOrg_Then_ExpectFalsy', () => {
    expect(service.validateCNPJ("19737128000161")).toBeFalsy();
});

as we can see there is nothing too much to generate an error, this is making the identification of this error absurdly difficult for me. Remembering that if I run the test again will not give error in this test, it will pass and the error will appear in another test in another component, with no relation to the image.

  • 1

    Do you have code? More details? We need evidence to help.

  • Sorry @Jackson is that as each hour happens on a different component so I don’t know exactly what to show :/

  • 1

    All right, let’s go on one side, "Divide to conquer", let’s go to the first mistake, post what’s happening and then we’ll adjust the rest.

  • Come on, I will edit and add some information. For example the code of the test that gives error in this execution

  • 1

    I found the problem, thank you for your attention Jakson!

  • Good thing you got :D

Show 1 more comment

1 answer

1

I found where the problem was, a teammate added these two lines to test and ended up not removing, I do not know why it generated this very generic error. The solution was just to remove them

inserir a descrição da imagem aqui

Browser other questions tagged

You are not signed in. Login or sign up in order to post.