File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed
Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,14 @@ module.exports = class extends Generator {
5353 } ) ;
5454 }
5555
56+ /**
57+ * Override the usage text by replacing `yo loopback4:` with `lb4 `.
58+ */
59+ usage ( ) {
60+ const text = super . usage ( ) ;
61+ return text . replace ( / ^ y o l o o p b a c k 4 : / g, 'lb4 ' ) ;
62+ }
63+
5664 setOptions ( ) {
5765 this . projectInfo = { } ;
5866 [
Original file line number Diff line number Diff line change 77const path = require ( 'path' ) ;
88const assert = require ( 'yeoman-assert' ) ;
99const helpers = require ( 'yeoman-test' ) ;
10+ const yeoman = require ( 'yeoman-environment' ) ;
1011
1112module . exports = function ( appGenerator , props ) {
1213 return function ( ) {
14+ describe ( 'help' , ( ) => {
15+ it ( 'prints lb4' , ( ) => {
16+ const env = yeoman . createEnv ( ) ;
17+ const name = appGenerator . substring ( appGenerator . lastIndexOf ( '/' ) + 1 ) ;
18+ env . register ( appGenerator , 'loopback4:' + name ) ;
19+ const generator = env . create ( 'loopback4:' + name ) ;
20+ const helpText = generator . help ( ) ;
21+ assert ( helpText . match ( / l b 4 / ) ) ;
22+ assert ( ! helpText . match ( / l o o p b a c k 4 : / ) ) ;
23+ } ) ;
24+ } ) ;
25+
1326 describe ( 'without settings' , ( ) => {
1427 before ( ( ) => {
1528 return helpers . run ( appGenerator ) . withPrompts ( props ) ;
You can’t perform that action at this time.
0 commit comments