Chore/retire dirty chai

This commit is contained in:
Sofiya Tepikin
2022-08-01 12:34:26 +00:00
parent 6a6de1d5ea
commit f78d2c480d
12 changed files with 282 additions and 409 deletions
+6 -15
View File
@@ -1,14 +1,7 @@
import chai from 'chai'
import dirtyChai from 'dirty-chai'
import { expect } from 'chai'
import cycleModule from '../lib/cycle'
const { expect } = chai
chai.use(dirtyChai)
const simpleCycleStarts = [
{ date: '2018-05-09' },
{ date: '2018-05-03'},
]
const simpleCycleStarts = [{ date: '2018-05-09' }, { date: '2018-05-03' }]
describe('getCycleDayNumber', () => {
it('works for a date in the current cycle', () => {
@@ -22,7 +15,7 @@ describe('getCycleDayNumber', () => {
it('works for a date which is not in the current cycle', () => {
const cycleStartsSortedByDate = [
{ date: '2018-05-13' },
{ date: '2018-04-10'}
{ date: '2018-04-10' },
]
const date = '2018-04-27'
const { getCycleDayNumber } = cycleModule({ cycleStartsSortedByDate })
@@ -31,9 +24,7 @@ describe('getCycleDayNumber', () => {
})
it('works for a date which is the first and only day in cycle', () => {
const cycleStartsSortedByDate = [
{ date: '2018-05-13' }
]
const cycleStartsSortedByDate = [{ date: '2018-05-13' }]
const date = '2018-05-13'
const { getCycleDayNumber } = cycleModule({ cycleStartsSortedByDate })
@@ -45,7 +36,7 @@ describe('getCycleDayNumber', () => {
const date = '2018-05-17'
const { getCycleDayNumber } = cycleModule({ cycleStartsSortedByDate })
expect(getCycleDayNumber(date)).to.be.null()
expect(getCycleDayNumber(date)).to.be.null
})
it('returns null if the cycle is longer than the max', function () {
@@ -54,6 +45,6 @@ describe('getCycleDayNumber', () => {
const date = '2018-08-16'
const { getCycleDayNumber } = cycleModule({ cycleStartsSortedByDate })
expect(getCycleDayNumber(date)).to.be.null()
expect(getCycleDayNumber(date)).to.be.null
})
})