web-component-tester

Web Component / HtmlElement : unit testing

陌路散爱 提交于 2019-12-01 10:45:47
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

JUnit formatted test output

懵懂的女人 提交于 2019-11-29 13:47:37
Jenkins doesn't notice my test cases being ran in Polymer and I am not so sure how to generate the correct JUnit file. With the web-component-tester how do I generate JUnit formatted test output? This package ended up doing the trick for me. Process $ npm install wct-xunit-reporter $ wct --plugin xunit-reporter or add config to wct.conf.js module.exports = { plugins: { local: { browsers: ['chrome'] }, sauce: false, 'xunit-reporter': { 'output': 'testfile.xml' } } }; Run web-component-tester $ wct 来源: https://stackoverflow.com/questions/38271876/junit-formatted-test-output

JUnit formatted test output

久未见 提交于 2019-11-28 07:32:06
问题 Jenkins doesn't notice my test cases being ran in Polymer and I am not so sure how to generate the correct JUnit file. With the web-component-tester how do I generate JUnit formatted test output? 回答1: This package ended up doing the trick for me. Process $ npm install wct-xunit-reporter $ wct --plugin xunit-reporter or add config to wct.conf.js module.exports = { plugins: { local: { browsers: ['chrome'] }, sauce: false, 'xunit-reporter': { 'output': 'testfile.xml' } } }; Run web-component