A comprehensive web component compiler that transforms TypeScript and JSX code into standards-compliant web components with complete development toolchain.
75
Build a simple web component that displays a counter and emits custom events. Create E2E tests that listen for and verify these events.
Create a counter-button component that:
counterChanged event each time the count changes, with the new count as the event detailCreate E2E tests that:
counterChanged event when the increment button is clicked and verify it was emitted @testcounterChanged event detail contains the value 1 after one click @testcounterChanged event detail contains the value 3 after three clicks @test/**
* A counter button component that emits events on count changes
*/
export class CounterButton {
/**
* Current count value
*/
count: number;
/**
* Event emitted when counter changes, with the new count as detail
*/
counterChanged: EventEmitter<number>;
}@generates
Provides web component compilation and testing utilities.
@describes
Install with Tessl CLI
npx tessl i tessl/npm-stencil--coredocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10