Skip to content

Commit

Permalink
Merge branch 'develop' into patch-1
Browse files Browse the repository at this point in the history
* develop: (50 commits)
  docs: add jsdom example and tests (dequelabs#1530)
  fix(aria-valid-attr-value): allow aria-owns to pass when element is not in the DOM (dequelabs#1526)
  fix(isSkipLink): cache first page link (dequelabs#1525)
  chore: update Babel dependencies (dequelabs#1527)
  chore(package): Update karma to version 4.1.0 (dequelabs#1528)
  feat: Improve perf of axe.run [WWD-1821] (dequelabs#1503)
  fix(prettier): ignore generated api doc files (dequelabs#1522)
  fix(skip-link,region): Allow multiple skiplinks at page top (dequelabs#1496)
  fix(raw-reporter): do not output `DqElement`s (dequelabs#1513)
  fix: Scroll state had top and left properties flipped (dequelabs#1469)
  refactor: commons.color.getBackgroundColor method (dequelabs#1451)
  fix(aria-valid-attr-value): allow aria-controls to pass when element is not in the DOM
  chore: Update husky to the latest version 🚀 (dequelabs#1514)
  style: format HTML files with Prettier (dequelabs#1508)
  test: Fix invalid test html (dequelabs#1502)
  feat(rule): Inline text spacing must be adjustable with custom stylesheets (dequelabs#1446)
  chore: Remove version number from axe.d.ts (dequelabs#1499)
  chore: Update make-dir to the latest version 🚀 (dequelabs#1465)
  fix: Exclude  iframe for html-has-lang rule (Issue 1424) (dequelabs#1430)
  feat(utils): add support for complex CSS selectors (dequelabs#1494)
  ...
  • Loading branch information
stephenmathieson committed May 10, 2019
2 parents eeae65e + b573b1c commit 7ce3859
Show file tree
Hide file tree
Showing 408 changed files with 9,567 additions and 5,489 deletions.
13 changes: 10 additions & 3 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
{
"presets": [
"env"
[
"@babel/preset-env"
]
],
"plugins": [
"transform-object-rest-spread"
[
"@babel/plugin-proposal-object-rest-spread",
{
"loose": true
}
]
]
}
}
36 changes: 33 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ jobs:
- phantomjs
- run: npm run test

# Run examples under `doc/examples`
test_examples:
<<: *defaults
steps:
- checkout
- <<: *restore_dependency_cache
- run: npm run test:examples

# Release a "next" version
next_release:
<<: *defaults
Expand All @@ -68,7 +76,7 @@ jobs:
- run: npm publish --tag=next

# Release a "production" version
production_release:
release:
<<: *defaults
steps:
- checkout
Expand All @@ -77,6 +85,20 @@ jobs:
- run: npm run build
- run: npm publish

# Create a GitHub release.
github_release:
docker:
- image: circleci/golang:1.8
steps:
- checkout
- run: go get gopkg.in/aktau/github-release.v0
- run:
name: Download and run GitHub release script
command: |
curl https://raw.githubusercontent.com/dequelabs/attest-release-scripts/develop/src/node-github-release.sh -s -o ./node-github-release.sh
chmod +x ./node-github-release.sh
./node-github-release.sh
workflows:
version: 2
build:
Expand All @@ -92,11 +114,15 @@ workflows:
requires:
- dependencies
- lint
- test_examples:
requires:
- test
# Hold for approval
- hold:
type: approval
requires:
- test
- test_examples
filters:
# We only want to hold on these two branches, as PR review acts as approval for PRs
branches:
Expand All @@ -108,16 +134,20 @@ workflows:
requires:
- dependencies
- test
- hold
- test_examples
filters:
branches:
only: develop
# Run a production release on "master" commits, but only after the tests pass and dependencies are installed
- production_release:
- release:
requires:
- dependencies
- test
- test_examples
- hold
filters:
branches:
only: master
- github_release:
requires:
- release
14 changes: 6 additions & 8 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,6 @@
2,
5
],
"max-statements": [
2,
15
],
"complexity": [
1,
12
],
"no-cond-assign": 0,
"no-debugger": 0,
"no-eq-null": 0,
Expand All @@ -70,6 +62,12 @@
{
"selector": "MemberExpression[property.name=tagName]",
"message": "Don't use node.tagName, use node.nodeName instead."
},
{
// node.attributes can be clobbered so is unsafe to use
// @see https://github.com/dequelabs/axe-core/pull/1432
"selector": "MemberExpression[object.name=node][property.name=attributes]",
"message": "Don't use node.attributes, use node.hasAttributes() or axe.utils.getNodeAttributes(node) instead."
}
]
}
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules/
doc/api
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ All notable changes to this project will be documented in this file. See [standa
- Security improvements
- Build includes Babel/ES6
- Improvements to table rules
- aXe can be loaded in Node
- axe can be loaded in Node

<a name="2.0.0"></a>

Expand Down
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,13 @@ To build the package:
grunt build
```

## Using aXe with TypeScript
## Using axe with TypeScript

### aXe Development
### Axe Development

The TypeScript definition file for axe-core is distributed with this module and can be found in [axe.d.ts](./axe.d.ts). It currently supports TypeScript 2.0+.

To maintain aXe support for TypeScript you must first install it (globally recommended):
To maintain axe support for TypeScript you must first install it (globally recommended):

```console
sudo npm -g install typescript
Expand All @@ -128,9 +128,9 @@ Once that's installed, you can run TypeScript definition tests (with the optiona
tsc --noImplicitAny typings/axe-core/axe-core-tests.ts
```

## Including aXe's type definition in tests
## Including axe's type definition in tests

Installing aXe to run accessibility tests in your TypeScript project should be as simple as importing the module:
Installing axe to run accessibility tests in your TypeScript project should be as simple as importing the module:

```js
import * as axe from 'axe-core';
Expand Down
31 changes: 20 additions & 11 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*eslint
complexity: ["error",12],
max-statements: ["error", 35],
camelcase: ["error", {"properties": "never"}]
*/
var testConfig = require('./build/test/config');
Expand Down Expand Up @@ -73,7 +71,7 @@ module.exports = function(grunt) {
clean: ['dist', 'tmp', 'axe.js', 'axe.*.js'],
babel: {
options: {
compact: 'false'
compact: false
},
core: {
files: [
Expand Down Expand Up @@ -209,7 +207,7 @@ module.exports = function(grunt) {
quote_style: 1
},
output: {
comments: /^\/*! aXe/
comments: /^\/*! axe/
}
}
},
Expand All @@ -222,7 +220,7 @@ module.exports = function(grunt) {
}),
options: {
output: {
comments: /^\/*! aXe/
comments: /^\/*! axe/
},
mangle: {
reserved: ['commons', 'utils', 'axe', 'window', 'document']
Expand All @@ -243,7 +241,18 @@ module.exports = function(grunt) {
},
testconfig: {
test: {
src: ['test/integration/rules/**/*.json'],
src: ['test/integration/rules/**/*.json'].concat(
process.env.APPVEYOR
? [
// These tests are causing PhantomJS to timeout on Appveyor
// Warning: PhantomJS timed out, possibly due to a missing Mocha run() call. Use --force to continue.
'!test/integration/rules/td-has-header/*.json',
'!test/integration/rules/label-content-name-mismatch/*.json',
'!test/integration/rules/label/*.json',
'!test/integration/rules/th-has-data-cells/*.json'
]
: []
),
dest: 'tmp/integration-tests.js'
}
},
Expand All @@ -255,7 +264,7 @@ module.exports = function(grunt) {
fixture: 'test/runner.tmpl',
testCwd: 'test/core',
data: {
title: 'aXe Core Tests'
title: 'Axe Core Tests'
}
}
},
Expand All @@ -270,7 +279,7 @@ module.exports = function(grunt) {
fixture: 'test/runner.tmpl',
testCwd: 'test/checks',
data: {
title: 'aXe Check Tests'
title: 'Axe Check Tests'
}
}
},
Expand All @@ -285,7 +294,7 @@ module.exports = function(grunt) {
fixture: 'test/runner.tmpl',
testCwd: 'test/commons',
data: {
title: 'aXe Commons Tests'
title: 'Axe Commons Tests'
}
}
},
Expand All @@ -300,7 +309,7 @@ module.exports = function(grunt) {
fixture: 'test/runner.tmpl',
testCwd: 'test/rule-matches',
data: {
title: 'aXe Rule Matches Tests'
title: 'Axe Rule Matches Tests'
}
}
},
Expand All @@ -312,7 +321,7 @@ module.exports = function(grunt) {
testCwd: 'test/integration/rules',
tests: ['../../../tmp/integration-tests.js', 'runner.js'],
data: {
title: 'aXe Integration Tests'
title: 'Axe Integration Tests'
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ Support means that we will fix bugs and attempt to test each browser regularly.

There is limited support for JSDOM. We will attempt to make all rules compatible with JSDOM but where this is not possible, we recommend turning those rules off. Currently the `color-contrast` rule is known not to work with JSDOM.

We can only support environments where features are either natively supported or polyfilled correctly.

## The Accessibility Rules

The complete list of rules run by axe-core can be found in [doc/rule-descriptions.md](./doc/rule-descriptions.md).
Expand Down
25 changes: 14 additions & 11 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
# Test against the latest version of this Node.js version
version: 1.0.{build}-{branch}

# Test against this version of node.
environment:
nodejs_version: "6"
nodejs_version: "10"
skip_tags: true

# Install scripts. (runs after repo cloning)
# Install scripts. (runs after repo cloning)
install:
# Get the latest stable version of Node.js or io.js
- ps: Install-Product node $env:nodejs_version
# install modules
- npm install

# Post-install test scripts.
# Post-install test scripts.
test_script:
# Output useful info for debugging.
- node --version
- npm --version
# run tests
- npm test
- npm run build
# A few tests are flaky, causing occasional random failures
# When we have time, we should investigate to see if we can eliminate these flakes
# - npm run test
- npm run test:examples

# Don't actually build.
build: off
# Don't actually build.
build: off
12 changes: 6 additions & 6 deletions axe.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Type definitions for axe-core 3.0.2
// Type definitions for axe-core
// Project: https://github.com/dequelabs/axe-core
// Definitions by: Marcy Sutton <https://github.com/marcysutton>

Expand Down Expand Up @@ -65,13 +65,13 @@ declare namespace axe {
help: string;
helpUrl: string;
id: string;
impact: ImpactValue;
impact?: ImpactValue;
tags: TagValue[];
nodes: NodeResult[];
}
interface NodeResult {
html: string;
impact: ImpactValue;
impact?: ImpactValue;
target: string[];
any: CheckResult[];
all: CheckResult[];
Expand Down Expand Up @@ -155,7 +155,7 @@ declare namespace axe {
let source: string;

/**
* Object for aXe Results
* Object for axe Results
*/
var AxeResults: AxeResults;

Expand All @@ -165,7 +165,7 @@ declare namespace axe {
* @param {ElementContext} context Optional The `Context` specification object @see Context
* @param {RunOptions} options Optional Options passed into rules or checks, temporarily modifying them.
* @param {RunCallback} callback Optional The function to invoke when analysis is complete.
* @returns {Promise<AxeResults>|void} If the callback was not defined, aXe will return a Promise.
* @returns {Promise<AxeResults>|void} If the callback was not defined, axe will return a Promise.
*/
function run(context?: ElementContext): Promise<AxeResults>;
function run(options: RunOptions): Promise<AxeResults>;
Expand All @@ -183,7 +183,7 @@ declare namespace axe {
): void;

/**
* Method for configuring the data format used by aXe. Helpful for adding new
* Method for configuring the data format used by axe. Helpful for adding new
* rules, which must be registered with the library to execute.
* @param {Spec} Spec Object with valid `branding`, `reporter`, `checks` and `rules` data
*/
Expand Down
2 changes: 1 addition & 1 deletion build/configure.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*eslint-env node */
/*eslint max-statements: ["error", 20], max-len: off */
/*eslint max-len: off */
'use strict';

var clone = require('clone');
Expand Down
1 change: 0 additions & 1 deletion build/tasks/langs.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/*eslint-env node */
'use strict';
var http = require('http');
var Promise = require('promise');
module.exports = function(grunt) {
function getLine(data, start) {
var len = data.length;
Expand Down
Loading

0 comments on commit 7ce3859

Please sign in to comment.