Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/core/decision_service/cmab/cmab_client.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { getMockAbortableRequest, getMockRequestHandler } from '../../../tests/m
import { RequestHandler } from '../../../utils/http_request_handler/http';
import { advanceTimersByTime, exhaustMicrotasks } from '../../../tests/testUtils';
import { OptimizelyError } from '../../../error/optimizly_error';
import { CMAB_FETCH_FAILED, INVALID_CMAB_FETCH_RESPONSE } from 'error_message';

const mockSuccessResponse = (variation: string) => Promise.resolve({
statusCode: 200,
Expand Down Expand Up @@ -301,7 +302,7 @@ describe('DefaultCmabClient', () => {
const cmabUuid = 'uuid123';

await expect(cmabClient.fetchDecision(ruleId, userId, attributes, cmabUuid)).rejects.toMatchObject(
new OptimizelyError('CMAB_FETCH_FAILED', 500),
new OptimizelyError(CMAB_FETCH_FAILED, 500),
);
});

Expand Down Expand Up @@ -330,7 +331,7 @@ describe('DefaultCmabClient', () => {
const cmabUuid = 'uuid123';

await expect(cmabClient.fetchDecision(ruleId, userId, attributes, cmabUuid)).rejects.toMatchObject(
new OptimizelyError('INVALID_CMAB_RESPONSE'),
new OptimizelyError(INVALID_CMAB_FETCH_RESPONSE),
);
});

Expand Down
4 changes: 2 additions & 2 deletions lib/event_processor/event_store.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ describe('EventStore', () => {

await expect(store.set('event-1', event)).resolves.not.toThrow();
await expect(store.set('event-2', event)).resolves.not.toThrow();
await expect(store.set('event-3', event)).rejects.toThrow(new OptimizelyError(EVENT_STORE_FULL, event.id));
await expect(store.set('event-3', event)).rejects.toThrow(new OptimizelyError(EVENT_STORE_FULL, event.event.uuid));

const savedKeys = await store.getKeys();
savedKeys.sort();
Expand Down Expand Up @@ -410,7 +410,7 @@ describe('EventStore', () => {
await expect(store.set('key-1', event)).resolves.not.toThrow();
// this should fail, but in memory key list will become full
await expect(store.set('key-2', event)).rejects.toThrow('Simulated set failure');
await expect(store.set('key-3', event)).rejects.toThrow(new OptimizelyError(EVENT_STORE_FULL, event.id));
await expect(store.set('key-3', event)).rejects.toThrow(new OptimizelyError(EVENT_STORE_FULL, event.event.uuid));


let keys = await store.getKeys();
Expand Down
Loading
Loading