<commit_before>'use strict';

var chai = require('chai');
var chaiHttp = require('chai-http');
chai.use(chaiHttp);
var expect = chai.expect;
process.env.MONGO_URL = 'mongodb://localhost/user_test';
require(__dirname + '/../server');
var mongoose = require('mongoose');
var User = require(__dirname + '/../models/user');
var host = 'localhost:3000/fl';

describe('user login/signup test', function() {
  after(function(done) {
    mongoose.connection.db.dropDatabase(function() {
      done();
    });
  });

  it('should create a new user', function(done) {
    chai.request(host)
      .post('/signup')
      .send({username: 'test', password: '<PASSWORD>', email: 'testemail'})
      .end(function(err, res) {
        expect(err).to.eql(null);
        expect(res.body.user.username).to.eql('test');
        done();
      });
  });

  it('should log into an existing user', function(done) {
    chai.request(host)
      .get('/signin')
      .auth('test', 'user')
      .end(function(err, res) {
        expect(err).to.eql(null);
        expect(res.body.user.token).to.be.a('string');
        done();
      });
  });
});

<commit_msg>trying to fix travis ci errs<commit_after>'use strict';

var chai = require('chai');
var chaiHttp = require('chai-http');
chai.use(chaiHttp);
var expect = chai.expect;
process.env.MONGO_URL = 'mongodb://localhost/user_test';
require(__dirname + '/../server');
var mongoose = require('mongoose');
var User = require(__dirname + '/../models/user');
var host = 'localhost:3000/fl';

describe('user login/signup test', function(done) {
  after(function(done) {
    mongoose.connection.db.dropDatabase(function() {
      done();
    });
  });

  it('should create a new user', function(done) {
    chai.request(host)
      .post('/signup')
      .send({username: 'test', password: '<PASSWORD>', email: 'testemail'})
      .end(function(err, res) {
        expect(err).to.eql(null);
        expect(res.body.user.username).to.eql('test');
        done();
      });
  });

  it('should log into an existing user', function(done) {
    chai.request(host)
      .get('/signin')
      .auth('test', 'user')
      .end(function(err, res) {
        expect(err).to.eql(null);
        expect(res.body.user.token).to.be.a('string');
        done();
      });
  });
});


{'fraction_non_alphanumeric': 0.19921363040629095, 'fraction_numerical': 0.0034949759720401923, 'mean_word_length': 3.148550724637681, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5737418', 'n_tokens_mistral': 781, 'n_tokens_neox': 771, 'n_words': 141}