@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.
- package/README.md +86 -45
- package/package.json +19 -9
package/README.md
CHANGED
|
@@ -1,70 +1,111 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `@aristobyte-ui/jest-config`
|
|
2
2
|
|
|
3
|
-
|
|
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
|
-
## 📦
|
|
16
|
+
## 📦 Installation
|
|
8
17
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
##
|
|
29
|
+
## 🛠 Usage
|
|
18
30
|
|
|
19
|
-
|
|
31
|
+
**Base config (Node environment):**
|
|
20
32
|
|
|
21
|
-
```
|
|
22
|
-
|
|
33
|
+
```ts
|
|
34
|
+
import { config } from "@aristobyte-ui/jest-config/base";
|
|
35
|
+
export default config;
|
|
23
36
|
```
|
|
24
37
|
|
|
25
|
-
|
|
38
|
+
**React config (includes Testing Library):**
|
|
26
39
|
|
|
27
|
-
|
|
40
|
+
```ts
|
|
41
|
+
import { config } from "@aristobyte-ui/jest-config/react";
|
|
42
|
+
export default config;
|
|
43
|
+
```
|
|
28
44
|
|
|
29
|
-
|
|
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
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
};
|
|
47
|
+
```ts
|
|
48
|
+
import { config } from "@aristobyte-ui/jest-config/next";
|
|
49
|
+
export default config;
|
|
36
50
|
```
|
|
37
51
|
|
|
38
|
-
##
|
|
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
|
-
|
|
41
|
-
import { config as react } from "@aristobyte-ui/jest-config/react.js";
|
|
75
|
+
And `jest.config.js`:
|
|
42
76
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
rootDir: ".",
|
|
47
|
-
};
|
|
77
|
+
```ts
|
|
78
|
+
import { config } from "@aristobyte-ui/jest-config/react";
|
|
79
|
+
export default config;
|
|
48
80
|
```
|
|
49
81
|
|
|
50
|
-
##
|
|
82
|
+
## 📊 Why This Matters
|
|
51
83
|
|
|
52
|
-
|
|
53
|
-
|
|
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
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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
|
-
##
|
|
98
|
+
## 📜 License
|
|
62
99
|
|
|
63
|
-
|
|
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
|
-
|
|
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
|
|
4
|
-
"version": "1.0.
|
|
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://
|
|
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
|
-
"
|
|
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
|
}
|