<commit_before>import path from 'path';
import os from 'os';
import { assert, test } from 'yeoman-generator';

describe('sails-rest-api:config', () => {
  describe('Should properly handle default configuration', () => {
    before(done => {
      test
        .run(path.join(__dirname, '../../src/config'))
        .inDir(path.join(os.tmpdir(), './temp-test'))
        .withOptions({
          'skip-install': true
        })
        .on('end', done);
    });

    it('Should properly create environment configuration files', () => {
      assert.file([
        'config/env/development.js',
        'config/env/production.js',
        'config/env/test.js'
      ]);
    });

    it('Should properly create configuration files', () => {
      assert.file([
        'config/blueprints.js',
        'config/bootstrap.js',
        'config/connections.js',
        'config/cors.js',
        'config/errors.js',
        'config/globals.js',
        'config/http.js',
        'config/log.js',
        'config/models.js',
        'config/policies.js',
        'config/routes.js'
      ]);

      assert.fileContent('config/models.js', /connection: "mongo"/);
      assert.fileContent('config/connections.js', /host: "localhost"/g);
      assert.fileContent('config/connections.js', /database: "sails-rest-api"/g);
      assert.fileContent('config/connections.js', /user: ""/g);
      assert.fileContent('config/connections.js', /password: ""/g);
      assert.fileContent('config/connections.js', /accessKeyId: ""/g);
      assert.fileContent('config/connections.js', /secretAccessKey: ""/g);
      assert.fileContent('config/connections.js', /region: "us-west-1"/g);
    });
  });

  describe('Should properly handle full configuration', () => {
    before(done => {
      test
        .run(path.join(__dirname, '../../src/config'))
        .inDir(path.join(os.tmpdir(), './temp-test'))
        .withOptions({
          'database-adapter': 'mysql',
          'database-host': '123.456.789.000',
          'database-name': 'db_name',
          'database-username': 'db_user',
          'database-password': '<PASSWORD>',
          'dynamo-access-key-id': 'access_key_id',
          'dynamo-secret-access-key': 'secret_access_key',
          'dynamo-region': 'amazon_region',
          'skip-install': true
        })
        .on('end', done);
    });

    it('Should properly create environment configuration files', () => {
      assert.file([
        'config/env/development.js',
        'config/env/production.js',
        'config/env/test.js'
      ]);
    });

    it('Should properly create configuration files', () => {
      assert.file([
        'config/blueprints.js',
        'config/bootstrap.js',
        'config/connections.js',
        'config/cors.js',
        'config/errors.js',
        'config/globals.js',
        'config/http.js',
        'config/log.js',
        'config/models.js',
        'config/policies.js',
        'config/routes.js'
      ]);

      assert.fileContent('config/models.js', /connection: "mysql"/);
      assert.fileContent('config/connections.js', /host: "123\.456\.789\.000"/g);
      assert.fileContent('config/connections.js', /database: "db_name"/g);
      assert.fileContent('config/connections.js', /user: "db_user"/g);
      assert.fileContent('config/connections.js', /password: "<PASSWORD>"/g);
      assert.fileContent('config/connections.js', /accessKeyId: "access_key_id"/g);
      assert.fileContent('config/connections.js', /secretAccessKey: "secret_access_key"/g);
      assert.fileContent('config/connections.js', /region: "amazon_region"/g);
    });
  });
});<commit_msg>Fix some tests<commit_after>import path from 'path';
import os from 'os';
import { assert, test } from 'yeoman-generator';

describe('sails-rest-api:config', () => {
  describe('Should properly handle default configuration', () => {
    before(done => {
      test
        .run(path.join(__dirname, '../../src/config'))
        .inDir(path.join(os.tmpdir(), './temp-test'))
        .withOptions({
          'skip-install': true
        })
        .on('end', done);
    });

    it('Should properly create environment configuration files', () => {
      assert.file([
        'config/env/development.js',
        'config/env/production.js',
        'config/env/test.js'
      ]);
    });

    it('Should properly create configuration files', () => {
      assert.file([
        'config/blueprints.js',
        'config/bootstrap.js',
        'config/connections.js',
        'config/cors.js',
        'config/errors.js',
        'config/globals.js',
        'config/http.js',
        'config/log.js',
        'config/models.js',
        'config/policies.js',
        'config/routes.js'
      ]);

      assert.fileContent('config/models.js', /connection: "mongo"/);
      assert.fileContent('config/connections.js', /host: "localhost"/g);
      assert.fileContent('config/connections.js', /database: "sails-rest-api"/g);
      assert.fileContent('config/connections.js', /user: ""/g);
      assert.fileContent('config/connections.js', /password: ""/g);
      assert.fileContent('config/connections.js', /accessKeyId: ""/g);
      assert.fileContent('config/connections.js', /secretAccessKey: ""/g);
      assert.fileContent('config/connections.js', /region: "us-west-1"/g);
    });
  });

  describe('Should properly handle full configuration', () => {
    before(done => {
      test
        .run(path.join(__dirname, '../../src/config'))
        .inDir(path.join(os.tmpdir(), './temp-test'))
        .withOptions({
          'database-adapter': 'mysql',
          'database-host': '123.456.789.000',
          'database-name': 'db_name',
          'database-username': 'db_user',
          'database-password': '<PASSWORD>',
          'dynamo-access-key-id': 'access_key_id',
          'dynamo-secret-access-key': 'secret_access_key',
          'dynamo-region': 'amazon_region',
          'skip-install': true
        })
        .on('end', done);
    });

    it('Should properly create environment configuration files', () => {
      assert.file([
        'config/env/development.js',
        'config/env/production.js',
        'config/env/test.js'
      ]);
    });

    it('Should properly create configuration files', () => {
      assert.file([
        'config/blueprints.js',
        'config/bootstrap.js',
        'config/connections.js',
        'config/cors.js',
        'config/errors.js',
        'config/globals.js',
        'config/http.js',
        'config/log.js',
        'config/models.js',
        'config/policies.js',
        'config/routes.js'
      ]);

      assert.fileContent('config/models.js', /connection: 'mysql'/);
      assert.fileContent('config/connections.js', /host: '123\.456\.789\.000'/g);
      assert.fileContent('config/connections.js', /database: 'db_name'/g);
      assert.fileContent('config/connections.js', /user: 'db_user'/g);
      assert.fileContent('config/connections.js', /password: '<PASSWORD>'/g);
      assert.fileContent('config/connections.js', /accessKeyId: 'access_key_id'/g);
      assert.fileContent('config/connections.js', /secretAccessKey: 'secret_access_key'/g);
      assert.fileContent('config/connections.js', /region: 'amazon_region'/g);
    });
  });
});
{'fraction_non_alphanumeric': 0.18711190837587968, 'fraction_numerical': 0.006899406651028011, 'mean_word_length': 2.4829408938010573, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 25, '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': '6404676', 'n_tokens_mistral': 2303, 'n_tokens_neox': 2212, 'n_words': 330}