### Installing Dependencies
Source: https://github.com/dequelabs/axe-core/blob/develop/doc/examples/mocha/README.md
Command to install project dependencies for the Mocha example.
```bash
npm install
```
--------------------------------
### checkSetup Returns Example
Source: https://github.com/dequelabs/axe-core/blob/develop/doc/developer-guide.md
Example structure of the array returned by checkSetup.
```javascript
[node, options, virtualNode];
```
--------------------------------
### fixtureSetup Test Example
Source: https://github.com/dequelabs/axe-core/blob/develop/doc/developer-guide.md
Example of using fixtureSetup to inject content and cache the flattened DOM tree for testing.
```javascript
it(
'should return true if there is only one ' +
type +
' element with the same name',
function () {
axe.testUtils.fixtureSetup(
'' +
''
);
var node = fixture.querySelector('#target');
assert.isTrue(check.evaluate.call(checkContext, node));
}
);
```
--------------------------------
### Running the example
Source: https://github.com/dequelabs/axe-core/blob/develop/doc/examples/puppeteer/README.md
Instructions on how to set up and run the axe-puppeteer example.
```bash
npm install
node axe-puppeteer.js http://www.deque.com
```
--------------------------------
### Running the example
Source: https://github.com/dequelabs/axe-core/blob/develop/doc/examples/chrome-debugging-protocol/README.md
Commands to set up and run the axe-core Chrome Debugging Protocol example.
```bash
npm install
google-chrome --headless --remote-debugging-port=9222
node axe-cdp.js http://www.deque.com
```
--------------------------------
### checkSetup Test Example
Source: https://github.com/dequelabs/axe-core/blob/develop/doc/developer-guide.md
Example of using checkSetup to create check arguments for testing.
```javascript
it('should return true when all content is inside the region', function () {
var checkArgs = checkSetup(
'
'
);
assert.isTrue(checks.region.evaluate.apply(checkContext, checkArgs));
assert.equal(checkContext._relatedNodes.length, 0);
});
```
--------------------------------
### Rule Generation CLI Wizard Example
Source: https://github.com/dequelabs/axe-core/blob/develop/doc/developer-guide.md
Example interaction with the rule generation CLI wizard, showing questions and sample answers.
```sh
- What is the name of the RULE? (Eg: aria-valid): sample-rule
- Does the RULE need a MATCHES file to be created?: Yes
- Would you like to create a CHECK for the RULE?: No
- Would you like to create UNIT test files? Yes
- Would you like to create INTEGRATION test files? Yes
```
--------------------------------
### Running Full Integration Tests
Source: https://github.com/dequelabs/axe-core/blob/develop/doc/developer-guide.md
Commands to start a local server for running full integration tests.
```bash
npm start
```
--------------------------------
### Starting Web Server
Source: https://github.com/dequelabs/axe-core/blob/develop/CONTRIBUTING.md
Commands to start the web server using grunt for local development and testing.
```console
cd axe-core
grunt connect watch
```
--------------------------------
### shadowSupport Test Example
Source: https://github.com/dequelabs/axe-core/blob/develop/doc/developer-guide.md
Example of using shadowSupport to conditionally run tests based on Shadow DOM support.
```javascript
(axe.testUtils.shadowSupport.v1 ? it : xit)(
'should test Shadow tree content',
function () {
// The rest of the shadow DOM test
}
);
```
--------------------------------
### Running Specific Unit Tests
Source: https://github.com/dequelabs/axe-core/blob/develop/doc/developer-guide.md
Examples of npm scripts to run specific sets of unit tests.
```bash
npm run test:unit:core
```
```bash
npm run test:unit:commons
```
```bash
npm run test:unit:checks
```
```bash
npm run test:unit:rule-matches
```
```bash
npm run test:unit:integration
```
```bash
npm run test:unit:virtual-rules
```
```bash
npm run test:unit:api
```
--------------------------------
### Test Setup
Source: https://github.com/dequelabs/axe-core/blob/develop/test/integration/full/heading-order/partial-context.html
Initializes Mocha and Chai for testing.
```javascript
frame exclude test mocha.setup({ timeout: 10000, ui: 'bdd' }); var assert = chai.assert;
```
--------------------------------
### Test Page Setup and Styles
Source: https://github.com/dequelabs/axe-core/blob/develop/test/integration/full/contrast/sticky-header.html
Initial setup for the test page, including Mocha configuration, assertions, and basic CSS for layout and sticky header/footer.
```javascript
mocha.setup({ timeout: 10000, ui: 'bdd' });
var assert = chai.assert;
```
```css
{ box-sizing: border-box; }
html, body {
padding: 0;
margin: 0;
height: 100%;
background: #fff;
color: #000;
}
header {
top: 0;
}
footer {
bottom: 0;
}
header, footer {
padding: 20px;
position: fixed;
left: 0;
right: 0;
height: 80px;
background: #000;
color: #fff;
z-index: 2;
}
main {
position: relative;
z-index: 1;
left: 1px;
padding: 80px 20px;
}
```
--------------------------------
### Shadow DOM Support Example
Source: https://github.com/dequelabs/axe-core/blob/develop/doc/developer-guide.md
Illustrates how to handle open Shadow DOM by using virtual DOM representations for commons functions. It shows the separation of DOM lookup and the core logic into distinct functions.
```javascript
// lib/commons/text/accessible-text.js
import { getNodeFromTree } from '../../core/utils';
import accessibleTextVirtual from './accessible-text-virtual';
function accessibleText(element, inLabelledbyContext) {
let virtualNode = getNodeFromTree(axe._tree[0], element); // throws an exception on purpose if axe._tree not correct
return accessibleTextVirtual(virtualNode, inLabelledbyContext);
}
export default accessibleText;
// lib/commons/text/accessible-text-virtual.js
function accessibleTextVirtual(element, inLabelledbyContext) {
// rest of the commons code minus the virtual tree lookup, since it’s passed in
}
```
--------------------------------
### Integration Test — Rule JSON File (iframe example)
Source: https://github.com/dequelabs/axe-core/blob/develop/doc/examples/test-patterns.md
Example of a JSON file for integration testing rules within iframes, showing how to specify elements inside iframes.
```json
{
"violations": [["iframe", "#fail-inside-iframe"]]
}
```
--------------------------------
### Install axe-core
Source: https://github.com/dequelabs/axe-core/blob/develop/README.md
Download the package using npm.
```console
npm install axe-core --save-dev
```
--------------------------------
### Mocha Test Command
Source: https://github.com/dequelabs/axe-core/blob/develop/doc/examples/jest_react/README.md
Example command to run Mocha tests with jsdom-global/register for JSDOM compatibility.
```sh
mocha *.test.js --require jsdom-global/register
```
--------------------------------
### Mocha Setup
Source: https://github.com/dequelabs/axe-core/blob/develop/test/integration/full/isolated-env/isolated-env.html
Initial setup for Mocha tests, including timeout and assertion library.
```javascript
all rules test mocha.setup({ timeout: 10000, ui: 'bdd' }); var assert = chai.assert;
```
--------------------------------
### Running Non-Unit Tests
Source: https://github.com/dequelabs/axe-core/blob/develop/doc/developer-guide.md
Examples of npm scripts to run specific non-unit tests.
```bash
npm run test:act
```
```bash
npm run test:apg
```
```bash
npm run test:examples
```
```bash
npm run test:locales
```
```bash
npm run test:node
```
```bash
npm run test:tsc
```
--------------------------------
### Test Setup and Assertion
Source: https://github.com/dequelabs/axe-core/blob/develop/test/integration/full/landmark-one-main/landmark-one-main-pass3.html
This snippet shows the Mocha test setup with a timeout and the assertion library initialization using Chai.
```javascript
.sr-only { border: 0; clip: rect(0 0 0 0); clip-path: polygon(0px 0px, 0px 0px, 0px 0px); -webkit-clip-path: polygon(0px 0px, 0px 0px, 0px 0px); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; white-space: nowrap; }
mocha.setup({ timeout: 10000, ui: 'bdd' });
var assert = chai.assert;
```
--------------------------------
### Breaking Change Example
Source: https://github.com/dequelabs/axe-core/blob/develop/doc/code-submission-guidelines.md
An example of how to format a commit message to indicate a breaking change.
```sh
feat(rules): remove deprecated rules
BREAKING CHANGE: remove rules: th-has-headers, checkboxgroup, radiogroup
```
--------------------------------
### TypeScript Example
Source: https://github.com/dequelabs/axe-core/blob/develop/CONTRIBUTING.md
Example of how to import axe-core's type definition and run accessibility tests in a TypeScript project.
```javascript
import * as axe from 'axe-core';
describe('Module', () => {
it('should have no accessibility violations', done => {
axe.run(compiledFixture).then(results => {
expect(results.violations.length).toBe(0);
done();
}, done);
});
});
```
--------------------------------
### Example Commit Message
Source: https://github.com/dequelabs/axe-core/blob/develop/doc/code-submission-guidelines.md
A practical example of a commit message following the specified format.
```sh
perf(rule): improve speed of color contrast rules
Use async process to compare elements without UI lockup
Closes issue #1
```
--------------------------------
### Test Setup and DOM Manipulation
Source: https://github.com/dequelabs/axe-core/blob/develop/test/integration/full/landmark-one-main/landmark-one-main-pass1.html
This snippet shows the test setup using mocha and chai, and the DOM manipulation required to create a second HTML element for testing purposes, as direct HTML parsing is insufficient.
```javascript
mocha.setup({ timeout: 10000, ui: 'bdd' });
var assert = chai.assert;
// only way to get a 2nd html element on the page is to create it with createElement // if you try to do it through the html parser it won't work
var root = document.createElement('html');
document.getElementById('additional').append(root);
```
--------------------------------
### Mocha Setup
Source: https://github.com/dequelabs/axe-core/blob/develop/test/integration/full/preload/preload.html
Sets up Mocha for testing with a timeout and UI.
```javascript
mocha.setup({ timeout: 50000, ui: 'bdd' });
var assert = chai.assert;
```
--------------------------------
### Example of nested execution flow
Source: https://github.com/dequelabs/axe-core/blob/develop/doc/code-submission-guidelines.md
This code example demonstrates a nested execution flow, which is contrasted with the return early pattern.
```javascript
import path from 'path';
import { promises as fs } from 'fs';
export default async function validateAxeReport(filePath = '') {
let valid;
let file;
let results;
if (filePath.trim()) {
try {
if (!path.isAbsolute(filePath)) {
filePath = path.relative(process.cwd(), filePath);
}
file = await fs.readFile(filePath, 'utf8');
} catch (err) {
throw new Error(`Unable to read file "${filePath}"`);
}
try {
results = JSON.parse(file);
} catch (err) {
throw new TypeError(`File "${filePath}" is not a valid JSON file`);
}
if (results?.testRunner?.name !== 'axe') {
throw new TypeError(`File "${filePath}" is not a valid axe results file`);
}
valid = validateReportStructure(results);
} else {
throw new SyntaxError('No file path provided');
}
return valid;
}
```
--------------------------------
### Example 3: Running axe with specific rules and a callback
Source: https://github.com/dequelabs/axe-core/blob/develop/doc/API.md
This example demonstrates how to run axe, enable specific experimental rules, and log the results to the console.
```javascript
axe.run(
document,
{
rules: {
'link-in-text-block': { enabled: true },
'p-as-heading': { enabled: true }
}
},
function (err, results) {
if (err) throw err;
console.log(results);
}
);
```
--------------------------------
### Integration Test HTML Example
Source: https://github.com/dequelabs/axe-core/blob/develop/doc/code-submission-guidelines.md
Example of adding a new HTML element with a unique ID for an integration test.
```html
fail
```
--------------------------------
### Integration Test JSON Example
Source: https://github.com/dequelabs/axe-core/blob/develop/doc/code-submission-guidelines.md
Example of updating the companion JSON file to include the new element ID in the violations array.
```json
{
"description": "aria-roles tests",
"rule": "aria-roles",
"violations": [
["#fail1"],
["#fail2"],
["#fail-command"]
]
}
```
--------------------------------
### Example of DocBlock comment
Source: https://github.com/dequelabs/axe-core/blob/develop/doc/code-submission-guidelines.md
This code example shows the usage of DocBlock comments to describe a function, its parameters, and its return value.
```typescript
/**
* Calculate the distance between two points.
* @param {number[]} pointA The first point represented by the array [x,y]
* @param {number[]} pointB The second point represented by the array [x,y]
* @return {number}
*/
function distance(pointA, pointB) {
return Math.hypot(pointA[0] - pointB[0], pointA[1] - pointB[1]);
}
```
--------------------------------
### JSDoc for Functions
Source: https://github.com/dequelabs/axe-core/blob/develop/CONTRIBUTING.md
Example of JSDoc style documentation for functions.
```javascript
/**
* Runs the Audit; which in turn should call `run` on each rule.
* @async
* @param {Context} context The scope definition/context for analysis (include/exclude)
* @param {Object} options Options object to pass into rules and/or disable rules or checks
* @param {Function} fn Callback function to fire when audit is complete
*/
```
--------------------------------
### Configure locale at runtime
Source: https://github.com/dequelabs/axe-core/blob/develop/README.md
Example of how to configure the locale at runtime using `axe.configure()`.
```javascript
axe.configure({
locale: {
lang: 'de',
rules: {
accesskeys: {
help: 'Der Wert des accesskey-Attributes muss einzigartig sein.'
}
// ...
},
checks: {
abstractrole: {
fail: 'Abstrakte ARIA-Rollen dürfen nicht direkt verwendet werden.'
},
'aria-errormessage': {
// Note: doT (https://github.com/olado/dot) templates are supported here.
fail: 'Der Wert der aria-errormessage ${data.values}` muss eine Technik verwenden, um die Message anzukündigen (z. B., aria-live, aria-describedby, role=alert, etc.).'
}
// ...
}
}
});
```
--------------------------------
### Example of return early coding
Source: https://github.com/dequelabs/axe-core/blob/develop/doc/code-submission-guidelines.md
This code example demonstrates the return early coding pattern, where the main execution flow is kept to the left column and errors/edge cases are handled with if statements.
```javascript
import path from 'path';
import { promises as fs } from 'fs';
export default async function validateAxeReport(filePath = '') {
if (!filePath.trim()) {
throw new SyntaxError('No file path provided');
}
if (!path.isAbsolute(filePath)) {
filePath = path.relative(process.cwd(), filePath);
}
let file;
try {
file = await fs.readFile(filePath, 'utf8');
} catch (err) {
throw new Error(`Unable to read file "${filePath}"`);
}
let results;
try {
results = JSON.parse(file);
} catch (err) {
throw new TypeError(`File "${filePath}" is not a valid JSON file`);
}
if (results?.testRunner?.name !== 'axe') {
throw new TypeError(`File "${filePath}" is not a valid axe results file`);
}
return validateReportStructure(results);
}
```
--------------------------------
### MockCheckContext Returns Example
Source: https://github.com/dequelabs/axe-core/blob/develop/doc/developer-guide.md
Example structure of the object returned by MockCheckContext.
```javascript
{
data: (){},
relatedNodes: (){},
reset: (){}
}
```
--------------------------------
### Run Example Tests
Source: https://github.com/dequelabs/axe-core/blob/develop/CONTRIBUTING.md
Command to run tests from doc/examples/* using the local build.
```bash
npm run test:examples
```
--------------------------------
### axe.utils.getNodeFromTree Returns Example
Source: https://github.com/dequelabs/axe-core/blob/develop/doc/developer-guide.md
Example structure of a returned virtual node object.
```javascript
{
actualNode: div,
children: [virtualNodes],
shadowId: undefined
}
```
--------------------------------
### axe.utils.getFlattenedTree Returns Example
Source: https://github.com/dequelabs/axe-core/blob/develop/doc/developer-guide.md
Example structure of the returned virtual node array.
```javascript
[
{
actualNode: body,
children: [virtualNodes],
shadowId: undefined
}
];
```
--------------------------------
### Hello World
Source: https://github.com/dequelabs/axe-core/blob/develop/test/playground.html
A basic example of running axe-core with the 'color-contrast' rule and logging the results.
```javascript
axe.testUtils.awaitNestedLoad( window, () => { axe.run( { runOnly: 'color-contrast', elementRef: true }, (err, results) => { console.log(err || results); } ); }, err => console.error(err) );
```
--------------------------------
### Test Setup
Source: https://github.com/dequelabs/axe-core/blob/develop/test/integration/full/landmark-contentinfo-is-top-level/landmark-contentinfo-is-top-level-pass.html
Initializes Mocha and Chai for testing.
```javascript
landmark-contentinfo-is-top-level test mocha.setup({ timeout: 10000, ui: 'bdd' }); var assert = chai.assert;
```
--------------------------------
### MockCheckContext Test Example
Source: https://github.com/dequelabs/axe-core/blob/develop/doc/developer-guide.md
Example of using MockCheckContext in a test to mock and reset data and relatedNodes.
```javascript
describe('region', function () {
var fixture = document.getElementById('fixture');
var checkContext = new axe.testUtils.MockCheckContext();
afterEach(function () {
fixture.innerHTML = '';
checkContext.reset();
});
it('should return true when all content is inside the region', function () {
assert.isTrue(checks.region.evaluate.apply(checkContext, checkArgs));
assert.equal(checkContext._relatedNodes.length, 0);
});
});
```
--------------------------------
### Check 'after' function example
Source: https://github.com/dequelabs/axe-core/blob/develop/doc/developer-guide.md
An example of an 'after' function used to filter results, ensuring only one violation per instance of a duplicate ID is found.
```javascript
var uniqueIds = [];
return results.filter(function (r) {
if (uniqueIds.indexOf(r.data) === -1) {
uniqueIds.push(r.data);
return true;
}
return false;
});
```
--------------------------------
### Test Setup
Source: https://github.com/dequelabs/axe-core/blob/develop/test/integration/full/landmark-complementary-is-top-level/landmark-complementary-is-top-level-fail.html
Initializes Mocha and Chai for testing.
```javascript
landmark-complementary-is-top-level test mocha.setup({ timeout: 10000, ui: 'bdd' }); var assert = chai.assert;
```
--------------------------------
### Skip Link Test Setup and Assertion
Source: https://github.com/dequelabs/axe-core/blob/develop/test/integration/full/skip-link/skip-link-fail.html
This snippet shows the Mocha test setup and an example of a failing skip link assertion within the test file.
```javascript
skip-link test mocha.setup({ timeout: 10000, ui: 'bdd' }); var assert = chai.assert; [bad link 1](#fail1-tgt)
```
--------------------------------
### Invoke Rule Generator
Source: https://github.com/dequelabs/axe-core/blob/develop/doc/developer-guide.md
Command to start the axe-core rule generation CLI.
```sh
npm run rule-gen
```
--------------------------------
### Test Setup
Source: https://github.com/dequelabs/axe-core/blob/develop/test/integration/full/landmark-banner-is-top-level/landmark-banner-is-top-level-fail.html
Initializes Mocha and Chai for testing.
```javascript
landmark-banner-is-top-level test mocha.setup({ timeout: 10000, ui: 'bdd' }); var assert = chai.assert;
```
--------------------------------
### DqElement Class Usage
Source: https://github.com/dequelabs/axe-core/blob/develop/doc/developer-guide.md
Example of how to instantiate the DqElement class to serialize an HTMLElement.
```javascript
var firstH1 = document.getElementByTagName('h1')[0];
var dqH1 = new axe.utils.DqElement(firstH1);
```
--------------------------------
### Debugging Specific Test Directories
Source: https://github.com/dequelabs/axe-core/blob/develop/doc/developer-guide.md
Example of debugging tests with the 'testDirs' argument.
```bash
npm run test:debug -- testDirs=core
```
--------------------------------
### Contrast Incomplete test setup
Source: https://github.com/dequelabs/axe-core/blob/develop/test/integration/full/incomplete/color-contrast.html
Initializes Mocha and Chai for testing.
```javascript
Contrast Incomplete test mocha.setup({ timeout: 10000, ui: 'bdd' }); var assert = chai.assert;
```
--------------------------------
### Basic Plugin Instance
Source: https://github.com/dequelabs/axe-core/blob/develop/doc/plugins.md
An example implementation of a basic 'highlight' plugin for axe-core, demonstrating the structure and methods required for a plugin.
```javascript
var highlight = {
id: 'highlight',
highlighter: new Highlighter(),
run: function (contextNode, options, done) {
var that = this;
Array.prototype.slice
.call(contextNode.querySelectorAll(options.selector))
.forEach(function (node) {
that.highlighter.highlight(node, options);
});
done();
},
cleanup: function (done) {
this.highlighter.clear();
done();
}
};
axe.plugins.doStuff.add(highlight);
```
--------------------------------
### Test Setup
Source: https://github.com/dequelabs/axe-core/blob/develop/test/integration/full/landmark-no-duplicate-banner/landmark-no-duplicate-banner-fail.html
Sets up the Mocha testing environment and Chai assertions.
```javascript
mocha.setup({ timeout: 10000, ui: 'bdd' }); var assert = chai.assert;
```
--------------------------------
### Pass, Fail, and Incomplete Message Templates
Source: https://github.com/dequelabs/axe-core/blob/develop/doc/developer-guide.md
Example of message templates for a Check, demonstrating how to include dynamic data in pass, fail, and incomplete messages.
```json
"messages": {
"pass": "ARIA attributes are used correctly for the defined role",
"fail": {
"singular": "ARIA attribute is not allowed: ${data.values}",
"plural": "ARIA attributes are not allowed: ${data.values}"
},
"incomplete": "axe-core couldn't tell because of ${data.missingData}"
```
--------------------------------
### Running Mocha Tests
Source: https://github.com/dequelabs/axe-core/blob/develop/doc/examples/mocha/README.md
Command to run the accessibility tests using Mocha.
```bash
npm test
```
--------------------------------
### Test Setup and Assertions
Source: https://github.com/dequelabs/axe-core/blob/develop/test/integration/full/contrast/memory.html
Initializes Mocha with a timeout and sets up Chai assertions for the test environment.
```javascript
mocha.setup({ timeout: 2000, ui: 'bdd' });
var assert = chai.assert;
```
--------------------------------
### Basic usage of runPartial and finishRun
Source: https://github.com/dequelabs/axe-core/blob/develop/doc/run-partial.md
Demonstrates the basic workflow of calling runPartial recursively and then finishRun with the collected results.
```javascript
const partialResults = await Promise.all(runPartialRecursive(context, options));
const axeResults = await axe.finishRun(partialResults, options);
```
--------------------------------
### Virtual Node vs HTMLElement
Source: https://github.com/dequelabs/axe-core/blob/develop/doc/examples/code-patterns.md
Guidance on when to use Virtual Nodes versus HTMLElements in JavaScript, recommending Virtual Nodes for attribute and property access and real DOM nodes for DOM APIs.
```javascript
// Use Virtual Node for attribute access and property reads
function myCheck(node, options, virtualNode) {
const role = virtualNode.attr('role'); // Cached attribute access
const nodeName = virtualNode.props.nodeName;
// Only access real node when you need DOM APIs
const rect = node.getBoundingClientRect();
const rootNode = node.getRootNode();
}
// Convert ambiguous input using nodeLookup
import nodeLookup from '../../core/utils/node-lookup';
function myFunction(nodeOrVirtual) {
const { vNode, domNode } = nodeLookup(nodeOrVirtual);
// vNode = VirtualNode, domNode = real DOM node
}
```
--------------------------------
### Meta Element Variant Example
Source: https://github.com/dequelabs/axe-core/blob/develop/doc/standards-object.md
Example demonstrating how the 'variant' property in the htmlElms object can define different properties for an element based on its attributes. This specific example shows the 'meta' element, which has a different 'contentTypes' property when the 'itemprop' attribute is present.
```javascript
meta: {
variant: {
itemprop: {
matches: '[itemprop]',
contentTypes: ['phrasing', 'flow']
}
},
allowedRoles: false,
noAriaAttrs: true
}
```
--------------------------------
### allowedOrigins Configuration Example
Source: https://github.com/dequelabs/axe-core/blob/develop/doc/API.md
Example of how to configure allowedOrigins to permit communication between frames of different origins.
```javascript
axe.configure({
allowedOrigins: ['', 'https://deque.com']
});
```
--------------------------------
### Shadow DOM Test
Source: https://github.com/dequelabs/axe-core/blob/develop/doc/examples/test-patterns.md
Example of a test case designed to work with Shadow DOM content.
```javascript
it('should work with Shadow DOM', function () {
const vNode = queryShadowFixture(
'',
'
Test
'
);
// Test your function against the shadow DOM content
});
```
--------------------------------
### Plugin Test Setup
Source: https://github.com/dequelabs/axe-core/blob/develop/test/integration/full/plugin/plugin.html
Initializes mocha for plugin testing with a timeout and sets up chai assertions.
```javascript
Plugin Test mocha.setup({ timeout: 10000, ui: 'bdd' }); var assert = chai.assert;
```
--------------------------------
### Incomplete message string example
Source: https://github.com/dequelabs/axe-core/blob/develop/doc/rule-development.md
An example of how to define pass, fail, and incomplete messages for a check, specifically showing an incomplete message as a string.
```javascript
messages: {
pass: 'Why the check passed',
fail: 'Why the check failed',
incomplete: 'Why the check returned undefined'
}
```