diff --git a/package.json b/package.json index 93294d6..0b4af60 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "react-native" ], "dependencies": { - "chalk": "^4.1.2", + "colorette": "^2.0.20", "jest-diff": "^29.0.1", "jest-matcher-utils": "^29.0.1", "pretty-format": "^29.0.3", diff --git a/src/to-have-style.ts b/src/to-have-style.ts index 38b3e10..c781195 100644 --- a/src/to-have-style.ts +++ b/src/to-have-style.ts @@ -3,7 +3,7 @@ import type { ReactTestInstance } from 'react-test-renderer'; import { StyleSheet } from 'react-native'; import { matcherHint } from 'jest-matcher-utils'; import { diff } from 'jest-diff'; -import chalk from 'chalk'; +import { red } from 'colorette'; import { checkReactElement } from './utils'; type Style = TextStyle | ViewStyle | ImageStyle; @@ -42,7 +42,7 @@ function expectedDiff(expected: StyleLike, received: StyleLike) { const diffOutput = diff(printoutStyles(expected), printoutStyles(receivedNarrow)); // Remove the "+ Received" annotation because this is a one-way diff - return diffOutput?.replace(`${chalk.red('+ Received')}\n`, '') ?? ''; + return diffOutput?.replace(`${red('+ Received')}\n`, '') ?? ''; } export function toHaveStyle(