mirror of
https://github.com/stablyai/orca.git
synced 2026-11-19 04:23:57 +00:00
16 lines
669 B
TypeScript
16 lines
669 B
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import { ghTokenEnvVarForHost } from './account-binding'
|
|
|
|
describe('ghTokenEnvVarForHost', () => {
|
|
it('selects GH_TOKEN for github.com, github.localhost, and *.ghe.com', () => {
|
|
expect(ghTokenEnvVarForHost('github.com')).toBe('GH_TOKEN')
|
|
expect(ghTokenEnvVarForHost('github.localhost')).toBe('GH_TOKEN')
|
|
expect(ghTokenEnvVarForHost('acme.ghe.com')).toBe('GH_TOKEN')
|
|
})
|
|
|
|
it('selects GH_ENTERPRISE_TOKEN for classic GHES hosts', () => {
|
|
expect(ghTokenEnvVarForHost('github.acme-corp.com')).toBe('GH_ENTERPRISE_TOKEN')
|
|
expect(ghTokenEnvVarForHost('ghe.internal')).toBe('GH_ENTERPRISE_TOKEN')
|
|
})
|
|
})
|