Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(mock-doc): add HTMLUListElement (#5169)
add a definition for `HTMLUListElement`. this allows `createElement` calls to return a mocked version of `HTMLUListElement` that passes `instanceof` calls. the `type` and `compact` properties were not implemented, as they are deprecated in the spec. prior to this commit, folks attempting to use an `HTMLUListElement` in a stencil test like so would receive an error: ```ts describe('my-component', () => { it('using HTMLUListElement works', async () => { const unorderedList = document.createElement('ul'); console.log(unorderedList instanceof HTMLUListElement); }); }); ``` ``` [46:08.8] jest args: --spec --e2e --max-workers=8 FAIL src/my-component.spec.ts my-component ✕ using HTMLUListElement works (4 ms) ● my-component › using HTMLUListElement works ReferenceError: HTMLUListElement is not defined 2 | it('using HTMLUListElement works', async () => { 3 | const unorderedList = document.createElement('ul'); > 4 | console.log(unorderedList instanceof HTMLUListElement); | ^ 5 | }); 6 | }); 7 | at Object.<anonymous> (src/my-component.spec.ts:4:42) ``` Fixes: #3382 STENCIL-466 bug: HTMLUListElement is not defined
- Loading branch information