Skip to content

Commit 2f7d954

Browse files
committed
apply review feedback
1 parent cfefdc3 commit 2f7d954

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/__testUtils__/expectEqualPromisesOrValues.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ import { expectMatchingValues } from './expectMatchingValues';
88
export function expectEqualPromisesOrValues<T>(
99
items: ReadonlyArray<PromiseOrValue<T>>,
1010
): PromiseOrValue<T> {
11-
const remainingItems = items.slice();
12-
const firstItem = remainingItems.shift();
13-
11+
const [firstItem, ...remainingItems] = items;
1412
if (isPromise(firstItem)) {
1513
if (remainingItems.every(isPromise)) {
1614
return Promise.all(items).then(expectMatchingValues);
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { expectJSON } from './expectJSON';
22

33
export function expectMatchingValues<T>(values: ReadonlyArray<T>): T {
4-
const remainingValues = values.slice(1);
4+
const [firstValue, ...remainingValues] = values;
55
for (const value of remainingValues) {
6-
expectJSON(value).toDeepEqual(values[0]);
6+
expectJSON(value).toDeepEqual(firstValue);
77
}
8-
return values[0];
8+
return firstValue;
99
}

0 commit comments

Comments
 (0)