Skip to content

Commit

Permalink
chore: Rename Jest example to help greenkeeper (dequelabs#871)
Browse files Browse the repository at this point in the history
* chore: rename jest example to help greenkeeper

plus signs are invalid in filenames/directories

Closes dequelabs#869

* chore: add config to jest_react example

Closes dequelabs#865
  • Loading branch information
marcysutton authored and WilcoFiers committed May 2, 2018
1 parent fff3511 commit 0e0e76e
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ module.exports = function (grunt) {
},
src: [
'lib/**/*.js', 'test/**/*.js', 'build/**/*.js',
'doc/**/*.js', '!doc/examples/jest+react/*.js', 'Gruntfile.js',
'doc/**/*.js', '!doc/examples/jest_react/*.js', 'Gruntfile.js',
'!**/node_modules/**/*.js'
]
}
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,21 @@ axe-core in Jest (using JSDOM and Enzyme).

* Node must be installed; please follow the directions at http://www.nodejs.org
to install it.
* Move to the `doc/examples/jest+react` directory
* Move to the `doc/examples/jest_react` directory
* `npm install` to install dependencies

## To run the example ##

* Move to the `doc/examples/jest+react` directory
* Move to the `doc/examples/jest_react` directory
* `npm test` to run Jasmine

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

Note: to work better with JSDOM (which has limited support for necessary DOM APIs),
the color-contrast and link-in-text-block rules have been disabled in this example.
You can test for these rules more reliably using full browser DOM integration
testing using [axe-webdriverjs](https://github.com/dequelabs/axe-webdriverjs).

## To modify the example ##

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ test('Link has no aXe violations', (done) => {
);
const linkNode = linkComponent.getDOMNode();

axe.run(linkNode, (err, { violations }) => {
const config = {
"rules": {
"color-contrast": { enabled: false },
"link-in-text-block": { enabled: false }
}
}
axe.run(linkNode, config, (err, { violations }) => {
expect(err).toBe(null);
expect(violations).toHaveLength(0);
done();
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion greenkeeper.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"default": {
"packages": [
"doc/examples/jasmine/package.json",
"doc/examples/jest+react/package.json",
"doc/examples/jest_react/package.json",
"doc/examples/mocha/package.json",
"doc/examples/phantomjs/package.json",
"doc/examples/qunit/package.json",
Expand Down

0 comments on commit 0e0e76e

Please sign in to comment.