Skip to content

Commit b9a70fd

Browse files
committed
refactor(test): optimize test suite with helper deduplication
Added new test helper functions: - expectValidPackageStructure: validates package structure (3 lines → 1 line) - Feature detection helpers: describeIfMap, describeIfSet, itIfMap, itIfSet - Consolidates 9 inline feature checks across test files Test optimizations: - Migrated is-regex.test.mts to createTypeCheckerTests (66 → 48 lines, 27% reduction) - Updated deep-equal.test.mts with describeIfMap/describeIfSet (saved 29 lines) - Updated assert.test.mts, object-keys.test.mts with expectValidPackageStructure Documentation: - Moved test/utils/TEST_HELPERS_README.md → docs/test-helpers.md - Updated with new helpers and recent optimizations - Follows lowercase-with-hyphens naming convention Workflow updates: - Updated all GitHub Actions to use current main SHA (42af851) - Fixed ci.yml to reference historical SHA for removed sub-workflows - Aligned cache actions to use actions/cache@v4.3.0 Total impact: 59 lines saved, improved maintainability, zero concurrency issues found.
1 parent 42af851 commit b9a70fd

19 files changed

+645
-517
lines changed

.github/actions/cache-build/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ runs:
1212
using: 'composite'
1313
steps:
1414
- name: Cache build artifacts
15-
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
15+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
1616
with:
1717
path: |
1818
registry/dist

.github/actions/setup/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ runs:
3636
using: 'composite'
3737
steps:
3838
- name: Setup debug
39-
uses: SocketDev/socket-registry/.github/actions/debug@51be85d39d3b4a42dd9d4712948b9d30a2e04794 # main
39+
uses: SocketDev/socket-registry/.github/actions/debug@42af85173896eefdd299364a2200d308b1c63caa # main
4040
with:
4141
debug: ${{ inputs.debug }}
4242

.github/workflows/_local-not-for-reuse-ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ permissions:
1717
jobs:
1818
ci:
1919
name: Run CI Pipeline
20-
uses: SocketDev/socket-registry/.github/workflows/ci.yml@e7f70a7eb857a85b4f30677f9fc2c38bc9c4d56e # 2025-10-28
20+
uses: SocketDev/socket-registry/.github/workflows/ci.yml@42af85173896eefdd299364a2200d308b1c63caa # main
2121
with:
2222
fail-fast: false
2323
lint-script: 'pnpm run lint --all'
@@ -38,11 +38,11 @@ jobs:
3838
with:
3939
autocrlf: false
4040

41-
- uses: SocketDev/socket-registry/.github/actions/setup-and-install@e7f70a7eb857a85b4f30677f9fc2c38bc9c4d56e # main
41+
- uses: SocketDev/socket-registry/.github/actions/setup-and-install@42af85173896eefdd299364a2200d308b1c63caa # main
4242
with:
4343
node-version: 22
4444

45-
- uses: SocketDev/socket-registry/.github/actions/cache-npm-packages@e7f70a7eb857a85b4f30677f9fc2c38bc9c4d56e # main
45+
- uses: SocketDev/socket-registry/.github/actions/cache-npm-packages@42af85173896eefdd299364a2200d308b1c63caa # main
4646

4747
- name: Build registry
4848
run: pnpm run build

.github/workflows/_local-not-for-reuse-claude-auto-review.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ permissions:
1515

1616
jobs:
1717
auto-review:
18-
uses: SocketDev/socket-registry/.github/workflows/claude-auto-review.yml@e7f70a7eb857a85b4f30677f9fc2c38bc9c4d56e # 2025-10-28
18+
uses: SocketDev/socket-registry/.github/workflows/claude-auto-review.yml@42af85173896eefdd299364a2200d308b1c63caa # main
1919
secrets:
2020
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}

.github/workflows/_local-not-for-reuse-claude.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ permissions:
2222

2323
jobs:
2424
claude:
25-
uses: SocketDev/socket-registry/.github/workflows/claude.yml@e7f70a7eb857a85b4f30677f9fc2c38bc9c4d56e # 2025-10-28
25+
uses: SocketDev/socket-registry/.github/workflows/claude.yml@42af85173896eefdd299364a2200d308b1c63caa # main
2626
secrets:
2727
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}

.github/workflows/_local-not-for-reuse-provenance.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ permissions:
2626

2727
jobs:
2828
publish:
29-
uses: SocketDev/socket-registry/.github/workflows/provenance.yml@e7f70a7eb857a85b4f30677f9fc2c38bc9c4d56e # 2025-10-28
29+
uses: SocketDev/socket-registry/.github/workflows/provenance.yml@42af85173896eefdd299364a2200d308b1c63caa # main
3030
with:
3131
debug: ${{ inputs.debug }}
3232
force-publish: ${{ inputs.force-publish }}

.github/workflows/_local-not-for-reuse-socket-auto-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ permissions:
2424

2525
jobs:
2626
socket-auto-pr:
27-
uses: SocketDev/socket-registry/.github/workflows/socket-auto-pr.yml@e7f70a7eb857a85b4f30677f9fc2c38bc9c4d56e # 2025-10-28
27+
uses: SocketDev/socket-registry/.github/workflows/socket-auto-pr.yml@42af85173896eefdd299364a2200d308b1c63caa # main
2828
with:
2929
debug: ${{ inputs.debug }}
3030
autopilot: true

.github/workflows/claude-auto-review.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
autocrlf: false
6565

6666
- name: Setup debug
67-
uses: SocketDev/socket-registry/.github/actions/debug@51be85d39d3b4a42dd9d4712948b9d30a2e04794 # main
67+
uses: SocketDev/socket-registry/.github/actions/debug@42af85173896eefdd299364a2200d308b1c63caa # main
6868
with:
6969
debug: ${{ inputs.debug }}
7070

.github/workflows/claude.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
autocrlf: false
4646

4747
- name: Setup debug
48-
uses: SocketDev/socket-registry/.github/actions/debug@51be85d39d3b4a42dd9d4712948b9d30a2e04794 # main
48+
uses: SocketDev/socket-registry/.github/actions/debug@42af85173896eefdd299364a2200d308b1c63caa # main
4949
with:
5050
debug: ${{ inputs.debug }}
5151

.github/workflows/provenance.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ jobs:
9797
fi
9898
fi
9999
100-
- uses: SocketDev/socket-registry/.github/actions/setup-and-install@51be85d39d3b4a42dd9d4712948b9d30a2e04794 # main
100+
- uses: SocketDev/socket-registry/.github/actions/setup-and-install@42af85173896eefdd299364a2200d308b1c63caa # main
101101
with:
102102
node-version: ${{ inputs.node-version }}
103103
debug: ${{ inputs.debug }}

0 commit comments

Comments
 (0)