Skip to content

Commit 3b79457

Browse files
tanderson-ldTodd Anderson
andauthored
chore: removing 'at' usage in test (#881)
Co-authored-by: Todd Anderson <[email protected]>
1 parent eae1812 commit 3b79457

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

packages/sdk/server-node/__tests__/platform/NodeInfo.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ describe('given an information instance with mock data', () => {
4242
versionSpy.mockReturnValue('0.0.0');
4343

4444
const archSpy = jest.spyOn(os, 'arch');
45-
archSpy.mockReturnValue('potato');
45+
archSpy.mockReturnValue('s390x');
4646

4747
global.process = {
4848
...process,
@@ -54,7 +54,7 @@ describe('given an information instance with mock data', () => {
5454
expect(data.os).toBeDefined();
5555
expect(data.os?.name).toEqual('MacOS');
5656
expect(data.os?.version).toEqual('0.0.0');
57-
expect(data.os?.arch).toEqual('potato');
57+
expect(data.os?.arch).toEqual('s390x');
5858
expect(data.additional!.nodeVersion).toEqual('1.2.3');
5959
});
6060

packages/shared/sdk-client/__tests__/flag-manager/ContextIndex.test.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,24 @@ describe('ContextIndex tests', () => {
88
indexUnderTest.notice('third', 3);
99

1010
expect(indexUnderTest.container.index.length).toEqual(3);
11-
expect(indexUnderTest.container.index.at(0)).toEqual({ id: 'first', timestamp: 1 });
12-
expect(indexUnderTest.container.index.at(1)).toEqual({ id: 'second', timestamp: 2 });
13-
expect(indexUnderTest.container.index.at(2)).toEqual({ id: 'third', timestamp: 3 });
11+
expect(indexUnderTest.container.index[0]).toEqual({ id: 'first', timestamp: 1 });
12+
expect(indexUnderTest.container.index[1]).toEqual({ id: 'second', timestamp: 2 });
13+
expect(indexUnderTest.container.index[2]).toEqual({ id: 'third', timestamp: 3 });
1414
});
1515

1616
test('notice updates timestamp', async () => {
1717
const indexUnderTest = new ContextIndex();
1818
indexUnderTest.notice('first', 1);
1919
indexUnderTest.notice('second', 2);
2020
expect(indexUnderTest.container.index.length).toEqual(2);
21-
expect(indexUnderTest.container.index.at(0)).toEqual({ id: 'first', timestamp: 1 });
22-
expect(indexUnderTest.container.index.at(1)).toEqual({ id: 'second', timestamp: 2 });
21+
expect(indexUnderTest.container.index[0]).toEqual({ id: 'first', timestamp: 1 });
22+
expect(indexUnderTest.container.index[1]).toEqual({ id: 'second', timestamp: 2 });
2323

2424
indexUnderTest.notice('first', 3);
2525
indexUnderTest.notice('second', 4);
2626
expect(indexUnderTest.container.index.length).toEqual(2);
27-
expect(indexUnderTest.container.index.at(0)).toEqual({ id: 'first', timestamp: 3 });
28-
expect(indexUnderTest.container.index.at(1)).toEqual({ id: 'second', timestamp: 4 });
27+
expect(indexUnderTest.container.index[0]).toEqual({ id: 'first', timestamp: 3 });
28+
expect(indexUnderTest.container.index[1]).toEqual({ id: 'second', timestamp: 4 });
2929
});
3030

3131
test('prune oldest down to maximum', async () => {
@@ -38,8 +38,8 @@ describe('ContextIndex tests', () => {
3838

3939
indexUnderTest.prune(2);
4040
expect(indexUnderTest.container.index.length).toEqual(2);
41-
expect(indexUnderTest.container.index.at(0)).toEqual({ id: 'first', timestamp: 50 });
42-
expect(indexUnderTest.container.index.at(1)).toEqual({ id: 'fourth', timestamp: 51 });
41+
expect(indexUnderTest.container.index[0]).toEqual({ id: 'first', timestamp: 50 });
42+
expect(indexUnderTest.container.index[1]).toEqual({ id: 'fourth', timestamp: 51 });
4343
});
4444

4545
test('prune oldest down to 0', async () => {
@@ -94,9 +94,9 @@ describe('ContextIndex tests', () => {
9494
'{"index":[{"id":"first","timestamp":1},{"id":"second","timestamp":2},{"id":"third","timestamp":3}]}';
9595
const indexUnderTest = ContextIndex.fromJson(input);
9696
expect(indexUnderTest.container.index.length).toEqual(3);
97-
expect(indexUnderTest.container.index.at(0)).toEqual({ id: 'first', timestamp: 1 });
98-
expect(indexUnderTest.container.index.at(1)).toEqual({ id: 'second', timestamp: 2 });
99-
expect(indexUnderTest.container.index.at(2)).toEqual({ id: 'third', timestamp: 3 });
97+
expect(indexUnderTest.container.index[0]).toEqual({ id: 'first', timestamp: 1 });
98+
expect(indexUnderTest.container.index[1]).toEqual({ id: 'second', timestamp: 2 });
99+
expect(indexUnderTest.container.index[2]).toEqual({ id: 'third', timestamp: 3 });
100100
});
101101

102102
test('fromJson invalid', async () => {

0 commit comments

Comments
 (0)