<commit_before>import chai from 'chai';
import request from 'supertest';
import dotenv from 'dotenv';
import app from '../app';
import models from '../server/models';

dotenv.config();
process.env.NODE_ENV = 'test';

const expect = chai.expect;

const user1 = {
  username: 'dj',
  password: '<PASSWORD>',
  email: '<EMAIL>'
};

const unregisteredUser = {
  usename: 'falseUser',
  password: '<PASSWORD>',
  email: '<EMAIL>'
};

describe('signup route', () => {
  beforeEach((done) => {
    models.sequelize.sync().then(() => {
      models.User.destroy({
        where: { },
        truncate: true,
        cascade: true
      })
        .then(() => done());
    });
  });

  it('should create a new user', (done) => {
    request(app).post('/api/user/signup')
      .send(user1)
      .expect((res) => {
        expect(res.body).to.be.an.instanceof(Object);
        expect(201);
        expect(res.body.username).to.equal(user1.username);
        expect(res.body.email).to.equal(user1.email);
      })
      .end((err, res) => {<commit_msg>Create sample group<commit_after>import chai from 'chai';
import request from 'supertest';
import dotenv from 'dotenv';
import app from '../app';
import models from '../server/models';

dotenv.config();
process.env.NODE_ENV = 'test';

const expect = chai.expect;

const user1 = {
  username: 'dj',
  password: '<PASSWORD>',
  email: '<EMAIL>'
};

const unregisteredUser = {
  usename: 'falseUser',
  password: '<PASSWORD>',
  email: '<EMAIL>'
};

const group1 = {
  name: "MMA Fans",
  description: "Meeting spot for Mixed Martial Arts diehards!!"
};

describe('signup route', () => {
  beforeEach((done) => {
    models.sequelize.sync().then(() => {
      models.User.destroy({
        where: { },
        truncate: true,
        cascade: true
      })
        .then(() => done());
    });
  });

  it('should create a new user', (done) => {
    request(app).post('/api/user/signup')
      .send(user1)
      .expect((res) => {
        expect(res.body).to.be.an.instanceof(Object);
        expect(201);
        expect(res.body.username).to.equal(user1.username);
        expect(res.body.email).to.equal(user1.email);
      })
      .end((err, res) => {
{'fraction_non_alphanumeric': 0.1908883826879271, 'fraction_numerical': 0.00683371298405467, 'mean_word_length': 2.8798586572438163, 'pattern_counts': {'":': 0, '<': 11, '<?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': '2054996', 'n_tokens_mistral': 749, 'n_tokens_neox': 736, 'n_words': 153}