mirror of
https://github.com/stablyai/orca.git
synced 2026-11-15 10:27:33 +00:00
test: remove 145 low-value tests and nine suites (#37982)
* test: remove 145 low-value test declarations * test: clean up remaining type-only relay imports --------- Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
This commit is contained in:
@@ -1,50 +0,0 @@
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
|
||||
vi.mock('electron', () => ({ ipcRenderer: { invoke: vi.fn(), on: vi.fn() } }))
|
||||
|
||||
import { getWslHostsApi } from './wsl-hosts-api'
|
||||
|
||||
describe('WSL hosts preload API', () => {
|
||||
beforeEach(() => {
|
||||
vi.stubEnv('MODE', 'e2e')
|
||||
})
|
||||
afterEach(() => {
|
||||
vi.unstubAllEnvs()
|
||||
})
|
||||
|
||||
it('ignores the e2e fake outside an e2e build', () => {
|
||||
vi.stubEnv('MODE', 'production')
|
||||
const env = { ORCA_INTERNAL_WSL_HOSTS: '1', ORCA_E2E_FAKE_WSL_HOSTS: '{}' }
|
||||
expect(getWslHostsApi(env, 'linux')).toBeUndefined()
|
||||
expect(getWslHostsApi(env, 'win32')).toBeDefined()
|
||||
})
|
||||
|
||||
it('is absent on Windows and under the e2e fake while the internal gate is closed', () => {
|
||||
expect(getWslHostsApi({}, 'win32', [])).toBeUndefined()
|
||||
expect(getWslHostsApi({ ORCA_INTERNAL_WSL_HOSTS: 'true' }, 'win32', [])).toBeUndefined()
|
||||
expect(getWslHostsApi({ ORCA_E2E_FAKE_WSL_HOSTS: '{}' }, 'darwin', [])).toBeUndefined()
|
||||
})
|
||||
|
||||
it('is present behind the open gate only where WSL hosts can run', () => {
|
||||
expect(getWslHostsApi({ ORCA_INTERNAL_WSL_HOSTS: '1' }, 'win32')).toBeDefined()
|
||||
expect(
|
||||
getWslHostsApi({ ORCA_INTERNAL_WSL_HOSTS: '1', ORCA_E2E_FAKE_WSL_HOSTS: '{}' }, 'linux')
|
||||
).toBeDefined()
|
||||
expect(getWslHostsApi({ ORCA_INTERNAL_WSL_HOSTS: '1' }, 'darwin')).toBeUndefined()
|
||||
})
|
||||
|
||||
it('is present behind a closed gate when main stamped serve-only, still only where hosts run', () => {
|
||||
const argv = ['--orca-wsl-hosts-serve-only']
|
||||
expect(getWslHostsApi({}, 'win32', argv)).toBeDefined()
|
||||
expect(getWslHostsApi({ ORCA_E2E_FAKE_WSL_HOSTS: '{}' }, 'linux', argv)).toBeDefined()
|
||||
expect(getWslHostsApi({}, 'darwin', argv)).toBeUndefined()
|
||||
expect(getWslHostsApi({}, 'win32', [])).toBeUndefined()
|
||||
})
|
||||
|
||||
it('is absent behind an open gate a remote policy blocked, unless main stamped serve-only', () => {
|
||||
const env = { ORCA_INTERNAL_WSL_HOSTS: '1' }
|
||||
const blocked = '--orca-wsl-hosts-policy-blocked'
|
||||
expect(getWslHostsApi(env, 'win32', [blocked])).toBeUndefined()
|
||||
expect(getWslHostsApi(env, 'win32', [blocked, '--orca-wsl-hosts-serve-only'])).toBeDefined()
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user