<commit_before>/*jshint node:true, mocha:true */
/*global converter */

(function($hould) {
  'use strict';

  var converter = require('linear-converter');

  describe('browser support', function() {
    it('should cover the basics', function() {
      // main converter method
      var convert = converter.convert;

      // built-in presets for temperature, length, mass and more
      var temp = converter.PRESETS.temperature;

      convert(25, temp.celsiusToFahrenheit).should.be.exactly(77);

      // easy inversion of presets
      var invert = converter.invertPreset;

      convert(77, invert(temp.celsiusToFahrenheit)).should.be.exactly(25);

      // convert presets any to any using inversion and composition
      var compose = converter.composePresets;

      var kelvinToFahrenheit = compose([
        invert(temp.celsiusToKelvin),
        temp.celsiusToFahrenheit
      ]);

      convert(293.15, kelvinToFahrenheit).should.be.exactly(68);

      // calculate the coefficients for the underlying
      // linear function from a preset
      // using Should() to make IE9 happy: https://github.com/tj/should.js/wiki/Known-Bugs#ie9
      $hould(converter.getCoefficientA([[0, 1], [1, 3]])).be.exactly(2);
      converter.getCoefficientB([[0, 1], [1, 3]]).should.be.exactly(1);
    });
  });
}(Should));
<commit_msg>refactor(test): split browser tests<commit_after>/*jshint mocha:true */
/*global require, Should */

(function($hould) {
  'use strict';

  var converter = require('linear-converter');

  describe('browser support', function() {
    // main converter method
    var convert = converter.convert;

    // built-in presets for temperature, length, mass and more
    var temp = converter.PRESETS.temperature;

    // easy inversion of presets
    var invert = converter.invertPreset;

    // convert presets any to any using inversion and composition
    var compose = converter.composePresets;

    it('should support convertion', function() {
      convert(25, temp.celsiusToFahrenheit).should.be.exactly(77);
    });

    it('should support preset invertion', function() {
      convert(77, invert(temp.celsiusToFahrenheit)).should.be.exactly(25);
    });

    it('should support preset composition', function() {
      var kelvinToFahrenheit = compose([
        invert(temp.celsiusToKelvin),
        temp.celsiusToFahrenheit
      ]);

      convert(293.15, kelvinToFahrenheit).should.be.exactly(68);
    });

    it('should support calculating coefficients', function() {
      // calculate the coefficients for the underlying
      // linear function from a preset
      // using Should() to make IE9 happy: https://github.com/tj/should.js/wiki/Known-Bugs#ie9
      $hould(converter.getCoefficientA([[0, 1], [1, 3]])).be.exactly(2);
      converter.getCoefficientB([[0, 1], [1, 3]]).should.be.exactly(1);
    });
  });
}(Should));

{'fraction_non_alphanumeric': 0.1361731843575419, 'fraction_numerical': 0.018854748603351956, 'mean_word_length': 3.263392857142857, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6683789', 'n_tokens_mistral': 950, 'n_tokens_neox': 865, 'n_words': 203}