@@ -131,7 +131,12 @@ describe('parser', (): void => {
131
131
{ type : PartType . TEXT , text : 'foo ' , source : undefined } ,
132
132
{ type : PartType . ENV_VARIABLE , name : 'a),b' , source : undefined } ,
133
133
{ type : PartType . TEXT , text : ' ' , source : undefined } ,
134
- { type : PartType . PLUGIN , plugin : { fqcn : 'foo.bar.baz' , type : 'bam' } , entrypoint : undefined , source : undefined } ,
134
+ {
135
+ type : PartType . PLUGIN ,
136
+ plugin : { fqcn : 'foo.bar.baz' , type : 'bam' } ,
137
+ entrypoint : undefined ,
138
+ source : undefined ,
139
+ } ,
135
140
{ type : PartType . TEXT , text : ' baz ' , source : undefined } ,
136
141
{ type : PartType . OPTION_VALUE , value : ' b,na)\\m, ' , source : undefined } ,
137
142
{ type : PartType . TEXT , text : ' ' , source : undefined } ,
@@ -149,9 +154,19 @@ describe('parser', (): void => {
149
154
] ) ;
150
155
expect ( parse ( 'P(foo.bar.baz#role) P(foo.bar.baz#role:entrypoint)' ) ) . toEqual ( [
151
156
[
152
- { type : PartType . PLUGIN , plugin : { fqcn : 'foo.bar.baz' , type : 'role' } , entrypoint : undefined , source : undefined } ,
157
+ {
158
+ type : PartType . PLUGIN ,
159
+ plugin : { fqcn : 'foo.bar.baz' , type : 'role' } ,
160
+ entrypoint : undefined ,
161
+ source : undefined ,
162
+ } ,
153
163
{ type : PartType . TEXT , text : ' ' , source : undefined } ,
154
- { type : PartType . PLUGIN , plugin : { fqcn : 'foo.bar.baz' , type : 'role' } , entrypoint : 'entrypoint' , source : undefined } ,
164
+ {
165
+ type : PartType . PLUGIN ,
166
+ plugin : { fqcn : 'foo.bar.baz' , type : 'role' } ,
167
+ entrypoint : 'entrypoint' ,
168
+ source : undefined ,
169
+ } ,
155
170
] ,
156
171
] ) ;
157
172
} ) ;
@@ -162,7 +177,12 @@ describe('parser', (): void => {
162
177
{ type : PartType . TEXT , text : 'foo ' , source : 'foo ' } ,
163
178
{ type : PartType . ENV_VARIABLE , name : 'a),b' , source : 'E(a\\),b)' } ,
164
179
{ type : PartType . TEXT , text : ' ' , source : ' ' } ,
165
- { type : PartType . PLUGIN , plugin : { fqcn : 'foo.bar.baz' , type : 'bam' } , entrypoint : undefined , source : 'P(foo.bar.baz#bam)' } ,
180
+ {
181
+ type : PartType . PLUGIN ,
182
+ plugin : { fqcn : 'foo.bar.baz' , type : 'bam' } ,
183
+ entrypoint : undefined ,
184
+ source : 'P(foo.bar.baz#bam)' ,
185
+ } ,
166
186
{ type : PartType . TEXT , text : ' baz ' , source : ' baz ' } ,
167
187
{ type : PartType . OPTION_VALUE , value : ' b,na)\\m, ' , source : 'V( b\\,\\na\\)\\\\m\\, )' } ,
168
188
{ type : PartType . TEXT , text : ' ' , source : ' ' } ,
@@ -181,9 +201,19 @@ describe('parser', (): void => {
181
201
) ;
182
202
expect ( parse ( 'P(foo.bar.baz#role) P(foo.bar.baz#role:entrypoint)' ) ) . toEqual ( [
183
203
[
184
- { type : PartType . PLUGIN , plugin : { fqcn : 'foo.bar.baz' , type : 'role' } , entrypoint : undefined , source : undefined } ,
204
+ {
205
+ type : PartType . PLUGIN ,
206
+ plugin : { fqcn : 'foo.bar.baz' , type : 'role' } ,
207
+ entrypoint : undefined ,
208
+ source : undefined ,
209
+ } ,
185
210
{ type : PartType . TEXT , text : ' ' , source : undefined } ,
186
- { type : PartType . PLUGIN , plugin : { fqcn : 'foo.bar.baz' , type : 'role' } , entrypoint : 'entrypoint' , source : undefined } ,
211
+ {
212
+ type : PartType . PLUGIN ,
213
+ plugin : { fqcn : 'foo.bar.baz' , type : 'role' } ,
214
+ entrypoint : 'entrypoint' ,
215
+ source : undefined ,
216
+ } ,
187
217
] ,
188
218
] ) ;
189
219
} ) ;
@@ -446,12 +476,12 @@ describe('parser', (): void => {
446
476
expect ( async ( ) => parse ( 'P(foo.bar.baz#b m)' , { errors : 'exception' , helpfulErrors : false } ) ) . rejects . toThrow (
447
477
'While parsing P() at index 1: Plugin type "b m" is not valid' ,
448
478
) ;
449
- expect ( async ( ) => parse ( 'P(foo.bar.baz#module:e p)' , { errors : 'exception' , helpfulErrors : false } ) ) . rejects . toThrow (
450
- 'While parsing P() at index 1: Entrypoint " e p" is not valid' ,
451
- ) ;
452
- expect ( async ( ) => parse ( 'P(foo.bar.baz#module:entrypoint)' , { errors : 'exception' , helpfulErrors : false } ) ) . rejects . toThrow (
453
- 'While parsing P() at index 1: Only role references can have entrypoints' ,
454
- ) ;
479
+ expect ( async ( ) =>
480
+ parse ( 'P(foo.bar.baz#module: e p)' , { errors : 'exception' , helpfulErrors : false } ) ,
481
+ ) . rejects . toThrow ( 'While parsing P() at index 1: Entrypoint "e p" is not valid' ) ;
482
+ expect ( async ( ) =>
483
+ parse ( 'P(foo.bar.baz#module:entrypoint)' , { errors : 'exception' , helpfulErrors : false } ) ,
484
+ ) . rejects . toThrow ( 'While parsing P() at index 1: Only role references can have entrypoints' ) ;
455
485
} ) ;
456
486
it ( 'bad option name/return value (throw error)' , ( ) : void => {
457
487
expect ( async ( ) =>
@@ -466,9 +496,9 @@ describe('parser', (): void => {
466
496
expect ( async ( ) => parse ( 'O(foo.bar.baz#role:bam)' , { errors : 'exception' , helpfulErrors : false } ) ) . rejects . toThrow (
467
497
'While parsing O() at index 1: Role reference is missing entrypoint' ,
468
498
) ;
469
- expect ( async ( ) => parse ( 'O(foo.bar.baz#role:e p:bam)' , { errors : 'exception' , helpfulErrors : false } ) ) . rejects . toThrow (
470
- 'While parsing O() at index 1: Entrypoint " e p" is not valid' ,
471
- ) ;
499
+ expect ( async ( ) =>
500
+ parse ( 'O(foo.bar.baz#role: e p:bam)' , { errors : 'exception' , helpfulErrors : false } ) ,
501
+ ) . rejects . toThrow ( 'While parsing O() at index 1: Entrypoint "e p" is not valid' ) ;
472
502
} ) ;
473
503
it ( 'bad parameter parsing (no escaping, error message)' , ( ) : void => {
474
504
expect ( parse ( 'M(' , { helpfulErrors : false } ) ) . toEqual ( [
0 commit comments