Browse Source

Extend tests

pull/3846/head
Thomas Kaul 11 months ago
parent
commit
ce2adc03f1
  1. 9
      apps/api/src/helper/object.helper.spec.ts
  2. 2
      package.json

9
apps/api/src/helper/object.helper.spec.ts

@ -22,6 +22,13 @@ describe('redactAttributes', () => {
}) })
).toStrictEqual({ value: 'xyz' }); ).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( expect(
redactAttributes({ redactAttributes({
object: { value1: 'a', value2: 'b' }, object: { value1: 'a', value2: 'b' },
@ -32,6 +39,7 @@ describe('redactAttributes', () => {
}) })
).toStrictEqual({ value1: 'x', value2: 'y' }); ).toStrictEqual({ value1: 'x', value2: 'y' });
console.time('redactAttributes execution time');
expect( expect(
redactAttributes({ redactAttributes({
object: { object: {
@ -3041,5 +3049,6 @@ describe('redactAttributes', () => {
currentNetWorth: null currentNetWorth: null
} }
}); });
console.timeEnd('redactAttributes execution time');
}); });
}); });

2
package.json

@ -47,7 +47,7 @@
"test": "npm run test:api && npm run test:common", "test": "npm run test:api && npm run test:common",
"test:api": "npx dotenv-cli -e .env.example -- nx test api", "test:api": "npx dotenv-cli -e .env.example -- nx test api",
"test:common": "npx dotenv-cli -e .env.example -- nx test common", "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", "ts-node": "ts-node",
"update": "nx migrate latest", "update": "nx migrate latest",
"watch:server": "nx run api:copy-assets && nx run api:build --watch", "watch:server": "nx run api:copy-assets && nx run api:build --watch",

Loading…
Cancel
Save