filer/perf/simple-statistics/test/mean.test.js

19 lines
452 B
JavaScript
Raw Normal View History

2014-12-16 23:53:29 +00:00
var test = require('tape');
var ss = require('../');
test('mean', function(t) {
test('can get the mean of two numbers', function(t) {
t.equal(ss.mean([1, 2]), 1.5);
t.end();
});
test('can get the mean of one number', function(t) {
t.equal(ss.mean([1]), 1);
t.end();
});
test('an empty list has no average', function(t) {
t.equal(ss.mean([]), null);
t.end();
});
t.end();
});