Skip to content

Commit 66d61a5

Browse files
committed
fix: update CI workflow to use unified test commands
- Replace non-existent pretest:unit and test:unit:coverage scripts - Update coverage generation to use 'pnpm run test --coverage' - Use 'pnpm run cover' for coverage collection in CI - Fix test-setup and type-check-setup to use build command
1 parent ca8540d commit 66d61a5

File tree

3 files changed

+7
-15
lines changed

3 files changed

+7
-15
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ jobs:
1919
name: Run CI Pipeline
2020
uses: SocketDev/socket-registry/.github/workflows/ci.yml@17c8e09407f67149512e95e082a9c77dfe8e27a4 # main
2121
with:
22-
coverage-script: 'pnpm run test:unit:coverage'
23-
coverage-report-script: 'pnpm run coverage:percent --json'
22+
coverage-script: 'pnpm run cover'
23+
coverage-report-script: 'pnpm run cover --percent'
2424
fail-fast: false
2525
lint-script: 'pnpm run lint-ci'
2626
node-versions: '[20, 22, 24]'
2727
os-versions: '["ubuntu-latest", "windows-latest"]'
2828
test-script: 'pnpm run test-ci'
29-
test-setup-script: 'pnpm run pretest:unit'
29+
test-setup-script: 'pnpm run build'
3030
type-check-script: 'pnpm run type-ci'
31-
type-check-setup-script: 'pnpm run pretest:unit'
31+
type-check-setup-script: 'pnpm run build'

scripts/cover.mjs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,7 @@ async function main() {
4444
if (values['code-only']) {
4545
logger.log('Collecting code coverage...')
4646
const exitCode = await runSequence([
47-
{ args: ['run', 'pretest:unit'], command: 'pnpm' },
48-
{
49-
args: ['run', 'test:unit:coverage'],
50-
command: 'pnpm',
51-
},
47+
{ args: ['run', 'test', '--coverage'], command: 'pnpm' },
5248
])
5349
process.exitCode = exitCode
5450
return
@@ -58,11 +54,7 @@ async function main() {
5854
logger.log('Collecting coverage (code + type)...')
5955

6056
const codeExitCode = await runSequence([
61-
{ args: ['run', 'pretest:unit'], command: 'pnpm' },
62-
{
63-
args: ['run', 'test:unit:coverage'],
64-
command: 'pnpm',
65-
},
57+
{ args: ['run', 'test', '--coverage'], command: 'pnpm' },
6658
])
6759

6860
if (codeExitCode !== 0) {

scripts/utils/get-code-coverage.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export async function getCodeCoverage(options) {
3232
return null
3333
}
3434

35-
const result = await spawn('pnpm', ['run', 'test:unit:coverage'], {
35+
const result = await spawn('pnpm', ['run', 'test', '--coverage'], {
3636
stdio: 'ignore',
3737
shell: constants.WIN32,
3838
})

0 commit comments

Comments
 (0)