Commit c78feef
committed
test: add comprehensive unit tests for picomatch glob pattern matching in findReleaseAsset
Added extensive test coverage for the new glob pattern functionality in releases/github:
**Glob Pattern Tests (14 tests):**
- Simple wildcards (yoga-sync-*.mjs)
- Multiple wildcards (models-*-*.tar.gz)
- Brace expansion ({yoga,models}-*.{mjs,js})
- Glob star patterns (**/*.mjs)
- Prefix/suffix wildcards (*-models.tar.gz, yoga-*)
- Exact matches (no wildcards)
- Case sensitivity validation
- Platform-specific binaries (node-darwin-*, node-win-*.exe, node-*-musl)
- File extension matching (*.wasm)
- No match scenarios
**Backward Compatibility Tests (3 tests):**
- Object pattern {prefix, suffix} matching
- Exact prefix/suffix matches
- No match scenarios for object patterns
**RegExp Pattern Tests (3 tests):**
- Basic RegExp matching
- Complex RegExp with date patterns
- No match scenarios for RegExp
**Edge Cases (8 tests):**
- Empty assets array
- Empty releases array
- Multiple matching releases (first wins)
- Multiple matching assets (first wins)
- Special regex characters in patterns
- Assets with similar prefixes
- Pattern matching with dots (literal, not wildcard)
- Asset name disambiguation
**Error Handling (2 tests):**
- HTTP request failures with retry behavior
- Malformed JSON responses with retry behavior
Total: 30 new tests covering all aspects of the glob pattern matching functionality,
plus 14 existing picomatch integration tests.
All tests pass, verifying that the new picomatch-based pattern matching works correctly
alongside existing object and RegExp patterns.1 parent 68e415d commit c78feef
1 file changed
Lines changed: 585 additions & 1 deletion
0 commit comments