mirror of
https://github.com/Nezumi-2711/react-training.git
synced 2026-09-22 20:01:59 +00:00
Add unit test
This commit is contained in:
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user