@aristobyte-ui/jest-config 1.0.8 → 1.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +86 -45
  2. package/package.json +19 -9
package/README.md CHANGED
@@ -1,70 +1,111 @@
1
- # @aristobyte-ui/jest-config
1
+ # `@aristobyte-ui/jest-config`
2
2
 
3
- Scalable, centralized Jest configurations for AristoByte’s TypeScript monorepos — with first-class support for Node, React, and Next.js environments.
3
+ <p align="center">
4
+ <img src="https://img.shields.io/badge/TypeScript-5.8-blue?style=for-the-badge&logo=typescript&logoColor=white" alt="TypeScript" />
5
+ <img src="https://img.shields.io/badge/Jest-29-red?style=for-the-badge&logo=jest&logoColor=white" alt="Jest" />
6
+ <img src="https://img.shields.io/badge/Testing-Library-blueviolet?style=for-the-badge&logo=testinglibrary&logoColor=white" alt="Testing Library" />
7
+ <img src="https://img.shields.io/badge/React-Supported-61DAFB?style=for-the-badge&logo=react&logoColor=white" alt="React Support" />
8
+ <img src="https://img.shields.io/badge/Next.js-Supported-000000?style=for-the-badge&logo=nextdotjs&logoColor=white" alt="Next.js Support" />
9
+ <img src="https://img.shields.io/badge/Node-20.17.0+-339933?style=for-the-badge&logo=node.js&logoColor=white" alt="Node.js >=20.17.0" />
10
+ <img src="https://img.shields.io/badge/Yarn-1.22+-2C8EBB?style=for-the-badge&logo=yarn&logoColor=white" alt="Yarn >=1.22" />
11
+ <img src="https://img.shields.io/badge/NPM-10.8+-CB3837?style=for-the-badge&logo=npm&logoColor=white" alt="NPM >=10.8" />
12
+ </p>
4
13
 
5
- ---
14
+ Centralized, shareable **Jest configuration presets** for AristoByteUI monorepo projects, supporting Node, React, and Next.js environments.
6
15
 
7
- ## 📦 Exported Config Profiles
16
+ ## 📦 Installation
8
17
 
9
- | Config Path | Description |
10
- | ---------------------------------- | --------------------------------------------------------------------------------- |
11
- | `@aristobyte-ui/jest-config/base` | Core config for libraries and backend packages. Targets Node.js environments. |
12
- | `@aristobyte-ui/jest-config/react` | Extends `base` for React-based packages with jsdom and Testing Library support. |
13
- | `@aristobyte-ui/jest-config/next` | Builds on `react`, adding CSS module mocks and alias resolution for Next.js apps. |
18
+ ```bash
19
+ # Install via Yarn
20
+ yarn add -D @aristobyte-ui/jest-config
21
+
22
+ # Or via npm
23
+ npm install -D @aristobyte-ui/jest-config
14
24
 
15
- ---
25
+ # Or via pnpm
26
+ pnpm add -D @aristobyte-ui/jest-config
27
+ ```
16
28
 
17
- ## 🚀 Usage
29
+ ## 🛠 Usage
18
30
 
19
- 1. **Install peer dependencies** (in consuming package):
31
+ **Base config (Node environment):**
20
32
 
21
- ```bash
22
- yarn add -D jest babel-jest @babel/preset-env @babel/preset-typescript @testing-library/jest-dom identity-obj-proxy
33
+ ```ts
34
+ import { config } from "@aristobyte-ui/jest-config/base";
35
+ export default config;
23
36
  ```
24
37
 
25
- 2. Consume a config in your jest.config.js or jest.config.mjs:
38
+ **React config (includes Testing Library):**
26
39
 
27
- ## Node / Base
40
+ ```ts
41
+ import { config } from "@aristobyte-ui/jest-config/react";
42
+ export default config;
43
+ ```
28
44
 
29
- ```js
30
- import { config as base } from "@aristobyte-ui/jest-config/base.js";
45
+ **Next.js config (includes React + moduleNameMapper for CSS/Assets):**
31
46
 
32
- export default {
33
- ...base,
34
- displayName: "my-lib",
35
- };
47
+ ```ts
48
+ import { config } from "@aristobyte-ui/jest-config/next";
49
+ export default config;
36
50
  ```
37
51
 
38
- ## React
52
+ ## 📂 Presets Available
53
+
54
+ - `base` → Node-first Jest configuration with TypeScript & Babel integration.
55
+ - `react` → Extends `base` with jsdom environment and Testing Library setup.
56
+ - `next` → Extends react with moduleNameMapper and CSS/asset mocking for Next.js.
57
+
58
+ ## 🔧 Example in a Package
59
+
60
+ ```json
61
+ {
62
+ "name": "@aristobyte-ui/button",
63
+ "version": "1.0.0",
64
+ "scripts": {
65
+ "test": "jest --config jest.config.js"
66
+ },
67
+ "devDependencies": {
68
+ "@aristobyte-ui/jest-config": "*",
69
+ "jest": "^29.0.0",
70
+ "@testing-library/jest-dom": "^6.0.0"
71
+ }
72
+ }
73
+ ```
39
74
 
