<commit_before>var expect          = require("chai").expect;
var sinon           = require("sinon");

var UserRepository  = require("../repositories/userrepository");
var User            = require("../models/usermodel");

describe("UserRepository", function() {
    describe("getUser(id)", function() {
        var retrieveStub;
        var repository;

        // data service object
        var ds = {
            retrieveEntity: function(id, callback) {}
        };

        beforeEach(function() {
            retrieveStub    = sinon.stub(ds, "retrieveEntity");
            repository      = new UserRepository(ds);
        });

        afterEach(function() {
            retrieveStub.restore();
        });

        it("should return User object with providerUID, email, and displayName properties", function(done) {
            repository.getUser("123", function(user, err) {
                // validate user
                expect(user).to.be.an.instanceof(User);
                expect(user.email).not.to.be.empty;
                expect(user.providerUID).not.to.be.empty;
                expect(user.displayName).not.to.be.empty;

                expect(err).to.be.null;
                done();
            });
        });

        it("should return null user with error message on invalid ID", function(done) {
            repository.getUser(123, function(user, err) {
                expect(user).to.be.null;
                expect(err).to.exist;
                done();
            });
        });

        it("should only retrieve an entity once", function(done){
            repository.getUser("123", function(user, err) {
                expect(retrieveStub.calledOnce).to.be.true;
                done();
            });
        });
    });
});
<commit_msg>Setup user repo tests to skip until they are redone<commit_after>var expect          = require("chai").expect;
var sinon           = require("sinon");

var UserRepository  = require("../repositories/userrepository");
var User            = require("../models/usermodel");

describe.skip("UserRepository", function() {
    describe("getUser(id)", function() {
        var retrieveStub;
        var repository;

        // data service object
        var ds = {
            retrieveEntity: function(id, callback) {}
        };

        beforeEach(function() {
            retrieveStub    = sinon.stub(ds, "retrieveEntity");
            repository      = new UserRepository(ds);
        });

        afterEach(function() {
            retrieveStub.restore();
        });

        it("should return User object with providerUID, email, and displayName properties", function(done) {
            repository.getUser("123", function(user, err) {
                // validate user
                expect(user).to.be.an.instanceof(User);
                expect(user.email).not.to.be.empty;
                expect(user.providerUID).not.to.be.empty;
                expect(user.displayName).not.to.be.empty;

                expect(err).to.be.null;
                done();
            });
        });

        it("should return null user with error message on invalid ID", function(done) {
            repository.getUser(123, function(user, err) {
                expect(user).to.be.null;
                expect(err).to.exist;
                done();
            });
        });

        it("should only retrieve an entity once", function(done){
            repository.getUser("123", function(user, err) {
                expect(retrieveStub.calledOnce).to.be.true;
                done();
            });
        });
    });
});

{'fraction_non_alphanumeric': 0.13179158539983282, 'fraction_numerical': 0.005015324602953469, 'mean_word_length': 1.7135298563869992, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1852140', 'n_tokens_mistral': 957, 'n_tokens_neox': 916, 'n_words': 185}