{"id":98,"date":"2016-11-11T09:18:08","date_gmt":"2016-11-11T09:18:08","guid":{"rendered":"http:\/\/blog.mozilla.org\/standard8\/?p=98"},"modified":"2016-11-11T09:18:08","modified_gmt":"2016-11-11T09:18:08","slug":"webextensions-an-example-add-on-repository-with-test-harnesses","status":"publish","type":"post","link":"https:\/\/blog.mozilla.org\/standard8\/2016\/11\/11\/webextensions-an-example-add-on-repository-with-test-harnesses\/","title":{"rendered":"WebExtensions: An Example Add-on Repository with Test Harnesses"},"content":{"rendered":"<p>I&#8217;ve created <a href=\"https:\/\/github.com\/Standard8\/example-webextension\">an example repository<\/a> for how you might set up tools to help development of a <a href=\"https:\/\/developer.mozilla.org\/Add-ons\/WebExtensions\">WebExtension<\/a>. Whilst there are others around, I&#8217;ve not heard of one that includes examples of tools for testing and auditing your extension.<\/p>\n<p>It is based on various ideas from projects I&#8217;ve been working alongside recently.<\/p>\n<p>The repository is intended to either be used as a starting point for constructing a new WebExtension, or you can take the various components and integrate them into your own repository.<\/p>\n<p>It is based around <a href=\"https:\/\/nodejs.org\/\">node\/npm<\/a> and the <a href=\"https:\/\/github.com\/mozilla\/web-ext\/\">web-ext<\/a> command line tool to keep it simple as possible. In addition it contains setup for:<\/p>\n<ul>\n<li><a href=\"https:\/\/en.wikipedia.org\/wiki\/Lint_(software)\">Linting<\/a><\/li>\n<li><a href=\"https:\/\/en.wikipedia.org\/wiki\/Unit_testing\">Unit Tests<\/a> with code coverage<\/li>\n<li><a href=\"https:\/\/en.wikipedia.org\/wiki\/Functional_testing\">Functional Tests<\/a><\/li>\n<\/ul>\n<p>All of these are also run automatically on landing or pull request via <a href=\"https:\/\/travis-ci.org\/\">Travis Ci<\/a> with <a href=\"https:\/\/coveralls.io\/\">Coveralls<\/a> providing code coverage reports.<\/p>\n<p>Finally, there&#8217;s a tool enabled on the repository for helping to keep modules up to date.<\/p>\n<p>If you find it helpful, let me know in the comment section. Please <a href=\"https:\/\/github.com\/Standard8\/example-webextension\/issues\">raise any issues<\/a> that you find, or submit pull requests, I welcome either.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve created an example repository for how you might set up tools to help development of a WebExtension. Whilst there are others around, I&#8217;ve not heard of one that includes examples of tools for testing and auditing your extension. It &hellip; <a href=\"https:\/\/blog.mozilla.org\/standard8\/2016\/11\/11\/webextensions-an-example-add-on-repository-with-test-harnesses\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":363,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30,5],"tags":[42019,30,666,27787,610,278871],"_links":{"self":[{"href":"https:\/\/blog.mozilla.org\/standard8\/wp-json\/wp\/v2\/posts\/98"}],"collection":[{"href":"https:\/\/blog.mozilla.org\/standard8\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.mozilla.org\/standard8\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.mozilla.org\/standard8\/wp-json\/wp\/v2\/users\/363"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.mozilla.org\/standard8\/wp-json\/wp\/v2\/comments?post=98"}],"version-history":[{"count":0,"href":"https:\/\/blog.mozilla.org\/standard8\/wp-json\/wp\/v2\/posts\/98\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.mozilla.org\/standard8\/wp-json\/wp\/v2\/media?parent=98"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mozilla.org\/standard8\/wp-json\/wp\/v2\/categories?post=98"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mozilla.org\/standard8\/wp-json\/wp\/v2\/tags?post=98"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}