<commit_before>/// <reference path = "../../../typings/tsd.d.ts" />
var blogManager = require("../blogManager");
var chai = require('chai');
var chaiAsPromised = require('chai-as-promised');
var should = chai.should();
var mockBlogClass = new blogManager();
chai.use(chaiAsPromised);
var mockIndex = 0;
var mockNumberOfPosts = 10;
describe("Blog Manager", function () {
    describe("constructor", function () {
        it("Should do nothing", function () {
        });
    });
    describe("getAllPosts()", function () {
        it("Should return an array Promise", function () {
            //return mockBlogClass.getAllPosts().should.eventually.equal([]);
            return mockBlogClass.getAllPosts().should.eventually.be.a('array');
        });
    });
    describe("When getSomePosts() is supplied with index and number of posts to show", function () {
        it("Should return an array", function () {
            return mockBlogClass.getSomePosts(mockIndex, mockNumberOfPosts).should.eventually.be.a('array');
        });
    });
    describe("When addContent() is supplied with a JSON string", function () {
        it("Should write to the database", function () {
            return false;
        });
    });
    describe("When removeContent() is supplied with the Blog post ID", function () {
        it("Should remove the blog post from the database", function () {
        });
    });
});<commit_msg>Added more unit tests for unwritten functionality to be added in later<commit_after>/// <reference path = "../../../typings/tsd.d.ts" />
var blogManager = require("../blogManager");
var chai = require('chai');
var chaiAsPromised = require('chai-as-promised');
var should = chai.should();
var mockBlogClass = new blogManager();
chai.use(chaiAsPromised);
var mockIndex = 0;
var mockNumberOfPosts = 10;
describe("Blog Manager", function () {
    describe("constructor", function () {
        it("Should do nothing", function () {
        });
    });
    describe("getAllPosts()", function () {
        it("Should return an array Promise", function () {
            //return mockBlogClass.getAllPosts().should.eventually.equal([]);
            return mockBlogClass.getAllPosts().should.eventually.be.a('array');
        });
    });
    describe("When getSomePosts() is supplied with index and number of posts to show", function () {
        it("Should return an array", function () {
            return mockBlogClass.getSomePosts(mockIndex, mockNumberOfPosts).should.eventually.be.a('array');
        });
    });
    describe("When addContent() is supplied with a JSON string", function () {
        it("Should write to the database", function () {
            //ToDo: write a pre-hook that connects to a dummy collection in the database
            //then perform a read after writing, output should be equal to data entered.
            //ToDo: write a post-hook to destroy the database
        });
    });
    describe("When removeContent() is supplied with the Blog post ID", function () {
        it("Should remove the blog post from the database", function () {
            //ToDo: write a pre-hook that connects to a dummy collection in the database
            //then perform a search for the blog post after entry, should fail
            //ToDo: write a post-hook to destroy the database
        });
    });
    describe("When blogCount() is called", function () {
        it("Should return a value of how many entries are in the blog database", function () {
            //ToDo: create a pre-hook that creates a dummy database with 10 posts
            //ToDo: destroy database in posthook
        });
    });
});
{'fraction_non_alphanumeric': 0.13558855885588558, 'fraction_numerical': 0.0022002200220022, 'mean_word_length': 2.8083769633507853, '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': '973503', 'n_tokens_mistral': 971, 'n_tokens_neox': 934, 'n_words': 322}