This repository has been archived by the owner on Mar 19, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: fix unit tests and create typescript tests (#172)
* tests: fix unit tests and create typescript tests * axe-linter * dont ignore test dir * Update test/index.ts Co-authored-by: Stephen Mathieson <me@stephenmathieson.com> Co-authored-by: Stephen Mathieson <me@stephenmathieson.com>
- Loading branch information
1 parent
605cab8
commit 9913a15
Showing
7 changed files
with
66 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
exclude: | ||
- ./CHANGELOG.md | ||
- ./example/**/* | ||
- ./cypress/**/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,5 @@ example/build | |
example/dist | ||
example/package-lock.json | ||
dist | ||
test/index.js | ||
cypress/screenshots |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import reactAxe from '../'; | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
|
||
// default use | ||
reactAxe(React, ReactDOM, 1000); | ||
|
||
// axe-core spec | ||
reactAxe(React, ReactDOM, 1000, { | ||
checks: [ | ||
{ | ||
id: 'my-check', | ||
evaluate() {} | ||
} | ||
], | ||
rules: [ | ||
{ | ||
id: 'my-rule', | ||
any: ['my-check'] | ||
} | ||
] | ||
}); | ||
|
||
const context = document.createElement('div'); | ||
|
||
// axe-core context: Node | ||
reactAxe(React, ReactDOM, 1000, {}, context); | ||
|
||
// axe-core context: string | ||
reactAxe(React, ReactDOM, 1000, {}, '#container'); | ||
|
||
// axe-core context: ContextObject | ||
reactAxe( | ||
React, | ||
ReactDOM, | ||
1000, | ||
{}, | ||
{ | ||
include: [['#container']] | ||
} | ||
); | ||
|
||
// return type | ||
const promise: Promise<void> = reactAxe(React, ReactDOM, 1000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"compilerOptions": { | ||
"esModuleInterop": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters