From ce2adc03f1eaf0dd54ac3b6685f5543949c7d403 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Mon, 30 Sep 2024 18:42:54 +0200 Subject: [PATCH] Extend tests --- apps/api/src/helper/object.helper.spec.ts | 9 +++++++++ package.json | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/api/src/helper/object.helper.spec.ts b/apps/api/src/helper/object.helper.spec.ts index 2d0399c32..85fb8f4eb 100644 --- a/apps/api/src/helper/object.helper.spec.ts +++ b/apps/api/src/helper/object.helper.spec.ts @@ -22,6 +22,13 @@ describe('redactAttributes', () => { }) ).toStrictEqual({ value: 'xyz' }); + expect( + redactAttributes({ + object: { data: [{ value: 'a' }, { value: 'b' }] }, + options: [{ attribute: 'value', valueMap: { a: 1, b: 2 } }] + }) + ).toStrictEqual({ data: [{ value: 1 }, { value: 2 }] }); + expect( redactAttributes({ object: { value1: 'a', value2: 'b' }, @@ -32,6 +39,7 @@ describe('redactAttributes', () => { }) ).toStrictEqual({ value1: 'x', value2: 'y' }); + console.time('redactAttributes execution time'); expect( redactAttributes({ object: { @@ -3041,5 +3049,6 @@ describe('redactAttributes', () => { currentNetWorth: null } }); + console.timeEnd('redactAttributes execution time'); }); }); diff --git a/package.json b/package.json index 858c61992..de40eb8fe 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "test": "npm run test:api && npm run test:common", "test:api": "npx dotenv-cli -e .env.example -- nx test api", "test:common": "npx dotenv-cli -e .env.example -- nx test common", - "test:single": "nx run api:test --test-file portfolio-calculator-novn-buy-and-sell.spec.ts", + "test:single": "nx run api:test --test-file object.helper.spec.ts", "ts-node": "ts-node", "update": "nx migrate latest", "watch:server": "nx run api:copy-assets && nx run api:build --watch",