Sha256: 68c92e6fcce1dd0fe52da976d03c2cc6e5b23443c7ae1c02627aaf92e7d60709

Contents?: true

Size: 1.25 KB

Versions: 271

Compression:

Stored size: 1.25 KB

Contents

# Jasmine README

This example demonstrates how to use axe with the Jasmine unit testing framework.

The unit test is in `spec/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.
- Move to the `doc/examples/jasmine` directory
- `npm install` to install dependencies

## To run the example

- Move to the `doc/examples/jasmine` directory
- `npm test` to run Jasmine

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

271 entries across 271 versions & 1 rubygems

Version Path
govuk_publishing_components-30.4.1 node_modules/axe-core/doc/examples/jasmine/README.md
govuk_publishing_components-30.4.0 node_modules/axe-core/doc/examples/jasmine/README.md
govuk_publishing_components-30.3.0 node_modules/axe-core/doc/examples/jasmine/README.md
govuk_publishing_components-30.2.1 node_modules/axe-core/doc/examples/jasmine/README.md
govuk_publishing_components-30.2.0 node_modules/axe-core/doc/examples/jasmine/README.md
govuk_publishing_components-30.1.0 node_modules/axe-core/doc/examples/jasmine/README.md
govuk_publishing_components-30.0.0 node_modules/axe-core/doc/examples/jasmine/README.md
govuk_publishing_components-29.15.3 node_modules/axe-core/doc/examples/jasmine/README.md
govuk_publishing_components-29.15.2 node_modules/axe-core/doc/examples/jasmine/README.md
govuk_publishing_components-29.15.1 node_modules/axe-core/doc/examples/jasmine/README.md
govuk_publishing_components-29.15.0 node_modules/axe-core/doc/examples/jasmine/README.md
govuk_publishing_components-29.14.0 node_modules/axe-core/doc/examples/jasmine/README.md
govuk_publishing_components-29.13.0 node_modules/axe-core/doc/examples/jasmine/README.md
govuk_publishing_components-29.12.1 node_modules/axe-core/doc/examples/jasmine/README.md
govuk_publishing_components-29.12.0 node_modules/axe-core/doc/examples/jasmine/README.md
govuk_publishing_components-29.11.0 node_modules/axe-core/doc/examples/jasmine/README.md
govuk_publishing_components-29.10.0 node_modules/axe-core/doc/examples/jasmine/README.md
govuk_publishing_components-29.9.0 node_modules/axe-core/doc/examples/jasmine/README.md
govuk_publishing_components-29.8.0 node_modules/axe-core/doc/examples/jasmine/README.md
govuk_publishing_components-29.7.0 node_modules/axe-core/doc/examples/jasmine/README.md