feat(release): prepare 1.1.0 candidate
This commit is contained in:
parent
5a34f66981
commit
5205dcdfa9
736 changed files with 115667 additions and 12203 deletions
|
|
@ -2,23 +2,27 @@
|
|||
// createD3roSupabaseClient 팩토리 유닛 테스트
|
||||
|
||||
import { describe, it, expect } from 'vitest'
|
||||
import { createD3roSupabaseClient, isClientConfigured } from '../src/client'
|
||||
import {
|
||||
createD3roSupabaseClient,
|
||||
isClientConfigured,
|
||||
SupabaseConfigurationError,
|
||||
} from '../src/client'
|
||||
|
||||
describe('createD3roSupabaseClient', () => {
|
||||
it('URL과 key가 없으면 placeholder 클라이언트를 반환한다', () => {
|
||||
const client = createD3roSupabaseClient({ url: undefined, anonKey: undefined })
|
||||
expect(client).toBeDefined()
|
||||
// auth, from 등 메서드가 존재해야 함
|
||||
expect(typeof client.auth.getSession).toBe('function')
|
||||
expect(typeof client.from).toBe('function')
|
||||
it('URL과 key가 없으면 설정 오류로 즉시 실패한다', () => {
|
||||
expect(() => createD3roSupabaseClient({ url: undefined, anonKey: undefined }))
|
||||
.toThrow(SupabaseConfigurationError)
|
||||
})
|
||||
|
||||
it('URL만 있고 key가 없으면 placeholder 클라이언트를 반환한다', () => {
|
||||
const client = createD3roSupabaseClient({
|
||||
it('URL이나 key 중 하나만 있거나 공백이면 설정 오류로 즉시 실패한다', () => {
|
||||
expect(() => createD3roSupabaseClient({
|
||||
url: 'https://real.supabase.co',
|
||||
anonKey: undefined
|
||||
})
|
||||
expect(client).toBeDefined()
|
||||
anonKey: undefined,
|
||||
})).toThrow(SupabaseConfigurationError)
|
||||
expect(() => createD3roSupabaseClient({
|
||||
url: ' ',
|
||||
anonKey: 'anon-key',
|
||||
})).toThrow(SupabaseConfigurationError)
|
||||
})
|
||||
|
||||
it('URL과 key가 모두 있으면 실제 클라이언트를 생성한다', () => {
|
||||
|
|
@ -60,5 +64,6 @@ describe('isClientConfigured', () => {
|
|||
it('빈 문자열은 false로 처리된다', () => {
|
||||
expect(isClientConfigured({ url: '', anonKey: 'k' })).toBe(false)
|
||||
expect(isClientConfigured({ url: 'https://x.supabase.co', anonKey: '' })).toBe(false)
|
||||
expect(isClientConfigured({ url: ' ', anonKey: 'k' })).toBe(false)
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue