solar-scores
Version:
Compute scores for solar decathlon competition - Cali 2015
21 lines (16 loc) • 616 B
JavaScript
;
var scores = require('..');
var points = require('./../src/points');
var d1 = [
{T: -14, epoch: new Date('2015-12-06 12:00:00 GMT-0500').getTime() }
];
describe('Freezing tests', function() {
it('Simple case', function() {
var freezing = new scores.Freezing({
doubleScoringParams: [-34.5, -29, -15, -9.5]
});
var score = freezing.getScore(d1, 'T', new Date('2015-12-07 12:00:00 GMT-0500'));
score.points.should.approximately(1/9 * points.Freezing*(-14-(-9.5))/(-15-(-9.5)), 0.0001);
score.max.should.approximately(8, 0.0001);
});
});