Commit a573685
Fix Jest configuration for monorepo node-renderer tests
This commit fixes the "No tests found" CI error by properly configuring
Jest to find and run tests in the monorepo structure.
**Changes:**
1. **Added Jest `roots` configuration** (react_on_rails_pro/package.json):
- Tells Jest to search for tests in `../packages/react-on-rails-pro-node-renderer`
- Previously Jest only searched in the current directory
2. **Added Jest `moduleNameMapper`** (react_on_rails_pro/package.json):
- Strips `.js` extensions from TypeScript imports: `^(\.{1,2}/.*)\.js$ → $1`
- Allows babel-jest to resolve TypeScript files properly
- Fixes: "Cannot find module '../shared/sharedConsoleHistory.js'" errors
3. **Simplified test scripts** (react_on_rails_pro/package-scripts.yml):
- Removed path arguments from jest commands
- Jest now uses `roots` config instead of command-line arguments
**Before:**
```
No tests found, exiting with code 1
Pattern: ../packages/react-on-rails-pro-node-renderer - 0 matches
```
**After:**
```
Test Suites: 10 total
Tests are found and executed successfully
```
This is part of Phase 5 of the monorepo migration to properly support
the node-renderer package location at `packages/react-on-rails-pro-node-renderer/`.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent dbd4ba8 commit a573685
2 files changed
+9
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
125 | 128 | | |
126 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
127 | 133 | | |
128 | 134 | | |
129 | 135 | | |
| |||
0 commit comments