<commit_before>/**
 * finance-factor's unit test module
 * @module finance-factors/test
 * @license MIT
 * @author diegofigs
 */

/* global describe, context, it */
import chai from 'chai'
import * as lib from '../lib/finance-factors.min'
const expect = chai.expect

describe('finance-factors', () => {
  describe('#singleFW()', () => {
    context('with 5% interest', () => {
      it('should return 1.05 over 1 period', () => {
        expect(lib.singleFW(5, 1)).to.be.equal(1.05)
      })
      it('should return 1.1025 over 2 periods', () => {
        expect(lib.singleFW(5, 2)).to.be.equal(1.1025)
      })
      it('should return 1.21550625 over 4 periods', () => {
        expect(lib.singleFW(5, 4)).to.be.equal(1.21550625)
      })
      it('should return 1.340095640625 over 6 periods', () => {
        expect(lib.singleFW(5, 6)).to.be.equal(1.340095640625)
      })
      it('should return 1.7958563260221292 over 12 periods', () => {
        expect(lib.singleFW(5, 12)).to.be.equal(1.7958563260221292)
      })
    })
    context('inverse relationship with PW factor', () => {
      it('should return inverse of PW(5,1)', () => {
        expect(lib.singleFW(5, 1)).to.be.equal(1 / 0.9523809523809523)
      })
      it('should return inverse of PW(5,12)', () => {
        expect(lib.singleFW(5, 12)).to.be.equal(1 / 0.5568374181775595)
      })
    })<commit_msg>use raw version of lib as babel-plugin allows transpiling<commit_after>/* global describe, context, it */
import chai from 'chai'
import * as lib from '../src/index'
const expect = chai.expect

describe('finance-factors', () => {
  describe('#singleFW()', () => {
    context('with 5% interest', () => {
      it('should return 1.05 over 1 period', () => {
        expect(lib.singleFW(5, 1)).to.be.equal(1.05)
      })
      it('should return 1.1025 over 2 periods', () => {
        expect(lib.singleFW(5, 2)).to.be.equal(1.1025)
      })
      it('should return 1.21550625 over 4 periods', () => {
        expect(lib.singleFW(5, 4)).to.be.equal(1.21550625)
      })
      it('should return 1.340095640625 over 6 periods', () => {
        expect(lib.singleFW(5, 6)).to.be.equal(1.340095640625)
      })
      it('should return 1.7958563260221292 over 12 periods', () => {
        expect(lib.singleFW(5, 12)).to.be.equal(1.7958563260221292)
      })
    })
    context('inverse relationship with PW factor', () => {
      it('should return inverse of PW(5,1)', () => {
        expect(lib.singleFW(5, 1)).to.be.equal(1 / 0.9523809523809523)
      })
      it('should return inverse of PW(5,12)', () => {
        expect(lib.singleFW(5, 12)).to.be.equal(1 / 0.5568374181775595)
      })
    })
{'fraction_non_alphanumeric': 0.1866316184754037, 'fraction_numerical': 0.11866316184754037, 'mean_word_length': 2.725874125874126, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 25, 'https://': 0, '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': '6060602', 'n_tokens_mistral': 1122, 'n_tokens_neox': 932, 'n_words': 184}