@@ -24,8 +24,12 @@ const {expectFileToMatchSnapshot} = require('../../snapshots');
24
24
const sandbox = new TestSandbox ( path . resolve ( __dirname , '../.sandbox' ) ) ;
25
25
26
26
// CLI Inputs
27
+ const defaultCLIInput = {
28
+ name : 'productReview' ,
29
+ } ;
27
30
const basicCLIInput = {
28
31
name : 'productReview' ,
32
+ controllerType : 'ControllerGenerator.BASIC' ,
29
33
} ;
30
34
const restCLIInput = {
31
35
name : 'productReview' ,
@@ -54,7 +58,7 @@ describe('lb4 controller', () => {
54
58
. inDir ( sandbox . path , ( ) =>
55
59
testUtils . givenLBProject ( sandbox . path , { excludePackageJSON : true } ) ,
56
60
)
57
- . withPrompts ( basicCLIInput ) ,
61
+ . withPrompts ( defaultCLIInput ) ,
58
62
) . to . be . rejectedWith ( / N o p a c k a g e .j s o n f o u n d i n / ) ;
59
63
} ) ;
60
64
@@ -65,12 +69,21 @@ describe('lb4 controller', () => {
65
69
. inDir ( sandbox . path , ( ) =>
66
70
testUtils . givenLBProject ( sandbox . path , { excludeLoopbackCore : true } ) ,
67
71
)
68
- . withPrompts ( basicCLIInput ) ,
72
+ . withPrompts ( defaultCLIInput ) ,
69
73
) . to . be . rejectedWith ( / N o ` @ l o o p b a c k \/ c o r e ` p a c k a g e f o u n d / ) ;
70
74
} ) ;
71
75
72
76
describe ( 'basic controller' , ( ) => {
73
77
it ( 'scaffolds correct file with input' , async ( ) => {
78
+ await testUtils
79
+ . executeGenerator ( generator )
80
+ . inDir ( sandbox . path , ( ) => testUtils . givenLBProject ( sandbox . path ) )
81
+ . withPrompts ( defaultCLIInput ) ;
82
+
83
+ checkBasicContents ( ) ;
84
+ } ) ;
85
+
86
+ it ( 'scaffolds correct file with controllerType BASIC specified explicitly' , async ( ) => {
74
87
await testUtils
75
88
. executeGenerator ( generator )
76
89
. inDir ( sandbox . path , ( ) => testUtils . givenLBProject ( sandbox . path ) )
0 commit comments