@@ -125,7 +125,7 @@ function testProps(object, propTests, test) {
125
125
} ) ;
126
126
127
127
test . ok ( object . hasOwnProperty ( propName ) , '"' + propName + '" prop should be present' ) ;
128
- test . ok ( isOneOfTheseTypes , '"' + propName + '" prop should be one of types ' + possibleTypes ) ;
128
+ test . ok ( isOneOfTheseTypes , '"' + propName + '" prop should be one of types ' + possibleTypes + ' but was instead ' + typeof propName ) ;
129
129
}
130
130
131
131
// go over each property test and run it
@@ -154,7 +154,7 @@ engineNames.forEach(function (engineName) {
154
154
var propertyTests = {
155
155
'engine' : [ 'object' , 'function' ] ,
156
156
'engineName' : 'string' ,
157
- 'engineFileExtension' : 'string' ,
157
+ 'engineFileExtension' : [ 'string' , 'object' ] ,
158
158
'renderPattern' : 'function' ,
159
159
'findPartials' : 'function'
160
160
} ;
@@ -164,3 +164,24 @@ engineNames.forEach(function (engineName) {
164
164
test . end ( ) ;
165
165
} ) ;
166
166
} ) ;
167
+
168
+ tap . test ( 'patternEngines getSupportedFileExtensions flattens known engine extensions into a single array' , function ( test ) {
169
+
170
+ //arrange
171
+ patternEngines . fooEngine = {
172
+ engineFileExtension : [ '.foo1' , '.foo2' ]
173
+ } ;
174
+ patternEngines . barEngine = {
175
+ engineFileExtension : '.bar'
176
+ } ;
177
+
178
+ const exts = patternEngines . getSupportedFileExtensions ( ) ;
179
+ test . ok ( exts . includes ( '.foo1' ) ) ;
180
+ test . ok ( exts . includes ( '.foo2' ) ) ;
181
+ test . ok ( exts . includes ( '.bar' ) ) ;
182
+
183
+ delete patternEngines . fooEngine ;
184
+ delete patternEngines . barEngine ;
185
+
186
+ test . end ( ) ;
187
+ } ) ;
0 commit comments