2021-06-02 15:14:54 +00:00
|
|
|
import { checkNewRelease } from '../../../src/utils/dates.js'
|
|
|
|
|
|
|
|
describe('date utils', () => {
|
|
|
|
describe('checkNewRelease', () => {
|
2021-06-02 15:28:45 +00:00
|
|
|
it("returns a positive result checking today's date", () => {
|
2021-06-02 15:14:54 +00:00
|
|
|
expect(checkNewRelease(new Date())).toBe(true)
|
|
|
|
})
|
2021-06-02 15:28:45 +00:00
|
|
|
|
|
|
|
it("returns a negative result checking a week ago's date", () => {
|
|
|
|
const dateToCheck = new Date()
|
|
|
|
dateToCheck.setDate(dateToCheck.getDate() - 7)
|
|
|
|
|
|
|
|
expect(checkNewRelease(dateToCheck)).toBe(false)
|
|
|
|
})
|
2021-06-02 15:14:54 +00:00
|
|
|
})
|
|
|
|
})
|