Skip to content

Commit

Permalink
test: UNIT test for getYearsExperience()
Browse files Browse the repository at this point in the history
  • Loading branch information
krsiakdaniel committed Mar 8, 2024
1 parent d7dc7b8 commit 6d98d58
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions __tests__/jest/getYearsExperience.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { getYearsExperience } from '@/utils/getYearsExperience'

describe('getYearsExperience', () => {
it('should return the correct number of years', () => {
const startYear = 2010
const currentYear = new Date().getFullYear()
const expectedYears = currentYear - startYear

const result = getYearsExperience(startYear)

expect(result).toEqual(expectedYears)
})
})

0 comments on commit 6d98d58

Please sign in to comment.