<commit_before>var assert = require("chai").assert;
var expect = require("chai").expect;
var signIn = require("app/users/operations/sign-in");
var signUp = require("app/users/operations/sign-up");

describe("users/operations/sign-in", function() {
  var newUser = {
    email: "test/users/operations/sign-in@example.com",
    password: "password"
  };
  before(function(done) {
    signUp(newUser, done);
  });
  it("should return the user if password is correct", function(done) {
    signIn(newUser, function(error, user) {
      assert.isNull(error, error);
      assert.notProperty(user, "bcryptedPassword");
      assert.property(user, "id");
      assert.propertyVal(user, "email", newUser.email);
      done();
    });
  });
  it("should fail with incorrect password", function(done) {
    signIn({
      email: newUser.email,
      password: "<PASSWORD>"
    }, function(error, user) {
      assert.isObject(error);
      assert.propertyVal(error, "code", 403);
      done();
    });
  });
});<commit_msg>switched from chai.assert to chai.expect<commit_after>var expect = require("chai").expect;
var signIn = require("app/users/operations/sign-in");
var signUp = require("app/users/operations/sign-up");

describe("users/operations/sign-in", function() {
  var newUser = {
    email: "test/users/operations/sign-in@example.com",
    password: "password"
  };
  before(function(done) {
    signUp(newUser, done);
  });
  it("should return the user if password is correct", function(done) {
    signIn(newUser, function(error, user) {
      expect(error).not.to.exist;
      expect(user).not.to.have.property("bcryptedPassword");
      expect(user).to.have.property("id");
      expect(user).to.have.property("email", newUser.email);
      done();
    });
  });
  it("should fail with incorrect password", function(done) {
    signIn({
      email: newUser.email,
      password: "<PASSWORD>"
    }, function(error, user) {
      expect(error).to.exist;
      expect(error).to.have.property("code", 403);
      done();
    });
  });
});
{'fraction_non_alphanumeric': 0.1733594515181195, 'fraction_numerical': 0.002938295788442703, 'mean_word_length': 3.6117381489841986, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '6703158', 'n_tokens_mistral': 650, 'n_tokens_neox': 641, 'n_words': 122}