Skip to content

Commit 8f71bec

Browse files
committed
test: improve test coverage from 83.78% to 84.10%
Add comprehensive HTTP mocking tests for github.ts and edge case tests for objects.ts: - Add nock dev dependency (14.0.10) for HTTP mocking infrastructure - Add 14 tests for github.ts covering fetchGitHub, resolveRefToSha, fetchGhsaDetails, and cacheFetchGhsa - HTTP success and error handling (rate limits, 403, 404) - Authorization headers and custom headers - Tag, annotated tag, branch, and commit SHA resolution - GHSA advisory fetching and caching - Add 7 tests for objects.ts covering internal attributes access and merge edge cases - Internal kInternalsSymbol getters (attributes, lazyGetterStats) - Merge behavior with null/undefined target/source - Array merging skip branches - Improve objects.ts coverage from 96.12% to 97.67% with 100% function coverage - Improve github.ts coverage significantly from 19.48% - Update README badge to reflect new coverage: 84.10%
1 parent a0900d1 commit 8f71bec

File tree

5 files changed

+405
-1
lines changed

5 files changed

+405
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Socket Badge](https://socket.dev/api/badge/npm/package/@socketsecurity/lib)](https://socket.dev/npm/package/@socketsecurity/lib)
44
[![CI](https://github.com/SocketDev/socket-lib/actions/workflows/ci.yml/badge.svg)](https://github.com/SocketDev/socket-lib/actions/workflows/ci.yml)
5-
![Coverage](https://img.shields.io/badge/coverage-83.78%25-brightgreen)
5+
![Coverage](https://img.shields.io/badge/coverage-84.10%25-brightgreen)
66

77
[![Follow @SocketSecurity](https://img.shields.io/twitter/follow/SocketSecurity?style=social)](https://twitter.com/SocketSecurity)
88
[![Follow @socket.dev on Bluesky](https://img.shields.io/badge/Follow-@socket.dev-1DA1F2?style=social&logo=bluesky)](https://bsky.app/profile/socket.dev)

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,7 @@
742742
"lint-staged": "15.2.11",
743743
"magic-string": "0.30.17",
744744
"make-fetch-happen": "15.0.2",
745+
"nock": "14.0.10",
745746
"normalize-package-data": "8.0.0",
746747
"npm-package-arg": "13.0.0",
747748
"pacote": "21.0.1",

pnpm-lock.yaml

Lines changed: 70 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)