Web Component / HtmlElement : unit testing
I'm trying to test a web component. Here is my project structure : ├── package.json ├── src │ ├── app.js │ └── index.html └── test └── hello-world-test.html Here is my working code : class HelloWorld extends HTMLElement { connectedCallback () { this.innerHTML = 'Hello, World!' } } customElements.define('hello-world', HelloWorld); <!doctype html> <html> <head> <meta charset="utf-8"> <script src="app.js"></script> </head> <body> <hello-world></hello-world> </body> </html> I'm trying to test that web component with web-component-tester . I installed the utility globally : npm install -g web