"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var chai = require("chai");
var chaiAsPromised = require("chai-as-promised");
chai.use(chaiAsPromised);
var expect = chai.expect;
var memFs = require("mem-fs");
var fsEditor = require("mem-fs-editor");
var marketing_only_1 = require("../../steps/marketing_only");
var immutable_1 = require("immutable");
describe("marketing only", function () {
    var editor;
    var options;
    before(function () {
        editor = fsEditor.create(memFs.create());
        options = immutable_1.Map({ src: "v1", editor: editor });
    });
    afterEach(function () {
        editor.delete("v1/manifest.json");
    });
    it("should pass when not marketing only", function () {
        editor.writeJSON("v1/manifest.json", {
            marketingOnly: false
        });
        return expect(marketing_only_1.default(options)).to.eventually.be.fulfilled;
    });
    it("should raise an exception when marketing only", function () {
        editor.writeJSON("v1/manifest.json", {
            marketingOnly: true
        });
        return expect(marketing_only_1.default(options)).to.eventually.be.rejectedWith(Error, /"marketingOnly" parameter cannot be true for migration/);
    });
});
