Skip to content

Commit c09a298

Browse files
authored
Merge pull request #8 from yantrashala/development
release #3
2 parents 0468d19 + c403062 commit c09a298

File tree

3 files changed

+49
-3
lines changed

3 files changed

+49
-3
lines changed

__tests__/app.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,47 @@ describe('generator-loopback-ssl:app', function () {
8282
yassert.jsonFileContent('server/config.json', {httpMode: false});
8383
});
8484
});
85+
86+
87+
describe('scenario:option3:https', function () {
88+
var tempDir;
89+
beforeEach(function (done) {
90+
return helpers.run(path.join(__dirname, '../generators/app'))
91+
.inTmpDir(function (dir) {
92+
tempDir = dir;
93+
fs.copySync(path.join(__dirname, '../fixtures/loopback-2'), dir);
94+
}).withPrompts({
95+
name: 'loopback-2',
96+
description: 'loopback-2',
97+
version: '1.0.0',
98+
homepage: undefined,
99+
loopbackVersion: '2.x',
100+
configFile: 'config.json',
101+
httpMode: 'option3',
102+
privateKey: 'key.pem',
103+
certificate: 'cert.pem',
104+
genCerts: true,
105+
certDuration: 365,
106+
certHost: 'localhost',
107+
clientCertificate: 'client-cert.pem',
108+
confirmSetup: true
109+
})
110+
.on('end', done);
111+
});
112+
113+
it('config.json-exists', () => {
114+
yassert.file(['server/config.json']);
115+
});
116+
117+
it('server.js-exists', () => {
118+
yassert.file(['server/server.js']);
119+
});
120+
121+
it('config.json: {httpMode=false}', () => {
122+
yassert.jsonFileContent('server/config.json', {httpMode: false});
123+
});
124+
});
125+
126+
85127
});
86128
});

generators/app/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
const Generator = require('yeoman-generator');
44
const debug = require('debug')('generator-loopback-ssl:index');
5-
// Const yosay = require('yosay');
5+
const yosay = require('yosay');
66
const chalk = require('chalk');
77
const _util = require('../../lib/utility.js');
88
const path = require('path');
@@ -152,7 +152,7 @@ module.exports = class extends Generator {
152152

153153
prompting() {
154154
_util.validateTargetPackage(this.pkg);
155-
// Console.log(yosay('Hello, and welcome to loopback-ssl generator!'));
155+
console.log(yosay('Hello, and welcome to loopback-ssl generator!'));
156156
return this._askForModuleName()
157157
.then(this._askFor.bind(this));
158158
}

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@
4343
"yosay": "^2.0.0"
4444
},
4545
"jest": {
46-
"testEnvironment": "node"
46+
"verbose": true,
47+
"testEnvironment": "node",
48+
"collectCoverage": true,
49+
"coverageDirectory": "coverage",
50+
"coverageReporters": ["json", "lcov", "text"]
4751
},
4852
"scripts": {
4953
"prepublish": "nsp check",

0 commit comments

Comments
 (0)