Browse Source

Set up test

pull/2843/head
Thomas Kaul 2 years ago
parent
commit
59b31b6699
  1. 13
      libs/common/src/lib/helper.spec.ts
  2. 4
      package.json

13
libs/common/src/lib/helper.spec.ts

@ -0,0 +1,13 @@
import { extractNumberFromString } from '@ghostfolio/common/helper';
describe('Helper', () => {
describe('Extract number from string', () => {
it('Get decimal number', async () => {
expect(extractNumberFromString('999.99')).toEqual(999.99);
});
it('Get decimal number with group', async () => {
expect(extractNumberFromString('99.999,99')).toEqual(99999.99);
});
});
});

4
package.json

@ -44,7 +44,9 @@
"start:production": "yarn database:migrate && yarn database:seed && node main",
"start:server": "nx run api:serve --watch",
"start:storybook": "nx run ui:storybook",
"test": "npx dotenv-cli -e .env.example -- nx test",
"test": "yarn test:api && yarn 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",
"ts-node": "ts-node",
"update": "nx migrate latest",

Loading…
Cancel
Save