@lableb/javascript-sdk
Version:
Lableb cloud search client for javascript
46 lines (28 loc) • 990 B
text/typescript
import { MESSAGES } from "../../config/messages";
import { LablebClient } from "./lableb-client";
describe('Test global options to lableb client', () => {
test('create init client', async () => {
LablebClient();
});
test('should not throw error and convert to string easily', async () => {
LablebClient({
APIKey: 768525262211591,
indexName: 8934736424234,
autocompleteHandler: 969178174,
indexingAPIKey: 89168414,
platformName: 198479834792834,
recommendHandler: 8934815812414,
searchHandler: 7826187681,
} as any);
});
test('should throw error when passing objects as a string', async () => {
try {
LablebClient({
APIKey: {},
platformName: 'test',
} as any);
} catch (error) {
expect(error.message).toContain('APIKey must be a `string`')
}
});
});