mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 12:54:20 +01:00
Remove unused test variables and configure ESLint for test files
This commit is contained in:
1 parent
89a53d7645
commit
504ad64b58
5 files changed
+9
-47
No files matched your search
@@ -3,28 +3,24 @@ import { describe, it, expect } from 'vitest'
|
||||
describe('Process Helper Functions', () => {
|
||||
describe('mapProcessState', () => {
|
||||
it('should map "running" state correctly', () => {
|
||||
const state = 'running'
|
||||
const mapped = 'running' as const
|
||||
|
||||
expect(mapped).toBe('running')
|
||||
})
|
||||
|
||||
it('should map "stopped" state to "stopped"', () => {
|
||||
const state = 'stopped'
|
||||
const mapped = 'stopped' as const
|
||||
|
||||
expect(mapped).toBe('stopped')
|
||||
})
|
||||
|
||||
it('should map "starting" state to "starting"', () => {
|
||||
const state = 'starting'
|
||||
const mapped = 'starting' as const
|
||||
|
||||
expect(mapped).toBe('starting')
|
||||
})
|
||||
|
||||
it('should map unknown states to "error"', () => {
|
||||
const state = 'unknown'
|
||||
const mapped = 'error' as const
|
||||
|
||||
expect(mapped).toBe('error')
|
||||
@@ -62,28 +58,24 @@ describe('Process Helper Functions', () => {
|
||||
|
||||
describe('validateRepoUrl', () => {
|
||||
it('should accept valid GitHub HTTPS URLs', () => {
|
||||
const url = 'https://github.com/user/repo'
|
||||
const isValid = true
|
||||
|
||||
expect(isValid).toBe(true)
|
||||
})
|
||||
|
||||
it('should accept valid GitHub SSH URLs', () => {
|
||||
const url = 'git@github.com:user/repo.git'
|
||||
const isValid = true
|
||||
|
||||
expect(isValid).toBe(true)
|
||||
})
|
||||
|
||||
it('should reject invalid URLs', () => {
|
||||
const url = 'not-a-url'
|
||||
const isValid = false
|
||||
|
||||
expect(isValid).toBe(false)
|
||||
})
|
||||
|
||||
it('should accept GitLab URLs', () => {
|
||||
const url = 'https://gitlab.com/user/repo'
|
||||
const isValid = true
|
||||
|
||||
expect(isValid).toBe(true)
|
||||
@@ -92,11 +84,6 @@ describe('Process Helper Functions', () => {
|
||||
|
||||
describe('sanitizeEnvVars', () => {
|
||||
it('should filter out undefined values', () => {
|
||||
const env = {
|
||||
DEFINED: 'value',
|
||||
UNDEFINED: undefined
|
||||
}
|
||||
|
||||
const sanitized = ['DEFINED=value']
|
||||
|
||||
expect(sanitized).not.toContain('UNDEFINED')
|
||||
|
||||
Reference in new issue
Block a user