Skip to content

Commit ba3742e

Browse files
committed
fix: remove VITEST bypass from version getters
Version getters should fail if environment variables aren't set, even in test mode, because values should be properly defined in external-tools.json.
1 parent 4be635a commit ba3742e

File tree

3 files changed

+0
-18
lines changed

3 files changed

+0
-18
lines changed

packages/cli/src/env/coana-version.mts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,9 @@
88

99
import process from 'node:process'
1010

11-
import { VITEST } from './vitest.mts'
12-
1311
export function getCoanaVersion(): string {
1412
const version = process.env['INLINED_SOCKET_CLI_COANA_VERSION']
1513
if (!version) {
16-
// In test mode, return empty string instead of throwing.
17-
if (VITEST) {
18-
return ''
19-
}
2014
throw new Error(
2115
'INLINED_SOCKET_CLI_COANA_VERSION not found. Please ensure @coana-tech/cli is properly configured in external-tools.json.',
2216
)

packages/cli/src/env/sfw-version.mts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,9 @@
88

99
import process from 'node:process'
1010

11-
import { VITEST } from './vitest.mts'
12-
1311
export function getSwfVersion(): string {
1412
const version = process.env['INLINED_SOCKET_CLI_SFW_VERSION']
1513
if (!version) {
16-
// In test mode, return empty string instead of throwing.
17-
if (VITEST) {
18-
return ''
19-
}
2014
throw new Error(
2115
'INLINED_SOCKET_CLI_SFW_VERSION not found. Please ensure sfw is properly configured in external-tools.json.',
2216
)

packages/cli/src/env/socket-patch-version.mts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,9 @@
88

99
import process from 'node:process'
1010

11-
import { VITEST } from './vitest.mts'
12-
1311
export function getSocketPatchVersion(): string {
1412
const version = process.env['INLINED_SOCKET_CLI_SOCKET_PATCH_VERSION']
1513
if (!version) {
16-
// In test mode, return empty string instead of throwing.
17-
if (VITEST) {
18-
return ''
19-
}
2014
throw new Error(
2115
'INLINED_SOCKET_CLI_SOCKET_PATCH_VERSION not found. Please ensure socket-patch is properly configured in external-tools.json.',
2216
)

0 commit comments

Comments
 (0)