jest-native
jest-native copied to clipboard
Replace Chalk with Colorette; fix to-have-style to use named red import
What:
Replace Chalk with Colorette; fix to-have-style to use named red import
Why: Security/supply-chain risk: Chalk has had ecosystem concerns and frequent transitive dependency changes. To reduce exposure, we removed Chalk and opted for a simpler library with fewer moving parts. Size and performance: Chalk is feature-rich but heavier. Colorette is tiny, dependency-free, and fast. Switching trims our dependency tree and improves startup/formatting overhead in test runs.
How:
- Removed malicious dependency chalk due to security concerns.
- Switched to colorette and updated to-have-style to import red as a named export.
- Adjusted expectedDiff to strip the “+ Received” annotation using red('+ Received'). ## Security:
- Chalk removal mitigates risk from supply-chain compromise. Consider auditing the lockfile and running npm audit.
Checklist:
- [x] Documentation added to the docs
- [x] Typescript definitions updated
- [x] Tests
- [x] Ready to be merged
This library is deprecated. Pls migrate to RN Testing Library built in matchers.