<commit_before>'use strict';

var chai = require('chai');
var expect = chai.expect;

var path = require('path');
var loadRCFiles = require('../../lib/loadRCFiles');

var fixturesDir = path.resolve(__dirname, '../fixtures');

describe('loadRCFiles', function() {
  it('should merge all detected files', function() {
    var result = loadRCFiles(path.resolve(fixturesDir, 'fbrc/conflict'));
    expect(result.project.default).to.eq('conflict');
    return expect(result.project.other).to.eq('top');
  });

  it('should not crash when encountering malformed files', function() {
    var result = loadRCFiles(path.resolve(fixturesDir, 'fbrc/invalid'));
    return expect(result.length).to.be.object;
  });
});<commit_msg>Fix test to better check result.<commit_after>'use strict';

var chai = require('chai');
var expect = chai.expect;

var path = require('path');
var loadRCFiles = require('../../lib/loadRCFiles');

var fixturesDir = path.resolve(__dirname, '../fixtures');

describe('loadRCFiles', function() {
  it('should merge all detected files', function() {
    var result = loadRCFiles(path.resolve(fixturesDir, 'fbrc/conflict'));
    expect(result.project.default).to.eq('conflict');
    return expect(result.project.other).to.eq('top');
  });

  it('should not crash when encountering malformed files', function() {
    var result = loadRCFiles(path.resolve(fixturesDir, 'fbrc/invalid'));
    return expect(result.project.other).to.eq('top');
  });
});
{'fraction_non_alphanumeric': 0.17602739726027397, 'fraction_numerical': 0.0, 'mean_word_length': 4.91497975708502, 'pattern_counts': {'":': 0, '<': 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': '7459933', 'n_tokens_mistral': 450, 'n_tokens_neox': 453, 'n_words': 99}