Commit 43f4e36
committed
feat: comprehensive integration test suite with 737 tests
Complete rewrite of integration testing infrastructure with focus on
coverage, maintainability, and security.
TEST INFRASTRUCTURE:
- Created TestDataHelper for centralized configuration management
- Created AssertionHelper for robust, reusable test assertions
- All configuration loaded from environment variables
- Zero hardcoded credentials or stack-specific data
- Feature-based folder structure for better organization
TEST COVERAGE (737 tests across 37 test suites):
- Core SDK: Query operators, entry fetching, field projection
- References: Single/multi-level resolution, circular references
- Global Fields: Structure validation, nested data, references
- Metadata: Schema inclusion, content type metadata
- Localization: Multi-locale support, fallback behavior
- Variants: Content variant queries and validation
- Taxonomies: Hierarchical taxonomy filtering
- Assets: Query operations, image transformations
- Cache Policies: All 5 cache strategies tested
- Sync API: Initial sync, delta updates, pagination
- Live Preview: Management/preview token support
- Branch Operations: Branch-specific content fetching
- Plugin System: Request/response hook validation
- Network Resilience: Retry logic, concurrent requests
- Region Configuration: Multi-region API support
- Performance: Benchmarks and stress testing
- Real-World Scenarios: Pagination, lazy loading, batch operations
- JSON RTE: Rich text parsing, embedded content
- Modular Blocks: Complex nested structures
- SDK Utilities: Version info, utility methods
- Error Handling: Graceful degradation, edge cases
SDK BUGS DISCOVERED:
- limit(0) returns entries instead of empty result
- where() + containedIn() on same field causes TypeError
- search() with empty string breaks query chain
- addParam() with empty value breaks chain
- Metadata methods inconsistent with toJSON()
CONFIGURATION UPDATES:
- Updated test/config.js with 25 environment variables
- Updated jest.js.config.js to target integration tests
- Updated .gitignore to protect sensitive files
- Added branch configuration to Stack initialization
RESULTS:
✅ 737/737 tests passing (100%)
✅ 0 tests skipping
✅ Zero secrets exposed (security audit passed)
✅ Execution time: ~26 seconds
This test suite provides comprehensive coverage of the SDK while
maintaining portability and security for public repository use.1 parent a44441f commit 43f4e36
File tree
44 files changed
+19667
-57
lines changed- test
- helpers
- integration
- AdvancedTests
- AssetTests
- BranchTests
- CachePolicyTests
- ComplexScenarios
- ContentTypeTests
- EntryTests
- ErrorTests
- GlobalFieldsTests
- JSONRTETests
- LivePreviewTests
- LocaleTests
- MetadataTests
- ModularBlocksTests
- NetworkResilienceTests
- PerformanceTests
- PluginTests
- QueryTests
- RealWorldScenarios
- ReferenceTests
- RegionTests
- SDKUtilityTests
- SyncTests
- TaxonomyTests
- UtilityTests
- VariantTests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
44 files changed
+19667
-57
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
| 17 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
16 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
17 | 33 | | |
18 | 34 | | |
19 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
20 | 104 | | |
21 | 105 | | |
0 commit comments