<commit_before>import assert from 'assert';
import {Server} from 'hapi';
import hapiMysqlRoutes from '../hapi-mysql-routes-plugin';

describe('hapi-mysql-routes-plugin', () => {
  describe('validation', () => {
    it('should error if all the required options are not set', () => {
      function harness() {
        let server = new Server();
        server.connection();
        server.register({
          register: hapiMysqlRoutes,
          options: {
            mysqlConfig: 'mysql',
            tableName: 'tableName'
          }
        }, err => err);
      }
      assert.throws(harness, Error);
    });

    it('should not error if all the required options are set', (done) => {
      function harness() {
        let server = new Server();
        server.connection();
        server.register({
          register: hapiMysqlRoutes,
          options: {
            mysqlConfig: 'mysql',
            primaryKey: 'primaryKey',
            tableName: 'tableName'
          }
        }, err => err);
        done();
      }
      assert.doesNotThrow(harness);
    });
  });
});<commit_msg>SEN-1612<commit_after>import assert from 'assert';
import {Server} from 'hapi';
import hapiMysqlRoutes from '../hapi-mysql-routes-plugin';

describe('hapi-mysql-routes-plugin', () => {
  describe('validation', () => {
    it('should error if all the required options are not set', () => {
      function harness() {
        let server = new Server();
        server.connection();
        server.register({
          register: hapiMysqlRoutes,
          options: {
            mysqlConfig: 'mysql',
            tableName: 'tableName'
          }
        }, err => err);
      }
      assert.throws(harness, Error);
    });

    it('should not error if all the required options are set', (done) => {
      function harness() {
        let server = new Server();
        server.connection();
        server.register({
          register: hapiMysqlRoutes,
          options: {
            mysqlConfig: 'mysql',
            primaryKey: 'primaryKey',
            tableName: 'tableName'
          }
        }, err => err);
      }
      assert.doesNotThrow(harness);
      done();
    });
  });
});
{'fraction_non_alphanumeric': 0.14024668798538145, 'fraction_numerical': 0.001827318410232983, 'mean_word_length': 1.9755434782608696, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '7469625', 'n_tokens_mistral': 613, 'n_tokens_neox': 606, 'n_words': 150}