shaman-website-compiler
Version:
Compile raw HTML, CSS and Javascript into the smallest possible, SEO friendly website.
43 lines • 1.98 kB
JavaScript
;
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};
Object.defineProperty(exports, "__esModule", { value: true });
require("mocha");
var chai_1 = require("chai");
var app_composition_1 = require("./composition/app.composition");
var website_factory_1 = require("./website-factory");
var models_1 = require("./models");
var website_1 = require("./website");
describe('ShamanFactory', function () {
beforeEach(function () {
app_composition_1.IoC.snapshot();
});
afterEach(function () {
app_composition_1.IoC.restore();
});
it('ShamanFactory should return a website', function () {
var adapter = new models_1.AdapterConfig();
adapter.module = '../adapters/json-repo.adapter';
adapter.name = "JsonRepoAdapter";
adapter.configuration = { models: [] };
var subject = (0, website_factory_1.WebsiteFactory)(new models_1.WebsiteConfig({ adapter: adapter }));
(0, chai_1.expect)(subject instanceof website_1.Website).to.be.true;
});
it('ShamanFactory should configure application for production', function () {
process.argv = __spreadArray(__spreadArray([], process.argv.slice(0, 2), true), ["--prod"], false);
var adapter = new models_1.AdapterConfig();
adapter.module = '../adapters/json-repo.adapter';
adapter.name = "JsonRepoAdapter";
adapter.configuration = { models: [] };
var subject = (0, website_factory_1.WebsiteFactory)(new models_1.WebsiteConfig({ adapter: adapter }));
(0, chai_1.expect)(subject.config.production).to.be.true;
});
});
//# sourceMappingURL=website-factory.spec.js.map