File tree Expand file tree Collapse file tree 3 files changed +49
-3
lines changed Expand file tree Collapse file tree 3 files changed +49
-3
lines changed Original file line number Diff line number Diff line change @@ -82,5 +82,47 @@ describe('generator-loopback-ssl:app', function () {
82
82
yassert . jsonFileContent ( 'server/config.json' , { httpMode : false } ) ;
83
83
} ) ;
84
84
} ) ;
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
+
85
127
} ) ;
86
128
} ) ;
Original file line number Diff line number Diff line change 2
2
3
3
const Generator = require ( 'yeoman-generator' ) ;
4
4
const debug = require ( 'debug' ) ( 'generator-loopback-ssl:index' ) ;
5
- // Const yosay = require('yosay');
5
+ const yosay = require ( 'yosay' ) ;
6
6
const chalk = require ( 'chalk' ) ;
7
7
const _util = require ( '../../lib/utility.js' ) ;
8
8
const path = require ( 'path' ) ;
@@ -152,7 +152,7 @@ module.exports = class extends Generator {
152
152
153
153
prompting ( ) {
154
154
_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!' ) ) ;
156
156
return this . _askForModuleName ( )
157
157
. then ( this . _askFor . bind ( this ) ) ;
158
158
}
Original file line number Diff line number Diff line change 43
43
"yosay" : " ^2.0.0"
44
44
},
45
45
"jest" : {
46
- "testEnvironment" : " node"
46
+ "verbose" : true ,
47
+ "testEnvironment" : " node" ,
48
+ "collectCoverage" : true ,
49
+ "coverageDirectory" : " coverage" ,
50
+ "coverageReporters" : [" json" , " lcov" , " text" ]
47
51
},
48
52
"scripts" : {
49
53
"prepublish" : " nsp check" ,
You can’t perform that action at this time.
0 commit comments