<commit_before>var Mocha = require('mocha'),
    _ = require('underscore');

module.exports = function (browser, module, suite /*, config*/) {

  var tests = {
    'has a title': function () {
      return browser
        .$('#' + module.slug + ' h2').text()
          .should.become(module.title);
    },

    'has a realtime value': function () {
      return browser
        .$('#' + module.slug + ' .stat strong').text()
          .should.eventually.match(/^([0-9\.]+[b,m,k]?)|(no data)$/);
    },

    'has a graph': function () {
      return browser
        .$('#' + module.slug + ' .sparkline')
          .should.eventually.exist;
    }
  };

  _.each(tests, function (test, key) {
    suite.addTest(new Mocha.Test(key, test));
  });<commit_msg>Default axes properties for cases where they're defined in the controller and not in config<commit_after>var Mocha = require('mocha'),
    _ = require('underscore');

module.exports = function (browser, module, suite /*, config*/) {

  module.axes = module.axes || {};
  module.axes.x = module.axes.x || {
    label: 'Time',
    key: '_timestamp',
    format: 'time'
  };
  module.axes.y = module.axes.y || [
    {
      label: 'Number of unique visitors',
      key: 'unique_visitors',
      format: 'integer'
    }
  ];

  var tests = {
    'has a title': function () {
      return browser
        .$('#' + module.slug + ' h2').text()
          .should.become(module.title);
    },

    'has a realtime value': function () {
      return browser
        .$('#' + module.slug + ' .stat strong').text()
          .should.eventually.match(/^([0-9\.]+[b,m,k]?)|(no data)$/);
    },

    'has a graph': function () {
      return browser
        .$('#' + module.slug + ' .sparkline')
          .should.eventually.exist;
    }
  };

  _.each(tests, function (test, key) {
    suite.addTest(new Mocha.Test(key, test));
  });
{'fraction_non_alphanumeric': 0.19060331019754403, 'fraction_numerical': 0.003203416978109984, 'mean_word_length': 2.3345195729537367, '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': '3601578', 'n_tokens_mistral': 632, 'n_tokens_neox': 610, 'n_words': 133}