test: remove 193 low-value tests (#39506)

Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
This commit is contained in:
OrcaWin
2026-11-07 06:20:37 -08:00
committed by GitHub
co-authored by OrcaWin
parent b07b0432a4
commit cc6900fc0b
58 changed files with 21 additions and 3505 deletions
+1 -50
View File
@@ -1,37 +1,5 @@
import { describe, expect, it } from 'vitest'
import {
ghAccountBindingsEqual,
ghTokenEnvVarForHost,
normalizeGhAccountBinding
} from './account-binding'
describe('normalizeGhAccountBinding', () => {
it('trims, lowercases host, and preserves user case', () => {
expect(normalizeGhAccountBinding({ host: ' GitHub.COM ', user: ' Alice ' })).toEqual({
host: 'github.com',
user: 'Alice'
})
})
it('rejects malformed shapes', () => {
expect(normalizeGhAccountBinding(null)).toBeNull()
expect(normalizeGhAccountBinding({ host: '', user: 'a' })).toBeNull()
expect(normalizeGhAccountBinding({ host: 'github.com', user: '' })).toBeNull()
expect(normalizeGhAccountBinding({ host: 'bad host', user: 'a' })).toBeNull()
expect(normalizeGhAccountBinding({ host: 'github.com', user: 'has space' })).toBeNull()
})
it('accepts GHES/LDAP logins with underscores and dots', () => {
expect(normalizeGhAccountBinding({ host: 'github.acme.com', user: 'svc_build' })).toEqual({
host: 'github.acme.com',
user: 'svc_build'
})
expect(normalizeGhAccountBinding({ host: 'github.acme.com', user: 'first.last' })).toEqual({
host: 'github.acme.com',
user: 'first.last'
})
})
})
import { ghTokenEnvVarForHost } from './account-binding'
describe('ghTokenEnvVarForHost', () => {
it('selects GH_TOKEN for github.com, github.localhost, and *.ghe.com', () => {
@@ -45,20 +13,3 @@ describe('ghTokenEnvVarForHost', () => {
expect(ghTokenEnvVarForHost('ghe.internal')).toBe('GH_ENTERPRISE_TOKEN')
})
})
describe('ghAccountBindingsEqual', () => {
it('compares equal pairs and preserves user case sensitivity', () => {
expect(
ghAccountBindingsEqual(
{ host: 'github.com', user: 'Alice' },
{ host: 'github.com', user: 'Alice' }
)
).toBe(true)
expect(
ghAccountBindingsEqual(
{ host: 'github.com', user: 'Alice' },
{ host: 'github.com', user: 'alice' }
)
).toBe(false)
})
})