Edmondo Porcu

Results 89 comments of Edmondo Porcu

@muenzpraeger what needs to be done to stub specifically?

Just to be sure, there are two ways I can act: - create a custom mock and change my jest configuration - hardcode the name When the jest config mention...

but the question is, why doesn't the import statement fail in npm if that constant is not exported?

Now the handler is getting triggered, except that the event.detail is null in the handler so if I had the following assertion, the test fails ``` expect(handler.mock.calls[0][0].detail.title).toBe( "Error when invoking...

I am not mocking the event, it is dispatched from within the component. I hardcoded the event name and subscribed to it in my test

No @muenzpraeger I understood it was enough to perform this change in my unit test: `element.addEventListener("lightning__showtoast", handler);`

Thanks, I didn't understood that. Can you please explain why?

Excellent, thank you. It was basically me getting confused, maybe I can submit a PR to the documentation saying that you need to be careful about default stubs not stubbing...

"Tests can be flaky, so don't run tests in CI"

💯 @MichaelChirico totally agree