"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 correct_version_1 = require("../../steps/correct_version");
var immutable_1 = require("immutable");
describe("correct version", function () {
    var editor;
    var options;
    before(function () {
        editor = fsEditor.create(memFs.create());
        options = immutable_1.fromJS({ src: "v1", editor: editor });
    });
    afterEach(function () {
        editor.delete("v1/manifest.json");
    });
    it("should pass with a version < 2.0", function () {
        editor.writeJSON("v1/manifest.json", {
            frameworkVersion: "1.0"
        });
        return expect(correct_version_1.default(options)).to.eventually.be.fulfilled;
    });
    it("should raise an exception with a version >= 2.0", function () {
        editor.writeJSON("v1/manifest.json", {
            frameworkVersion: "2.0"
        });
        return expect(correct_version_1.default(options)).to.eventually.be.rejectedWith(Error, /"frameworkVersion" parameter must be less than 2.0/);
    });
    it("should raise an exception with no manifest file", function () {
        return expect(correct_version_1.default(options)).to.eventually.be.rejectedWith(Error, /"frameworkVersion" parameter must be less than 2.0/);
    });
});
