UNPKG

generator-openui5

Version:
58 lines (47 loc) 1.35 kB
/*global describe, beforeEach, it, __dirname, require*/ (function() { "use strict"; var path = require("path"); var helpers = require("yeoman-generator").test; describe("openui5 app generator - single page mvc app", function() { beforeEach(function(done) { console.log("*** SPA MVC App ***"); helpers.testDirectory(path.join(__dirname, "temp"), function(err) { if (err) { return done(err); } this.app = helpers.createGenerator("openui5:app", [ "../../app", "../../view" ]); done(); }.bind(this)); }); it("creates expected files with args", function(done) { var mockPrompts = { applicationName: "My Application", appDescription: "Test Description", authorName: "John Doe", gitRepository: "ssh://github.com/ropository/url.git", licenseType: "Apache License, Version 2.0", applicationType: "spa", openUI5LocationOption: "bower" }; var expected = [ "index.html", "Gruntfile.js", ".jshintrc", "bower.json", "package.json", "README.md" ]; helpers.mockPrompt(this.app, mockPrompts); this.app.args = ["Main", false]; this.app.options["skip-install"] = true; this.app.run({}, function() { helpers.assertFile(expected); done(); }); }); }); }());