Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

strategy:
matrix:
node-version: [18, 20, 22, 24, 26]
node-version: [22, 24, 26]

steps:
- uses: actions/checkout@v7
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Unreleased (breaking)

Requires Node.js 22.x and above.

- Remove dependency on chalk to use native Node.js styleText.

# 11.0.0

- Update axe-core to version 4.12.1 - see https://github.com/dequelabs/axe-core/releases for changes between 4.10.2 to 4.12.1
Expand Down
11 changes: 5 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const { styleText } = require("node:util");

const axeCore = require("axe-core");
const merge = require("lodash.merge");
const chalk = require("chalk");
const { printReceived, matcherHint } = require("jest-matcher-utils");

const AXE_RULES_COLOR = axeCore.getRules(["cat.color"]);
Expand Down Expand Up @@ -153,18 +154,16 @@ const toHaveNoViolations = {
lineBreak;
return (
expectedText +
chalk.grey(node.html) +
styleText("grey", node.html) +
lineBreak +
`Received:` +
lineBreak +
printReceived(`${violation.help} (${violation.id})`) +
lineBreak +
chalk.yellow(node.failureSummary) +
styleText("yellow", node.failureSummary) +
lineBreak +
(violation.helpUrl
? `You can find more information on this issue here: \n${chalk.blue(
violation.helpUrl,
)}`
? `You can find more information on this issue here: \n${styleText("blue", violation.helpUrl)}`
: "")
);
})
Expand Down
3 changes: 1 addition & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@
"author": "Nick Colley",
"license": "MIT",
"engines": {
"node": ">= 18.0.0"
"node": ">= 22.13.0"
},
"dependencies": {
"axe-core": "4.12.1",
"chalk": "4.1.2",
"jest-matcher-utils": "30.4.1",
"lodash.merge": "4.6.2"
},
Expand Down