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
+4 -10
View File
@@ -1,10 +1,6 @@
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 julyCycle = [{ date: '2018-07-05' }]
const juneCycle = [{ date: '2018-06-05' }]
const mayCycle = [
@@ -35,7 +31,6 @@ const cycleStartsSortedByDate = [
describe('getCyclesBefore', () => {
it('gets previous cycles', () => {
const { getCyclesBefore } = cycleModule({
cycleDaysSortedByDate,
cycleStartsSortedByDate,
@@ -43,19 +38,18 @@ describe('getCyclesBefore', () => {
const cyclesBeforeJuly = getCyclesBefore(...julyCycle)
expect(cyclesBeforeJuly.length).to.eql(3)
expect(cyclesBeforeJuly).to.eql([ juneCycle, mayCycle, aprilCycle ])
expect(cyclesBeforeJuly).to.eql([juneCycle, mayCycle, aprilCycle])
})
it('skips cycles that are longer than max', () => {
const { getCyclesBefore } = cycleModule({
cycleDaysSortedByDate,
cycleStartsSortedByDate,
maxCycleLength: 30
maxCycleLength: 30,
})
const cyclesBeforeJuly = getCyclesBefore(...julyCycle)
expect(cyclesBeforeJuly.length).to.eql(1)
expect(cyclesBeforeJuly).to.eql([ juneCycle ])
expect(cyclesBeforeJuly).to.eql([juneCycle])
})
})