CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-stencil--core

A comprehensive web component compiler that transforms TypeScript and JSX code into standards-compliant web components with complete development toolchain.

75

1.44x
Overview
Eval results
Files

rubric.jsonevals/scenario-6/

{
  "context": "This criteria evaluates the engineer's ability to use Stencil's custom Jest matchers for testing event emissions in web components. The focus is on proper usage of toHaveReceivedEvent(), toHaveReceivedEventTimes(), and toHaveReceivedEventDetail() matchers.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Event spy creation",
      "description": "Uses page.spyOnEvent() or similar method to create event spies for the custom events ('counterChanged' and 'counterReset') before triggering actions",
      "max_score": 15
    },
    {
      "name": "toHaveReceivedEvent usage",
      "description": "Uses toHaveReceivedEvent() matcher to verify that events were emitted after user actions (e.g., expect(spy).toHaveReceivedEvent())",
      "max_score": 20
    },
    {
      "name": "toHaveReceivedEventTimes usage",
      "description": "Uses toHaveReceivedEventTimes() matcher to verify the exact number of times an event was emitted (e.g., expect(spy).toHaveReceivedEventTimes(3))",
      "max_score": 25
    },
    {
      "name": "toHaveReceivedEventDetail usage",
      "description": "Uses toHaveReceivedEventDetail() matcher to verify the event detail payload matches expected values (e.g., expect(spy).toHaveReceivedEventDetail({ value: 1, action: 'increment' }))",
      "max_score": 25
    },
    {
      "name": "Test setup",
      "description": "Uses newSpecPage() to create a proper testing environment for the component with necessary configuration",
      "max_score": 10
    },
    {
      "name": "Event emission",
      "description": "Properly emits events using EventEmitter.emit() in the component implementation with correct event details",
      "max_score": 5
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/npm-stencil--core

tile.json