<commit_before>var assert     = require('assert');
var Converter  = require('../src/converter.js');

var currencies = {
    "UAH": {
        "rate"  : 30,
        "symbol": "UAH"
    },
    "EUR": {
        "rate"  : 1,
        "symbol": "€"
    },
    "USD": {
        "rate"  : 1.5,
        "symbol": "$"
    }
};

GLOBAL.Converter.init(currencies);

describe("Converter", function () {

    describe("Get symbol", function () {
        it("Symbol of UAH is UAH", function () {
            assert.equal(GLOBAL.Converter.getSymbol("UAH"), "UAH");
        });
        it("Symbol of EUR is €", function () {
            assert.equal(GLOBAL.Converter.getSymbol("EUR"), "€");
        });
        it("Symbol of USD is $", function () {
            assert.equal(GLOBAL.Converter.getSymbol("USD"), "$");
        });
    });

    describe("Convert", function () {
        it("from UAH to EUR. 2 EUR = 60 UAH", function () {
            assert.equal(GLOBAL.Converter.value("EUR", "UAH", 2), 60);
        });

        it("from USD to EUR. 2 EUR = 3 USD", function () {
            assert.equal(GLOBAL.Converter.value("EUR", "USD", 2), 3);
        });

        it("from EUR to EUR. 2 EUR = 2 EUR", function () {
            assert.equal(GLOBAL.Converter.value("EUR", "EUR", 2), 2);
        });
    });
});<commit_msg>Update converter<commit_after>
var currencies = {
    "UAH": {
        "rate"  : 30,
        "symbol": "UAH"
    },
    "EUR": {
        "rate"  : 1,
        "symbol": "€"
    },
    "USD": {
        "rate"  : 1.5,
        "symbol": "$"
    }
};

Converter.init(currencies);

describe("Converter", function () {

    describe("Get symbol", function () {
        it("Symbol of UAH is UAH", function () {
            assert.equal(Converter.getSymbol("UAH"), "UAH");
        });
        it("Symbol of EUR is €", function () {
            assert.equal(Converter.getSymbol("EUR"), "€");
        });
        it("Symbol of USD is $", function () {
            assert.equal(Converter.getSymbol("USD"), "$");
        });
    });

    describe("Convert", function () {
        it("from UAH to EUR. 2 EUR = 60 UAH", function () {
            assert.equal(Converter.value("EUR", "UAH", 2), 60);
        });

        it("from USD to EUR. 2 EUR = 3 USD", function () {
            assert.equal(Converter.value("EUR", "USD", 2), 3);
        });

        it("from EUR to EUR. 2 EUR = 2 EUR", function () {
            assert.equal(Converter.value("EUR", "EUR", 2), 2);
        });
    });
});
{'fraction_non_alphanumeric': 0.19975835682641965, 'fraction_numerical': 0.015304067660088603, 'mean_word_length': 1.9189189189189189, 'pattern_counts': {'":': 12, '<': 3, '<?xml version=': 0, '>': 3, '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': '5491565', 'n_tokens_mistral': 856, 'n_tokens_neox': 785, 'n_words': 178}