liveBook · Manning

Karma-web-components

As explained in Web Components in Action

karma-web-components is a Karma plugin that enables HTML test files and waits for Web Components readiness before running tests.

karma-web-components extends Karma with HTML test files and waits for the browser’s WebComponentsReady event before starting tests. section 13.3

HTML slider test

A karma-wc-test.html page loads the slider module, loads framework.js, places a wcia-slider element in the body, and retains the existing test suite.

How Web Components in Action covers it

How deep it goes
Defines installation, client loading, registration, and file serving, but defers the plugin’s internals.
Examples
Uses a slider HTML fixture with a module script, framework.js, custom element, styles, and existing tests.
What it assumes
Assumes an existing Karma setup and component files while teaching the plugin’s installation and integration points.
What you can do after
Operate/configure Karma to run Web Components tests from HTML files after component readiness.
How it connects
Connects Karma with HTML test files, Web Components readiness, Mocha, Chai, and WCT-like runner flows.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Web Components in Action. The section links point to the parts of the book it draws on.