Skip to content

Commit 40497fb

Browse files
committed
fix(test): update integration script and docs for split binary tests
Update integration.mjs to run test/integration/binary/ directory instead of the deleted binary-test-suite.test.mts file. This fixes CI test discovery failures. Changes: - integration.mjs: Run test/integration/binary/ directory - Rename binary-test-helpers.mts → helpers.mts - Update imports in js.test.mts, sea.test.mts, smol.test.mts - Update README.md to list new test files - Update test-strategy.md docs and file tree This resolves "No test files found" CI error after test file split.
1 parent 2443f08 commit 40497fb

File tree

7 files changed

+24
-10
lines changed

7 files changed

+24
-10
lines changed

packages/cli/docs/test-strategy.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,10 @@ describe('socket scan', () => {
8888
```
8989

9090
**Test files**:
91-
- `binary-test-suite.test.mts` - Tests JS/smol/SEA binaries
91+
- `js.test.mts` - Tests JS distribution (144 tests)
92+
- `sea.test.mts` - Tests SEA binary (144 tests)
93+
- `smol.test.mts` - Tests smol binary (144 tests)
94+
- `helpers.mts` - Shared test utilities
9295
- `critical-commands.test.mts` - Tests core commands
9396
- `dlx-spawn.test.mts` - Tests dlx functionality
9497

@@ -163,8 +166,11 @@ packages/cli/
163166
│ ├── utils/
164167
│ └── ...
165168
├── test/integration/ → Integration tests
166-
│ ├── binary/ → CLI binary tests (3 files)
167-
│ │ ├── binary-test-suite.test.mts
169+
│ ├── binary/ → CLI binary tests (6 files)
170+
│ │ ├── js.test.mts
171+
│ │ ├── sea.test.mts
172+
│ │ ├── smol.test.mts
173+
│ │ ├── helpers.mts
168174
│ │ ├── critical-commands.test.mts
169175
│ │ └── dlx-spawn.test.mts
170176
│ └── api/ → API integration tests (2 files)
@@ -216,9 +222,14 @@ packages/cli/
216222
→ Size: ~70 MB
217223
```
218224

219-
### Binary Test Suite (`test/integration/binary/binary-test-suite.test.mts`)
225+
### Binary Test Suite (`test/integration/binary/`)
220226

221-
**Tests all three binary types**:
227+
**Separate test files for each binary type**:
228+
- `js.test.mts` - Tests JS distribution (144 tests)
229+
- `sea.test.mts` - Tests SEA binary (144 tests)
230+
- `smol.test.mts` - Tests smol binary (144 tests)
231+
232+
**Each test file validates**:
222233
- Environment variable support
223234
- Configuration loading
224235
- Command parsing

packages/cli/scripts/integration.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ async function runVitest(binaryType) {
115115
'--',
116116
vitestPath,
117117
'run',
118-
'test/integration/binary/binary-test-suite.test.mts',
118+
'test/integration/binary/',
119119
'--config',
120120
'vitest.integration.config.mts',
121121
],

packages/cli/test/integration/binary/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,10 @@ pnpm --filter @socketbin/node-sea-builder run build
8888

8989
## Test Files
9090

91-
- `binary-test-suite.test.mts` - Main test suite (tests all 3 distributions)
91+
- `js.test.mts` - JS distribution tests (144 tests)
92+
- `sea.test.mts` - SEA binary tests (144 tests)
93+
- `smol.test.mts` - Smol binary tests (144 tests)
94+
- `helpers.mts` - Shared test utilities
9295
- `critical-commands.test.mts` - Core CLI commands
9396
- `dlx-spawn.test.mts` - DLX functionality
9497

packages/cli/test/integration/binary/binary-test-helpers.mts renamed to packages/cli/test/integration/binary/helpers.mts

File renamed without changes.

packages/cli/test/integration/binary/js.test.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { beforeAll, describe, expect, it } from 'vitest'
77
import ENV from '../../../src/constants/env.mts'
88
import { getDefaultApiToken } from '../../../src/utils/socket/sdk.mts'
99
import { executeCliCommand } from '../../helpers/cli-execution.mts'
10-
import { ROOT_DIR, logger, prepareBinary, type BinaryConfig } from './binary-test-helpers.mts'
10+
import { ROOT_DIR, logger, prepareBinary, type BinaryConfig } from './helpers.mts'
1111

1212
const BINARY: BinaryConfig = {
1313
buildCommand: null,

packages/cli/test/integration/binary/sea.test.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { beforeAll, describe, expect, it } from 'vitest'
77
import ENV from '../../../src/constants/env.mts'
88
import { getDefaultApiToken } from '../../../src/utils/socket/sdk.mts'
99
import { executeCliCommand } from '../../helpers/cli-execution.mts'
10-
import { MONOREPO_ROOT, logger, prepareBinary, type BinaryConfig } from './binary-test-helpers.mts'
10+
import { MONOREPO_ROOT, logger, prepareBinary, type BinaryConfig } from './helpers.mts'
1111

1212
const BINARY: BinaryConfig = {
1313
buildCommand: [

packages/cli/test/integration/binary/smol.test.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { beforeAll, describe, expect, it } from 'vitest'
77
import ENV from '../../../src/constants/env.mts'
88
import { getDefaultApiToken } from '../../../src/utils/socket/sdk.mts'
99
import { executeCliCommand } from '../../helpers/cli-execution.mts'
10-
import { MONOREPO_ROOT, logger, prepareBinary, type BinaryConfig } from './binary-test-helpers.mts'
10+
import { MONOREPO_ROOT, logger, prepareBinary, type BinaryConfig } from './helpers.mts'
1111

1212
const BINARY: BinaryConfig = {
1313
buildCommand: [

0 commit comments

Comments
 (0)