Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: tests/README.md

Issue 29723623: Issue 6487 - IOElement as base component for ABP UI (Closed)
Patch Set: Created March 15, 2018, 2:42 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« js/io-element.js ('K') | « package.json ('k') | tests/background.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/README.md
===================================================================
new file mode 100644
--- /dev/null
+++ b/tests/README.md
@@ -0,0 +1,48 @@
+# Testing Adblock Plus UI Components
+
+All components should have a corresponding
+_component-name.html_ file to reach and test
+via all our target browsers.
+
+Such file should contain all the necessary to
+bootstrap ABP UI like environment and test such component.
+
+
+## component-name.test.js
+
+This should be file loaded, as deferred, at the bottom
+of _component-name.html_ scripts list.
+
+The file should, at least, include the component it's testing.
+
+Example:
+
+```js
+/* globals module, require */
+
+"use strict";
+
+const IOParagraph = require("../js/io-paragraph");
+
+document.body.appendChild(
+ new IOParagraph("some content")
+);
+```
+
+
+## bundle & test via package.json
+
+Once there is a `.test` file, ensure it's built properly
+like it is, as example, for the `test:io-element.js` case.
+
+Ensure the built target is, as example, `tests/io-paragraph.js`,
+and add `npm run test:io-paragraph.js` to the generic
+`test` entry in the _package.json_ file.
+
+`npm test` should build and bundle all tests, but we want
+to be able to test a single component too.
+
+
+## test on browsers
+Simply run `npm start` and reach `localhost:XXXX/tests` folder
+with all target browsers you need to verify the component.
« js/io-element.js ('K') | « package.json ('k') | tests/background.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld