Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests(react): add proper unit tests #466

Merged
merged 3 commits into from
Feb 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ jobs:
steps:
- checkout
- restore_dependency_cache
- run: npm install cypress --prefix=packages/react
- run: npm run build --prefix=packages/react
- run: npm run test --prefix=packages/react

Expand Down
13 changes: 13 additions & 0 deletions packages/react/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"presets": [
[
"@babel/preset-env",
{
targets: {
node: 'current',
},
}
],
"@babel/preset-react"
]
}
6 changes: 0 additions & 6 deletions packages/react/cypress.json

This file was deleted.

5 changes: 0 additions & 5 deletions packages/react/cypress/fixtures/example.json

This file was deleted.

116 changes: 0 additions & 116 deletions packages/react/cypress/integration/index-test.js

This file was deleted.

1 change: 0 additions & 1 deletion packages/react/cypress/support/index.js

This file was deleted.

12 changes: 11 additions & 1 deletion packages/react/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,4 +412,14 @@ function reactAxe(
return checkAndReport(document.body, timeout);
}

export = reactAxe;
// export function just for tests so we can have a clean state
// between tests
export function _reset() {
Object.keys(cache).forEach(key => {
delete cache[key];
});

axeCore.reset();
}

export default reactAxe;
Loading