Skip to content

Commit 1d1f9cf

Browse files
committed
Pass the test values as objects
1 parent c10ba58 commit 1d1f9cf

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

redisinsight/ui/src/utils/tests/formatters/valueFormatters.spec.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,21 @@ describe('bufferToSerializedFormat', () => {
2424

2525
describe(KeyValueFormat.Vector32Bit, () => {
2626
describe('should properly serialize', () => {
27-
const testValues = [new Float32Array([1.0, 2.0]), new Float32Array([12.12, 13.41])].map((v) => {
28-
input: anyToBuffer(v.buffer)
29-
expected: JSON.stringify(v)
30-
})
27+
const testValues = [new Float32Array([1.0, 2.0]), new Float32Array([12.12, 13.41])].map((v) => ({
28+
input: anyToBuffer(v.buffer),
29+
expected: JSON.stringify(v),
30+
}))
3131

3232
test.each(testValues)('test %j', ({input, expected }) => {
3333
expect(JSON.stringify(bufferToSerializedFormat(KeyValueFormat.Vector32Bit, input))).toEqual(expected)
3434
})
3535
})
3636

3737
describe('should properly return value with invalid values', () => {
38-
const testValues = [new Float32Array(['test'])].map((v) => {
39-
input: anyToBuffer(v.buffer)
40-
expected: JSON.stringify(v)
41-
})
38+
const testValues = [new Float32Array(['test'])].map((v) => ({
39+
input: anyToBuffer(v.buffer),
40+
expected: JSON.stringify(v),
41+
}))
4242

4343
test.each(testValues)('test %j', ({input, expected }) => {
4444
expect(JSON.stringify(bufferToSerializedFormat(KeyValueFormat.Vector32Bit, input))).toEqual(expected)
@@ -48,21 +48,21 @@ describe('bufferToSerializedFormat', () => {
4848

4949
describe(KeyValueFormat.Vector64Bit, () => {
5050
describe('should properly serialize', () => {
51-
const testValues = [new Float64Array([1.0, 2.0]), new Float64Array([12.12, 13.41])].map((v) => {
52-
input: anyToBuffer(v.buffer)
53-
expected: JSON.stringify(v)
54-
})
51+
const testValues = [new Float64Array([1.0, 2.0]), new Float64Array([12.12, 13.41])].map((v) => ({
52+
input: anyToBuffer(v.buffer),
53+
expected: JSON.stringify(v),
54+
}))
5555

5656
test.each(testValues)('test %j', ({input, expected }) => {
5757
expect(JSON.stringify(bufferToSerializedFormat(KeyValueFormat.Vector64Bit, input))).toEqual(expected)
5858
})
5959
})
6060

6161
describe('should properly return value with invalid values', () => {
62-
const testValues = [new Float64Array(['test'])].map((v) => {
63-
input: anyToBuffer(v.buffer)
64-
expected: JSON.stringify(v)
65-
})
62+
const testValues = [new Float64Array(['test'])].map((v) => ({
63+
input: anyToBuffer(v.buffer),
64+
expected: JSON.stringify(v),
65+
}))
6666

6767
test.each(testValues)('test %j', ({input, expected }) => {
6868
expect(JSON.stringify(bufferToSerializedFormat(KeyValueFormat.Vector64Bit, input))).toEqual(expected)

0 commit comments

Comments
 (0)