Add unit test

This commit is contained in:
2023-12-01 17:45:13 +07:00
parent 4769f45e45
commit d53b869d65
12 changed files with 450 additions and 65 deletions
@@ -1,5 +1,5 @@
// Helpers
import { formatCurrency } from '@helper/helper';
import { formatCurrency, getDayDiff } from '@helper/helper';
describe('formatCurrency', () => {
test('Should format correctly', () => {
@@ -8,3 +8,11 @@ describe('formatCurrency', () => {
expect(result).toEqual('$5,000.00');
});
});
describe('getDayDiff', () => {
test('Should calculate correctly', () => {
const result = getDayDiff(new Date('2023/11/30'), new Date('2023/12/01'));
expect(result).toEqual(1);
});
});