Skip to content

Commit

Permalink
Fixed test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Beal committed Jan 15, 2023
1 parent 7c37e9f commit c0f1f22
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions packages/core/src/in-memory.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defaultIndexDescription, InMemoryDataRepo, KeyType, WriteResult } from '.';
import { defaultIndexDescription, InMemoryDataRepo, KeyType, ReadResult, WriteResult } from '.';
import _ from 'lodash';

describe(InMemoryDataRepo.name, function () {
Expand Down Expand Up @@ -80,18 +80,18 @@ describe(InMemoryDataRepo.name, function () {
it('Finds a user', async function () {
await testStore.putObjects([firstUser, secondUser]);
const found = await testStore.getObject({ userId: firstUser.userId });
expect(found).toStrictEqual(firstUser);
expect(found.data).toStrictEqual(firstUser);
});

it('Finds other user', async function () {
await testStore.putObjects([firstUser, secondUser]);
const found = await testStore.getObject({ userId: secondUser.userId });
expect(found).toStrictEqual(secondUser);
expect(found.data).toStrictEqual(secondUser);
});

it('Returns null', async function () {
it('Returns undefined', async function () {
await testStore.putObjects([firstUser, secondUser]);
expect(await testStore.getObject({ userId: 3 })).toBeNull();
expect((await testStore.getObject({ userId: 3 })).data).toBeUndefined();
});
});

Expand Down Expand Up @@ -140,7 +140,8 @@ describe(InMemoryDataRepo.name, function () {
]);
await testStore.putObjects(otherMeasures);
const foundMeasures = await testStore.listObjects({ name: measures[0].name });
expect(foundMeasures).toHaveLength(measures.length);
expect(foundMeasures.data).toHaveLength(measures.length);
expect(foundMeasures.result).toBe(ReadResult.FOUND);
});
});
});

0 comments on commit c0f1f22

Please sign in to comment.