Skip to content

Commit

Permalink
feat: Build combined fixtures and expectation files (#4)
Browse files Browse the repository at this point in the history
The idea behind this is to allow the tests not only to be run in a browser, but orchestrated from within the browser.

Currently the tests that rely on roles on the body ("application-alone-on-body-is-ignored" and "landmark-role-on-body") are not supported. Also the output HTML is not so neat, though can address this later.
  • Loading branch information
matatk authored May 11, 2019
1 parent e89d48a commit a0b0c8b
Show file tree
Hide file tree
Showing 13 changed files with 1,162 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 2017
"ecmaVersion": 2018
},
"root": true,
"rules": {
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,12 @@ iterator(function(meta, fixture, expectation) {

### Loading the fixture and expectation files directly

You could also read the various fixture and expectation files directly, and not use any of the above code.
The fixtures and expectations are provided in two formats:

* Individual fixtures and expectations can be found in the "fixtures/" and "expectations/" directories. These files are useful when running the tests from Node.
* A combined fixture file, containing all but two of the tests, can be found alongside a combined expectation file, in the "combined/" directory. These may be useful if your test runner runs inside a browser. The HTML file contains only the fixtures, in a series of `<div>` elements; it is not a fully-formed HTML document.

The reason why the combined files don't contain all of the test fixtures is that two ("application-alone-on-body-is-ignored" and "landmark-role-on-body") require an ARIA `role` attribute to be set on the `<body>` element.

Use as a benchmarking tool
--------------------------
Expand Down
7 changes: 6 additions & 1 deletion README.template.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,12 @@ INCLUDE-ITERATOR

### Loading the fixture and expectation files directly

You could also read the various fixture and expectation files directly, and not use any of the above code.
The fixtures and expectations are provided in two formats:

* Individual fixtures and expectations can be found in the "fixtures/" and "expectations/" directories. These files are useful when running the tests from Node.
* A combined fixture file, containing all but two of the tests, can be found alongside a combined expectation file, in the "combined/" directory. These may be useful if your test runner runs inside a browser. The HTML file contains only the fixtures, in a series of `<div>` elements; it is not a fully-formed HTML document.

The reason why the combined files don't contain all of the test fixtures is that two ("application-alone-on-body-is-ignored" and "landmark-role-on-body") require an ARIA `role` attribute to be set on the `<body>` element.

Use as a benchmarking tool
--------------------------
Expand Down
Loading

0 comments on commit a0b0c8b

Please sign in to comment.