apix/lib/whisk-client.test.ts
Khoa.vo 8741e3b89f
Some checks are pending
CI / build (18.x) (push) Waiting to run
CI / build (20.x) (push) Waiting to run
feat: Initial commit with multi-provider image generation
2026-01-05 13:50:35 +07:00

23 lines
862 B
TypeScript

import { describe, it, expect } from 'vitest';
import { WhiskClient } from './whisk-client';
describe('WhiskClient', () => {
it('should throw error if no cookies provided', () => {
expect(() => new WhiskClient('')).toThrow('No valid cookies provided');
});
it('should parse cookie string correctly', () => {
const client = new WhiskClient('foo=bar; baz=qux');
// Accessing private property for testing via casting or just trusting constructor didn't fail
expect(client).toBeDefined();
});
it('should parse JSON cookies correctly', () => {
const jsonCookies = JSON.stringify([
{ name: 'foo', value: 'bar' },
{ name: 'baz', value: 'qux' }
]);
const client = new WhiskClient(jsonCookies);
expect(client).toBeDefined();
});
});