computes the stats about the period lengths, started tests

This commit is contained in:
tina committed 2018-07-31 15:06:16 +02:00
1 parent ac8d383729
commit cceecc071d
2 files changed
+51

No files matched your search

+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', () => {
}) */
})