salesforce / lightning-labs

MIT License
3 stars 4 forks source link

fix: bug in errorInConnectedCallbackAssertion that disallowed inverse usage of the assertion #16

Closed divmain closed 1 month ago

divmain commented 1 month ago

An assertion matcher could be used in this way:

 await expect(async () => {
  await renderToMarkup(componentPath, badProps);
}).to.throwErrorInConnectedCallback();

However, the following would fail:

 await expect(async () => {
  await renderToMarkup(componentPath, goodProps);
}).to.not.throwErrorInConnectedCallback();

The fix allows to.not.throwErrorInConnectedCallback to be used successfully.