<commit_before>expect = require("chai").expect

describe('SampleTestCase', function(){
    describe('truthyMethod()', function(){
        it('should be true when obvious true comparison is used', function(){
            expect(null == undefined).to.be.true;
        })
    })
});<commit_msg>test for poll votes counting<commit_after>var engine = require('../chat/engine');
require("chai").should()


describe('Engine', function(){

    describe('countVotes()', function(){
        it('should return 1 vote for single option', function(){
            var userVotes = {"user": {answer: "A"}};
            var result = engine.countVotes(userVotes);
            result.should.have.property("A").equals(1);
        });

        it('should return 2 votes for single option', function(){
            var userVotes = {"user": {answer: "A"}, "otherUser": {answer: "A"}};
            var result = engine.countVotes(userVotes);
            result.should.have.property("A").equals(2);
        });

        it('should return 1 vote for each option', function(){
            var userVotes = {"user": {answer: "A"}, "otherUser": {answer: "B"}};
            var result = engine.countVotes(userVotes);
            result.should.have.property("A").equals(1);
            result.should.have.property("B").equals(1);
        });

    });

});
{'fraction_non_alphanumeric': 0.17549167927382753, 'fraction_numerical': 0.00529500756429652, 'mean_word_length': 2.758522727272727, 'pattern_counts': {'":': 5, '<': 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': '3337758', 'n_tokens_mistral': 375, 'n_tokens_neox': 364, 'n_words': 88}