Skip to content

Commit

Permalink
Review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
jhamon committed Sep 13, 2023
1 parent be84404 commit aff71fe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
7 changes: 6 additions & 1 deletion src/integration/data/deleteMany.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ describe('deleteMany', () => {

test('verify deleteMany with ids', async () => {
const recordsToUpsert = generateRecords(5, 3);
expect(recordsToUpsert).toHaveLength(3);
expect(recordsToUpsert[0].id).toEqual('0');
expect(recordsToUpsert[1].id).toEqual('1');
expect(recordsToUpsert[2].id).toEqual('2');

await ns.upsert(recordsToUpsert);

// Check records got upserted
Expand Down Expand Up @@ -61,7 +66,7 @@ describe('deleteMany', () => {
);
}

// Check that record 1 still exists
// Check that record id='1' still exists
const fetchResult2 = await ns.fetch(['1']);
const records2 = fetchResult2.records;
if (records2) {
Expand Down
9 changes: 3 additions & 6 deletions src/integration/test-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,11 @@ export const generateRecords = (

export const generateSparseValues = (dimension: number): RecordSparseValues => {
const values: number[] = [];
const indecies: number[] = [];
const indices: number[] = [];
for (let j = 0; j < dimension; j++) {
values.push(Math.random());
indecies.push(j);
indices.push(j);
}
const sparseValues: RecordSparseValues = {
indices: indecies,
values: values,
};
const sparseValues: RecordSparseValues = { indices, values };
return sparseValues;
};

0 comments on commit aff71fe

Please sign in to comment.