{"size": 1949, "ext": "js", "max_stars_repo_path": "spec/firewall-spec/providers/Bass_Bcrypt_Spec.js", "max_stars_repo_name": "congajs/conga-security", "max_stars_repo_stars_event_min_datetime": "2021-12-02T06:43:59.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-07T07:12:25.000Z", "max_issues_repo_path": "spec/firewall-spec/providers/Bass_Bcrypt_Spec.js", "max_issues_repo_name": "congajs/conga-security", "max_issues_repo_issues_event_min_datetime": "2021-03-16T05:09:33.000Z", "max_issues_repo_issues_event_max_datetime": "2021-03-16T05:09:34.000Z", "max_forks_repo_path": "spec/firewall-spec/providers/Bass_Bcrypt_Spec.js", "max_forks_repo_name": "congajs/conga-security", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 27.0694444444, "max_line_length": 86, "alphanum_fraction": 0.5484864033}
const path = require('path');
const Kernel = require('@conga/framework/lib/kernel/TestKernel');

const rootPath = path.join(__dirname, '..', '..', '..');
const modulePath = path.join(rootPath, 'node_modules');
const appPath = path.join(rootPath, 'spec', 'data', 'projects', 'sample');

const Module = require('module');
const originalLoad = Module._load;

Module._load = function (request, parent) {

    let idx = request.indexOf('bass-nedb');
    if (idx !== -1) {
        request = path.join(modulePath, request.substr(idx));
    }

    return originalLoad.call(this, request, parent);
};

const userTest = require('../../../spec/UserTests.js');
const adminTest = require('../../../spec/AdminTests.js');
const annotationTest = require('../../../spec/AnnotationTests');
const anonymousTest = require('../../../spec/AnonymousTests');

describe("@conga/framework-security; firewall; provider; bass; bcrypt;", () => {

    let kernel;

    beforeAll((done) => {

        kernel = new Kernel(
            appPath,
            'app',
            'bass_bcrypt',
            {}
        );

        kernel.addBundlePaths({
            'demo-bundle': path.join(appPath, 'src', 'demo-bundle'),
            '@conga/framework-security': rootPath,
            '@conga/framework-bass': path.join(modulePath, '@conga', 'framework-bass')
        });


        kernel.boot(() => {
            // need to wait a bit to make sure nedb connections are created
            setTimeout(() => {

                kernel.container.get('bass.fixture.runner').runFixtures(
                    path.join(appPath, 'app', 'bass', 'fixtures'),
                    null,
                    () => {
                        done();
                    }
                )

            }, 500);
        });

    });

    describe("anonymous;", anonymousTest);

    describe("user;", userTest);

    describe("admin;", adminTest);

    describe("annotations;", annotationTest);

});
