From af31e8141bb7895d82c43779a4d6ec376e3c51b5 Mon Sep 17 00:00:00 2001 From: dmitry Date: Fri, 29 Nov 2024 14:58:25 +0100 Subject: [PATCH] chore: Small test cleanup. Related issue: https://github.com/midonet/tssrp6a/issues/90 --- test/parameters.test.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/test/parameters.test.ts b/test/parameters.test.ts index eebe8c3..9fc8700 100644 --- a/test/parameters.test.ts +++ b/test/parameters.test.ts @@ -31,12 +31,8 @@ test("Size of N is correct", (t) => { // Yes, the 256 bits number is actually 257 bits number // https://groups.google.com/forum/#!topic/clipperz/DJFqZYHv2qk const expectedSizeInBytes: number[] = [33, 64, 96, 128, 192, 256]; - const actualSizeInBytes: number[] = new Array(6).fill(0); - Object.keys(SRPParameters.PrimeGroup).map((key, idx) => { - actualSizeInBytes[idx] = bigIntToArrayBuffer( - SRPParameters.PrimeGroup[key].N, - ).byteLength; - }); - actualSizeInBytes.sort((x, y) => x - y); + const actualSizeInBytes: number[] = Object.keys(SRPParameters.PrimeGroup).map( + (key) => bigIntToArrayBuffer(SRPParameters.PrimeGroup[key].N).byteLength, + ); t.deepEqual(expectedSizeInBytes, actualSizeInBytes, "N sizes are correct"); });