-
Notifications
You must be signed in to change notification settings - Fork 392
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use more helpful error message for invalid render() return value…
… @W-14785069 (#3943) * fix: use more helpful error message for invalid render() return value * fix: use tag name in error instead of [object Object] * test(render): assert helpful error thrown on invalid render * chore: remove unnecessary optional parameter * fix: use suggested matcher * refactor(template): remove redundant validation The `isTemplateRegistered` check inside `runWithBoundaryProtection` is equivalent, but more robust, and with a more clear error message. * test: expect non-dev error * fix: print tag name instead of "[object Object]" * fix: assert template is defined before using it * fix: consolidate errors that cover the same case an undefined template cannot be registered, so the `isTemplateRegistered` check is sufficient
- Loading branch information
Showing
4 changed files
with
27 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
...integration-karma/test/component/LightningElement.render/x/renderInvalid/renderInvalid.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { LightningElement } from 'lwc'; | ||
|
||
export default class RenderInvalid extends LightningElement { | ||
render() { | ||
return undefined; | ||
} | ||
} |