ionic-team / stencil-component-starter

Minimal starter project for building shareable web components with Stencil
https://github.com/ionic-team/stencil
MIT License
278 stars 128 forks source link

enhancement: demonstrate how to import { flush, render } #71

Closed jgravois closed 4 years ago

jgravois commented 5 years ago

hi 👋 and thanks for this awesome project!

Stencil makes it easy to unit test your component (...) The testing framework (...) has a minimal API consisting of (...) render() and flush() (ref: https://stenciljs.com/docs/unit-testing)

after reading the Unit Testing doc above, i've been scratching my head trying to figure out where i'm supposed to import those two methods from so that i can call them from within the e2e.test.ts file that ships with the component starter.

i snooped around looking for reference implementations in core/src/components but i couldn't find anything there either.

if anyone can enlighten me i'd be more than happy to PR a :bread:crumb in the official doc.

jgravois commented 5 years ago

welp, i took another look at the documentation page i inquired about and it no longer mentions render() or flush().

to make things even stranger, the history for the raw source doesn't indicate that any changes have been made recently.

https://github.com/ionic-team/stencil-site/commits/master/src/docs/testing/unit-testing.md

to make things stranger still, this clone site is still hosting the copy that i saw a week ago on the unit testing page.

http://www.serkom.de/docs/testing/

render/flush

i was able to wire things up with the help of the doc that's still published though so, 🤷‍♂️ .