test: separates api integration tests into their own Jest project#2542
test: separates api integration tests into their own Jest project#2542ygrishajev merged 2 commits intomainfrom
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThis PR creates a dedicated integration test project by updating npm test scripts to include the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Comment |
21d6f60 to
a3400c7
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@apps/api/jest.config.js`:
- Line 19: Update the collectCoverageFrom array in jest config to exclude
integration test files; specifically add the pattern "!src/**/*.integration.ts"
to the existing collectCoverageFrom entry so files matching
src/**/*.integration.ts are not included in coverage collection (modify the
collectCoverageFrom array shown in the diff).
🧹 Nitpick comments (1)
apps/api/jest.config.js (1)
1-1: Remove the redundantmaxWorkersoverride.Line 20 already pins
maxWorkersto1, so the conditional at Lines 53–55 no longer changes behavior. If you still want a conditional override, restore a different default; otherwise, drop the block to reduce confusion.🧹 No-op cleanup (keeps side effects of the config load)
-const { localConfig } = require("./test/services/local.config"); +require("./test/services/local.config"); @@ -if (localConfig.FUNDING_WALLET_MNEMONIC) { - config.maxWorkers = 1; -}Also applies to: 20-20, 53-55
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project status has failed because the head coverage (74.72%) is below the target coverage (78.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #2542 +/- ##
==========================================
- Coverage 51.85% 51.84% -0.01%
==========================================
Files 1058 1058
Lines 28025 28025
Branches 6363 6344 -19
==========================================
- Hits 14532 14530 -2
- Misses 12993 13054 +61
+ Partials 500 441 -59
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@apps/api/package.json`:
- Line 27: The current "test" script in package.json includes integration tests
which require a real DB; update the package.json scripts so "test" runs only
unit and functional tests (e.g., keep "jest --selectProjects unit functional"),
add a separate "test:integration" (and optionally "test:cov") script that runs
the integration suite (e.g., "jest --selectProjects integration"), or
alternatively modify "test" to conditionally boot a test DB when a specific env
var is present; make the change in the scripts section referencing the "test"
and new "test:integration" script names so local npm test remains fast and
integration runs are explicit.
e810534 to
5a0d5dd
Compare
| @@ -361,6 +361,7 @@ | |||
| "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-2.0.0.tgz", | |||
There was a problem hiding this comment.
🔄 Carefully review the package-lock.json diff
Resolve the comment if everything is ok
- node_modules/git-semver-tags/node_modules/conventional-commits-filter 5.0.0
- node_modules/git-semver-tags/node_modules/conventional-commits-parser 6.2.1
- node_modules/magicast 0.3.5
closes #2495
Summary by CodeRabbit