@aristobyte-ui/jest-config
v1.0.111
Published
Centralized, shareable Jest configuration presets for AristoByteUI monorepo projects. Supports Node, React, and Next.js environments with TypeScript, Babel integration, and consistent coverage reporting.
Maintainers
Readme
@aristobyte-ui/jest-config
Centralized, shareable Jest configuration presets for AristoByteUI monorepo projects, supporting Node, React, and Next.js environments.
📦 Installation
# Install via Yarn
yarn add -D @aristobyte-ui/jest-config
# Or via npm
npm install -D @aristobyte-ui/jest-config
# Or via pnpm
pnpm add -D @aristobyte-ui/jest-config🛠 Usage
Base config (Node environment):
import { config } from "@aristobyte-ui/jest-config/base";
export default config;React config (includes Testing Library):
import { config } from "@aristobyte-ui/jest-config/react";
export default config;Next.js config (includes React + moduleNameMapper for CSS/Assets):
import { config } from "@aristobyte-ui/jest-config/next";
export default config;📂 Presets Available
base→ Node-first Jest configuration with TypeScript & Babel integration.react→ Extendsbasewith jsdom environment and Testing Library setup.next→ Extends react with moduleNameMapper and CSS/asset mocking for Next.js.
🔧 Example in a Package
{
"name": "@aristobyte-ui/button",
"version": "1.0.0",
"scripts": {
"test": "jest --config jest.config.js"
},
"devDependencies": {
"@aristobyte-ui/jest-config": "*",
"jest": "^29.0.0",
"@testing-library/jest-dom": "^6.0.0"
}
}And jest.config.js:
import { config } from "@aristobyte-ui/jest-config/react";
export default config;📊 Why This Matters
| Feature | Benefit | | ---------------------- | -------------------------------------------------- | | Base config | Node-first, TypeScript-ready testing | | React support | jsdom environment + Testing Library integration | | Next.js support | Module mapping for CSS/Assets + React integration | | Coverage config | Centralized coverage reporting and ignore patterns | | Monorepo-ready | Consistent Jest behavior across packages | | Babel & TS integration | Compile TS & modern JS seamlessly |
🏆 Philosophy
At AristoByte, testing is foundational for reliability and team scalability.
These configs empower developers to write consistent, predictable, and maintainable tests across the monorepo.
📜 License
MIT © AristoByte
