mirror of
https://github.com/iflytek/skillhub.git
synced 2026-08-28 11:25:00 +00:00
- Use Bun.which() with process.execPath fallback in run-cli helper to resolve bun executable on Windows (fixes 22 integration tests) - Normalize paths in credentials-store test for Windows backslash compat - Use shell: true on Windows in updater spawn for proper exe resolution
15 lines
735 B
TypeScript
15 lines
735 B
TypeScript
import { describe, expect, test } from 'bun:test'
|
|
import { normalize } from 'path'
|
|
import { createTempHome } from '../../helpers/temp-env'
|
|
import { CredentialsStore } from '../../../src/stores/credentials-store'
|
|
|
|
describe('CredentialsStore', () => {
|
|
test('stores tokens under user home .skillhub only', async () => {
|
|
const env = await createTempHome()
|
|
const store = new CredentialsStore(env.home)
|
|
await store.setToken('https://registry.example.com', 'sk_test')
|
|
expect(await store.getToken('https://registry.example.com')).toBe('sk_test')
|
|
expect(normalize(store.path)).toBe(normalize(`${env.home}/.skillhub/credentials.json`))
|
|
expect(await Bun.file(`${env.cwd}/credentials.json`).exists()).toBe(false)
|
|
})
|
|
})
|