Skip to content

Commit 62327da

Browse files
feat(enhanced): implement layer-aware module sharing with comprehensive test coverage (PR9) (#3915)
Co-authored-by: Claude <[email protected]>
1 parent 41dcb87 commit 62327da

File tree

4 files changed

+39
-1698
lines changed

4 files changed

+39
-1698
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
"@module-federation/enhanced": patch
3+
---
4+
5+
test: add test coverage for ConsumeSharedPlugin
6+
7+
- Add 70+ tests for createConsumeSharedModule method covering all critical business logic
8+
- Implement tests for import resolution logic including error handling and direct fallback regex matching
9+
- Add requiredVersion resolution tests for package name extraction and version resolution
10+
- Implement include/exclude version filtering tests with fallback version support
11+
- Add singleton warning generation tests for version filters as specified
12+
- Implement package.json reading error scenarios and edge case handling
13+
- Add apply method tests for plugin registration logic and hook setup
14+
- Achieve test coverage parity with ProvideSharedPlugin (70+ tests each)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
"@module-federation/enhanced": patch
3+
---
4+
5+
test: add test coverage for ProvideSharedPlugin
6+
7+
- Add 73 tests covering all critical business logic and edge cases
8+
- Implement complete shouldProvideSharedModule method coverage (15 tests) for version filtering with semver validation
9+
- Add provideSharedModule method tests (16 tests) covering version resolution, request pattern filtering, and warning generation
10+
- Implement module matching and resolution stage tests (20 tests) for multi-stage resolution logic
11+
- Validate business rules: warnings only for version filters with singleton, not request filters
12+
- Cover all critical private methods with proper TypeScript handling using @ts-ignore
13+
- Fix container utils mock for dependency factory operations
14+
- Add performance and memory usage tests for large-scale scenarios
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
"@module-federation/enhanced": patch
3+
---
4+
5+
test: add test coverage for ConsumeSharedPlugin and ProvideSharedPlugin
6+
7+
- Add 70+ tests for ConsumeSharedPlugin covering all critical business logic including multi-stage module resolution, import resolution logic, version filtering, and error handling
8+
- Add 73 tests for ProvideSharedPlugin covering shouldProvideSharedModule method, provideSharedModule method, module matching, and resolution stages
9+
- Fix minor bug in ProvideSharedPlugin where originalRequestString was used instead of modulePathAfterNodeModules for prefix matching
10+
- Add layer property to resolved provide map entries for better layer support
11+
- Improve test infrastructure stability and CI reliability with better assertions and mocking

0 commit comments

Comments
 (0)