"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 requirements_only_1 = require("../../steps/requirements_only");
var immutable_1 = require("immutable");
describe("requirements only", function () {
    var editor;
    var options;
    before(function () {
        editor = fsEditor.create(memFs.create());
        options = immutable_1.fromJS({ editor: editor });
    });
    beforeEach(function () {
        editor.write("v1/app.js", "var a = \"b\"");
    });
    afterEach(function () {
        editor.delete("v1/*");
    });
    describe("with an app.js file present", function () {
        it("should pass when there is no requirements.json", function () {
            return expect(requirements_only_1.default(options)).to.eventually.be.fulfilled;
        });
        it("should pass when there is a requirements.json", function () {
            editor.writeJSON("v1/requirements.json", {});
            return expect(requirements_only_1.default(options)).to.eventually.be.fulfilled;
        });
    });
    describe("with no app.js file present", function () {
        it("should pass when there is a requirements.json", function () {
            editor.writeJSON("v1/requirements.json", {});
            return expect(requirements_only_1.default(options)).to.eventually.be.fulfilled;
        });
        it("should pass when there is no requirements.json", function () {
            return expect(requirements_only_1.default(options)).to.eventually.be.fulfilled;
        });
    });
});
