Skip to content

Commit

Permalink
Merge pull request #8 from yantrashala/development
Browse files Browse the repository at this point in the history
release #3
  • Loading branch information
slahiri committed Jul 17, 2017
2 parents 0468d19 + c403062 commit c09a298
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 3 deletions.
42 changes: 42 additions & 0 deletions __tests__/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,47 @@ describe('generator-loopback-ssl:app', function () {
yassert.jsonFileContent('server/config.json', {httpMode: false});
});
});


describe('scenario:option3:https', function () {
var tempDir;
beforeEach(function (done) {
return helpers.run(path.join(__dirname, '../generators/app'))
.inTmpDir(function (dir) {
tempDir = dir;
fs.copySync(path.join(__dirname, '../fixtures/loopback-2'), dir);
}).withPrompts({
name: 'loopback-2',
description: 'loopback-2',
version: '1.0.0',
homepage: undefined,
loopbackVersion: '2.x',
configFile: 'config.json',
httpMode: 'option3',
privateKey: 'key.pem',
certificate: 'cert.pem',
genCerts: true,
certDuration: 365,
certHost: 'localhost',
clientCertificate: 'client-cert.pem',
confirmSetup: true
})
.on('end', done);
});

it('config.json-exists', () => {
yassert.file(['server/config.json']);
});

it('server.js-exists', () => {
yassert.file(['server/server.js']);
});

it('config.json: {httpMode=false}', () => {
yassert.jsonFileContent('server/config.json', {httpMode: false});
});
});


});
});
4 changes: 2 additions & 2 deletions generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const Generator = require('yeoman-generator');
const debug = require('debug')('generator-loopback-ssl:index');
// Const yosay = require('yosay');
const yosay = require('yosay');
const chalk = require('chalk');
const _util = require('../../lib/utility.js');
const path = require('path');
Expand Down Expand Up @@ -152,7 +152,7 @@ module.exports = class extends Generator {

prompting() {
_util.validateTargetPackage(this.pkg);
// Console.log(yosay('Hello, and welcome to loopback-ssl generator!'));
console.log(yosay('Hello, and welcome to loopback-ssl generator!'));
return this._askForModuleName()
.then(this._askFor.bind(this));
}
Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@
"yosay": "^2.0.0"
},
"jest": {
"testEnvironment": "node"
"verbose": true,
"testEnvironment": "node",
"collectCoverage": true,
"coverageDirectory": "coverage",
"coverageReporters": ["json", "lcov", "text"]
},
"scripts": {
"prepublish": "nsp check",
Expand Down

0 comments on commit c09a298

Please sign in to comment.