computes the stats about the period lengths, started tests

This commit is contained in:
tina
2018-07-31 15:06:16 +02:00
parent ac8d383729
commit cceecc071d
2 changed files with 51 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
import chai from 'chai'
import periodInfo from '../lib/period-length'
const expect = chai.expect
describe('it calculates the median correctly', () => {
it('works for an odd-numbered array', () => {
const periodLengths = [1, 2, 5, 99, 100]
const result = periodInfo(periodLengths).median
expect(result).to.eql(5)
})
/* it('works for an even-numbered array', () => {
}) */
})