Sha256: 7c19d97f0d9d61a15d965f7e4e6a7464012ad31921383c9df7c23f08fec2f629

Contents?: true

Size: 1.37 KB

Versions: 104

Compression:

Stored size: 1.37 KB

Contents

# Mocha README

This example demonstrates how to use aXe with the Mocha unit testing framework.

The unit test is in `test/a11y.js`, and has two test cases: One that shows the
expected results from HTML with no errors, and one that shows the expected
result from HTML with a single error.

## To configure the example

- Node must be installed; please follow the directions at http://www.nodejs.org
  to install it.
- `npm install -g grunt-cli` to install the Grunt task runner (may need to be
  run with `sudo` on Unix or as Administrator on Windows)
- Move to the `doc/examples/mocha` directory
- `npm install` to install dependencies

## To run the example

- Move to the `doc/examples/mocha` directory
- `grunt mocha` to run Mocha

You should see output indicating that the tests ran successfully, with zero
failures.

## To modify the example

To run the example on your own HTML, such as widgets or controls, insert the
HTML into the document, retrieve the root element of your widget (with e.g.,
`document.getElementById()`), and pass that as the first argument into a call
to `axe.run`.

The third argument to the `axe.run` call should be the function to test
the results. The example is simply looking at the count of violations, but much
more detailed information is available if desired. The aXe documentation
should be consulted for more details on customizing and
analyzing calls to `axe.run`.

Version data entries

104 entries across 104 versions & 1 rubygems

Version Path
govuk_publishing_components-21.16.3 node_modules/axe-core/doc/examples/mocha/README.md
govuk_publishing_components-21.16.2 node_modules/axe-core/doc/examples/mocha/README.md
govuk_publishing_components-21.16.1 node_modules/axe-core/doc/examples/mocha/README.md
govuk_publishing_components-21.16.0 node_modules/axe-core/doc/examples/mocha/README.md
govuk_publishing_components-21.15.2 node_modules/axe-core/doc/examples/mocha/README.md
govuk_publishing_components-21.15.1 node_modules/axe-core/doc/examples/mocha/README.md
govuk_publishing_components-21.15.0 node_modules/axe-core/doc/examples/mocha/README.md
govuk_publishing_components-21.14.0 node_modules/axe-core/doc/examples/mocha/README.md
govuk_publishing_components-21.13.5 node_modules/axe-core/doc/examples/mocha/README.md
govuk_publishing_components-21.13.4 node_modules/axe-core/doc/examples/mocha/README.md
govuk_publishing_components-21.13.3 node_modules/axe-core/doc/examples/mocha/README.md
govuk_publishing_components-21.13.2 node_modules/axe-core/doc/examples/mocha/README.md
govuk_publishing_components-21.13.1 node_modules/axe-core/doc/examples/mocha/README.md
govuk_publishing_components-21.13.0 node_modules/axe-core/doc/examples/mocha/README.md
govuk_publishing_components-21.12.0 node_modules/axe-core/doc/examples/mocha/README.md
govuk_publishing_components-21.11.0 node_modules/axe-core/doc/examples/mocha/README.md
govuk_publishing_components-21.10.0 node_modules/axe-core/doc/examples/mocha/README.md
govuk_publishing_components-21.9.0 node_modules/axe-core/doc/examples/mocha/README.md
govuk_publishing_components-21.8.1 node_modules/axe-core/doc/examples/mocha/README.md
govuk_publishing_components-21.8.0 node_modules/axe-core/doc/examples/mocha/README.md