<commit_before>import { expect } from 'chai';
const db = require('../../db');

const UsersHouses = require('../usersHousesModel');
const House = require('../houseModel');
const Device = require('../deviceModel');
const DeviceCategory = require('../deviceCategoryModel');
const DeviceTransaction = require('../deviceTransactionModel');
const PayMethods = require('../payMethodsModel');
const UserPayAccount = require('../userPayAccountModel');
const User = require('../userModel');

describe('The database', () => {
  const users = [
    { name: '<NAME>', defaultViewHost: 'true' },
    { name: '<NAME>', defaultViewHost: 'true' },
  ];

  // will drop and recreate all tables before running tests
  before((done) => {
    db.sync({ force: true })
      .then(() => { done(); })
      .catch((err) => { console.log(err); });
  });

  // will drop and recreate all tables after running tests
  // after((done) => {
  //   db.sync({ force: true })
  //     .then(() => { done(); })
  //     .catch((err) => { console.log(err); });
  // });

  it('should receive a new user from the model', (done) => {
    User.create(users[0])
      .then((res) => {
        expect(res.dataValues.name).to.equal(users[0].name);
        done();
      });
  });

  it('should find a user that was added to the database', (done) => {
    User.create(users[1])
      .then(() => {
        User.findOne({ where: { name: '<NAME>' } })
          .then((res) => {
            expect(res.dataValues.name).to.equal(users[1].name);
            done();
          });
      });
  });

  // it('should add a foreign key to the users_houses table', (done) => {
  //   User.add(users[1])
  //     .then(() => {
  //       User.findOne({ where: { name: '<NAME>' } })
  //         .then((res) => {
  //           expect(res.dataValues.name).to.equal(users[1].name);
  //           done();
  //         });
  //     });
  // });
});
<commit_msg>(Note) Add notes for tests that need to be added<commit_after>import { expect } from 'chai';
const db = require('../../db');

// const UsersHouses = require('../usersHousesModel');
// const House = require('../houseModel');
// const Device = require('../deviceModel');
// const DeviceCategory = require('../deviceCategoryModel');
// const DeviceTransaction = require('../deviceTransactionModel');
// const PayMethods = require('../payMethodsModel');
// const UserPayAccount = require('../userPayAccountModel');
const User = require('../userModel');

describe('The database', () => {
  const users = [
    { name: '<NAME>', defaultViewHost: 'true' },
    { name: '<NAME>', defaultViewHost: 'true' },
  ];

  // will drop and recreate all tables before running tests
  before((done) => {
    db.sync({ force: true })
      .then(() => { done(); })
      .catch((err) => { console.log(err); });
  });

  // will drop and recreate all tables after running tests
  // after((done) => {
  //   db.sync({ force: true })
  //     .then(() => { done(); })
  //     .catch((err) => { console.log(err); });
  // });

  it('should receive a new user from the model', (done) => {
    User.create(users[0])
      .then((res) => {
        expect(res.dataValues.name).to.equal(users[0].name);
        done();
      });
  });

  it('should find a user that was added to the database', (done) => {
    User.create(users[1])
      .then(() => {
        User.findOne({ where: { name: '<NAME>' } })
          .then((res) => {
            expect(res.dataValues.name).to.equal(users[1].name);
            done();
          });
      });
  });

  // needs test for all models, for adding foreign keys, and for controllers
});


{'fraction_non_alphanumeric': 0.2146814404432133, 'fraction_numerical': 0.002770083102493075, 'mean_word_length': 2.5298142717497556, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 37, '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': '504268', 'n_tokens_mistral': 1102, 'n_tokens_neox': 1086, 'n_words': 260}