40
- ```js
41
- import { config as react } from "@aristobyte-ui/jest-config/react.js";
75
+ And `jest.config.js`:
42
76
 
43
- export default {
44
- ...react,
45
- displayName: "ui-components",
46
- rootDir: ".",
47
- };
77
+ ```ts
78
+ import { config } from "@aristobyte-ui/jest-config/react";
79
+ export default config;
48
80
  ```
49
81
 
50
- ## Next.js
82
+ ## 📊 Why This Matters
51
83
 
52
- ```js
53
- import { config as next } from "@aristobyte-ui/jest-config/next.js";
84
+ | Feature | Benefit |
85
+ | ---------------------- | -------------------------------------------------- |
86
+ | Base config | Node-first, TypeScript-ready testing |
87
+ | React support | jsdom environment + Testing Library integration |
88
+ | Next.js support | Module mapping for CSS/Assets + React integration |
89
+ | Coverage config | Centralized coverage reporting and ignore patterns |
90
+ | Monorepo-ready | Consistent Jest behavior across packages |
91
+ | Babel & TS integration | Compile TS & modern JS seamlessly |
54
92
 
55
- export default {
56
- ...next,
57
- displayName: "web-app",
58
- };
59
- ```
93
+ ## 🏆 Philosophy
94
+
95
+ At **AristoByte**, testing is **foundational** for reliability and team scalability.
96
+ These configs empower developers to **write consistent, predictable, and maintainable tests** across the monorepo.
60
97
 
61
- ## 🧠 Why Use This?
98
+ ## 📜 License
62
99
 
63
- - Unified test strategy across apps and packages
64
- - 📐 Consistent coverage + transformation rules
65
- - 🧪 Seamless Testing Library support for React
66
- - ⚙️ Clean path aliasing & style mock handling for Next.js
100
+ [MIT](./LICENSE) © AristoByte
67
101
 
68
- ---
102
+ ## 🛡 Shields Showcase
69
103
 
70
- © AristoByte Inc. — Streamlining test infrastructure at scale.
104
+ <p align="center">
105
+ <img src="https://img.shields.io/badge/Consistency-100%25-green?style=for-the-badge&logo=jest" />
106
+ <img src="https://img.shields.io/badge/Maintained-Active-brightgreen?style=for-the-badge&logo=github" />
107
+ <img src="https://img.shields.io/badge/React-Tested-61DAFB?style=for-the-badge&logo=react" />
108
+ <img src="https://img.shields.io/badge/Next.js-Supported-black?style=for-the-badge&logo=nextdotjs" />
109
+ <img src="https://img.shields.io/badge/Babel-Integrated-F9DC3E?style=for-the-badge&logo=babel&logoColor=black" />
110
+ <img src="https://img.shields.io/badge/TypeScript-Enabled-3178C6?style=for-the-badge&logo=typescript" />
111
+ </p>
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@aristobyte-ui/jest-config",
3
- "description": "Centralized, shareable Jest configurations for AristoByteUI monorepo projects.",
4
- "version": "1.0.8",
3
+ "description": "Centralized, shareable Jest configuration presets for AristoByteUI monorepo projects. Supports Node, React, and Next.js environments with TypeScript, Babel integration, and consistent coverage reporting.",
4
+ "version": "1.0.11",
5
5
  "private": false,
6
6
  "license": "MIT",
7
7
  "main": "./jest.base.js",
8
8
  "author": "AristoByte <info@aristobyte.com>",
9
- "homepage": "https://github.com/aristobyte-team/aristobyte-ui.git#readme",
9
+ "homepage": "https://www.npmjs.com/package/@aristobyte-ui/jest-config",
10
10
  "repository": {
11
11
  "type": "git",
12
- "url": "https://github.com/aristobyte-team/aristobyte-ui.git",
12
+ "url": "git+https://github.com/aristobyte-team/aristobyte-ui.git",
13
13
  "directory": "packages/jest-config"
14
14
  },
15
15
  "bugs": {
@@ -22,11 +22,21 @@
22
22
  },
23
23
  "keywords": [
24
24
  "jest",
25
- "config",
25
+ "jest-config",
26
26
  "testing",
27
+ "typescript",
28
+ "react",
29
+ "nextjs",
27
30
  "monorepo",
31
+ "babel",
32
+ "testing-library",
33
+ "coverage",
34
+ "unit-tests",
35
+ "integration-tests",
28
36
  "aristobyte",
29
- "shared-config"
37
+ "aristobyte-ui",
38
+ "shared-config",
39
+ "workspace"
30
40
  ],
31
41
  "exports": {
32
42
  "./base": "./dist/jest.base.js",
@@ -36,6 +46,9 @@
36
46
  "files": [
37
47
  "dist"
38
48
  ],
49
+ "publishConfig": {
50
+ "access": "public"
51
+ },
39
52
  "scripts": {
40
53
  "build": "tsc --project tsconfig.json"
41
54
  },
@@ -51,8 +64,5 @@
51
64
  "@types/jest": "^29.5.14",
52
65
  "identity-obj-proxy": "^3.0.0",
53
66
  "typescript": "^5.8.2"
54
- },
55
- "publishConfig": {
56
- "access": "public"
57
67
  }
58
68
  }