-
-
Notifications
You must be signed in to change notification settings - Fork 100
Add comprehensive unit tests for rspack exports #847
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Addresses issue #844 by adding Jest unit tests for the rspack public API. These tests verify all exports from package/rspack/index.ts work correctly. Tests cover: - Webpack-merge function exports (merge, mergeWithRules, etc.) - Configuration object exports (config, devServer, env, rules, baseConfig) - Utility function exports (moduleExists, canProcess, inliningCss) - generateRspackConfig() behavior: - Returns immutable config objects - Properly merges extra configuration - Validates input arguments - Includes required plugins and optimization - Respects NODE_ENV for environment-specific configs - Falls back to base config for unknown environments - Merges environment and extra configs correctly The baseConfig export is verified to be a valid rspack configuration object, which helps catch issues like those reported in #843. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
|
Warning Rate limit exceeded@justin808 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 20 minutes and 34 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Pull Request ReviewSummaryThis PR adds comprehensive Jest unit tests for the rspack public API exports, addressing issue #844. Overall, this is a high-quality contribution that significantly improves test coverage for the rspack functionality. ✅ Strengths
🔍 Code Quality ObservationsMinor Issues
🧪 Test Coverage AnalysisAll critical functionality is tested:
Test Coverage vs Source CodeComparing with
🔒 Security ConsiderationsNo security concerns identified. The tests:
⚡ Performance Considerations
📝 Best Practices
🐛 Potential IssuesLow Priority
📋 Action ItemsRequired before merge:
Optional improvements (could be follow-up PRs):
✅ RecommendationAPPROVE with minor fix required: This is an excellent addition to the test suite. Once the trailing newline is added, this should be merged. The tests are well-structured, comprehensive, and directly address the issues mentioned in #844 and help prevent regressions of #843. 🤖 Generated with Claude Code |
Code Review - PR #847: Add comprehensive unit tests for rspack exportsThank you for this excellent contribution! The test coverage for the rspack public API is much needed and well-implemented. Here's my detailed feedback: ✅ Strengths
🔍 Issues & Concerns1. Missing Trailing Newline
|
Summary
Addresses #844 by adding comprehensive Jest unit tests for the rspack public API exports in
package/rspack/index.ts.What was tested
All 17 tests pass and verify:
✅ Webpack-merge function exports - merge, mergeWithRules, mergeWithCustomize, unique
✅ Configuration object exports - config, devServer, env, rules, baseConfig
✅ Utility function exports - moduleExists, canProcess, inliningCss
✅ generateRspackConfig() behavior:
Key improvements
validateRspackDependencies()to avoid requiring actual rspack dependencies during test runsSHAKAPACKER_ASSETS_BUNDLER=rspackto ensure rspack-specific code paths are testedTest file location
test/package/rspack/index.test.js- mirrors the structure of existingtest/package/index.test.jsfor webpackTest plan
🤖 Generated with Claude Code