scoreCalculatorTest.js 662 B

123456789101112131415161718
  1. var should = require('chai').should();
  2. var scoreCalculator = require('../../lib/scoreCalculator');
  3. describe('scoreCalculator', function() {
  4. it('should have a method calculate', function() {
  5. scoreCalculator.should.have.property('calculate').that.is.a('function');
  6. });
  7. it('should produce a nice rules object', function() {
  8. var data = require('../fixtures/scoreInput.json');
  9. var profile = require('../fixtures/scoreProfile.json');
  10. var expected = require('../fixtures/scoreOutput.json');
  11. var results = scoreCalculator.calculate(data, profile);
  12. results.should.deep.equals(expected);
  13. });
  14. });