Skip to content

Commit

Permalink
test(integ): minor code smells
Browse files Browse the repository at this point in the history
  • Loading branch information
elersong committed Jul 25, 2024
1 parent 6067995 commit 97c7569
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion test/functional/4-transactions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ describe('Integration test: Transactions', () => {
expect(savedBand.id).toEqual(band.id);

const createdAlbums = await band.albums.find();
const orderedAlbums = createdAlbums.sort((a, b) => a.name.localeCompare(b.name));
const orderedAlbums = [...createdAlbums].sort((a, b) => a.name.localeCompare(b.name));

expect(orderedAlbums.length).toEqual(2);
expect(orderedAlbums[0].name).toEqual(albums[0].name);
Expand Down
6 changes: 3 additions & 3 deletions test/functional/5-batches.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe('Integration test: Batches', () => {
.whereArrayContains(b => b.genres, 'custom-genre')
.find();

const orderedBands = createdBands.sort((a, b) => b.name.localeCompare(a.name));
const orderedBands = [...createdBands].sort((a, b) => b.name.localeCompare(a.name));

expect(orderedBands.length).toEqual(2);
expect(orderedBands[0].name).toEqual(bands[0].name);
Expand Down Expand Up @@ -140,7 +140,7 @@ describe('Integration test: Batches', () => {
.whereArrayContains(b => b.genres, 'custom-genre')
.find();

const orderedBands = createdBands.sort((a, b) => b.name.localeCompare(a.name));
const orderedBands = [...createdBands].sort((a, b) => b.name.localeCompare(a.name));

expect(orderedBands.length).toEqual(2);
expect(orderedBands[0].name).toEqual(bands[0].name);
Expand Down Expand Up @@ -216,7 +216,7 @@ describe('Integration test: Batches', () => {
// Assert that the subcollection was actually created
const createdAlbums = await band.albums.find();

const orderedAlbums = createdAlbums.sort((a, b) => a.name.localeCompare(b.name));
const orderedAlbums = [...createdAlbums].sort((a, b) => a.name.localeCompare(b.name));

expect(orderedAlbums.length).toEqual(2);
expect(orderedAlbums[0].name).toEqual(albums[0].name);
Expand Down

0 comments on commit 97c7569

Please sign in to comment.