Implemented jest test for Pokemon Card component

develop
Jason Zhu 2023-03-23 21:03:36 +11:00
parent 27df3a780a
commit 9e48382026
1 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,15 @@
import { formatNumber } from './Pokemon';
describe('Test Functions', () => {
describe('formatNumber', () => {
it('should format single digit integer correctly', () => {
expect(formatNumber(6)).toBe('#006');
});
it('should format double digit integer correctly', () => {
expect(formatNumber(16)).toBe('#016');
});
it('should format triple digit integer correctly', () => {
expect(formatNumber(116)).toBe('#116');
});
});
});