<commit_before>'use strict';

var config = require('../');
var stylelint = require('stylelint');

function isObject(obj) {
  return typeof obj === 'object' && obj !== null;
}

it('test basic properties of config', function() {
  expect(isObject(config.plugins)).toBeTruthy();
  expect(isObject(config.rules)).toBeTruthy();
});

it('load config in stylelint to validate rule syntax', function() {
  return stylelint.lint({
    code: 'a { font-weight: bold; }\n',
    codeFilename: 'valid.css',
    config: config,
  }).then(function(data) {
    expect(data).toBeTruthy();
    expect(data.errored).toBeFalsy();
    expect(data.results[0].warnings.length).toBe(0);
  });
});<commit_msg>:hammer: Change the way we reference the config in tests<commit_after>'use strict';

var path = require('path');
var stylelint = require('stylelint');

it('load config in stylelint to validate rule syntax', function() {
  return stylelint.lint({
    code: 'a { font-weight: bold; }\n',
    codeFilename: 'valid.css',
    configFile: path.join(__dirname, '../index.js'),
  }).then(function(data) {
    expect(data).toBeTruthy();
    expect(data.errored).toBeFalsy();
    expect(data.results[0].warnings.length).toBe(0);
  });
});
{'fraction_non_alphanumeric': 0.1833195706028076, 'fraction_numerical': 0.0033030553261767133, 'mean_word_length': 4.559633027522936, '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': '6018204', 'n_tokens_mistral': 388, 'n_tokens_neox': 384, 'n_words': 90}