From 52fc16f8b1837457efc2a9e0ccaa7eb34a20fcaf Mon Sep 17 00:00:00 2001 From: Tim Deschryver <28659384+timdeschryver@users.noreply.github.com> Date: Sun, 29 Dec 2024 17:38:50 +0000 Subject: [PATCH] perf: replace chalk with picocolors --- package.json | 2 +- src/to-have-style.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index a9ddf16..e7946cd 100644 --- a/package.json +++ b/package.json @@ -82,10 +82,10 @@ "dependencies": { "@adobe/css-tools": "^4.4.0", "aria-query": "^5.0.0", - "chalk": "^3.0.0", "css.escape": "^1.5.1", "dom-accessibility-api": "^0.6.3", "lodash": "^4.17.21", + "picocolors": "^1.1.1", "redent": "^3.0.0" }, "devDependencies": { diff --git a/src/to-have-style.js b/src/to-have-style.js index 010e2a5..86eae2e 100644 --- a/src/to-have-style.js +++ b/src/to-have-style.js @@ -1,4 +1,4 @@ -import chalk from 'chalk' +import pico from 'picocolors' import {checkHtmlElement, parseCSS} from './utils' function getStyleDeclaration(document, css) { @@ -50,7 +50,7 @@ function expectedDiff(diffFn, expected, computedStyles) { ) const diffOutput = diffFn(printoutStyles(expected), printoutStyles(received)) // Remove the "+ Received" annotation because this is a one-way diff - return diffOutput.replace(`${chalk.red('+ Received')}\n`, '') + return diffOutput.replace(`${pico.red('+ Received')}\n`, '') } export function toHaveStyle(htmlElement, css) {