@@ -114,6 +114,16 @@ Jasmine.prototype.addSpecFile = function(filePath) {
114
114
this . specFiles . push ( filePath ) ;
115
115
} ;
116
116
117
+ /**
118
+ * Adds a helper file to the list that will be loaded when the suite is executed.
119
+ * @function
120
+ * @name Jasmine#addHelperFile
121
+ * @param {string } filePath The path to the file to be loaded.
122
+ */
123
+ Jasmine . prototype . addHelperFile = function ( filePath ) {
124
+ this . helperFiles . push ( filePath ) ;
125
+ } ;
126
+
117
127
/**
118
128
* Add a custom reporter to the Jasmine environment.
119
129
* @function
@@ -329,8 +339,48 @@ Jasmine.prototype.loadConfig = function(config) {
329
339
}
330
340
} ;
331
341
332
- Jasmine . prototype . addHelperFiles = addFiles ( 'helperFiles' ) ;
333
- Jasmine . prototype . addSpecFiles = addFiles ( 'specFiles' ) ;
342
+ /**
343
+ * Adds files that match the specified patterns to the list of spec files.
344
+ * @function
345
+ * @name Jasmine#addMatchingSpecFiles
346
+ * @param {Array<string> } patterns An array of spec file paths
347
+ * or {@link https://github.com/isaacs/node-glob#glob-primer|globs} that match
348
+ * spec files. Each path or glob will be evaluated relative to the spec directory.
349
+ */
350
+ Jasmine . prototype . addMatchingSpecFiles = addFiles ( 'specFiles' ) ;
351
+ /**
352
+ * Adds files that match the specified patterns to the list of helper files.
353
+ * @function
354
+ * @name Jasmine#addMatchingHelperFiles
355
+ * @param {Array<string> } patterns An array of helper file paths
356
+ * or {@link https://github.com/isaacs/node-glob#glob-primer|globs} that match
357
+ * helper files. Each path or glob will be evaluated relative to the spec directory.
358
+ */
359
+ Jasmine . prototype . addMatchingHelperFiles = addFiles ( 'helperFiles' ) ;
360
+
361
+
362
+ // Deprecated synonyms for the above. These are confusingly named (addSpecFiles
363
+ // doesn't just do N of what addSpecFile does) but they've been around a long
364
+ // time and there might be quite a bit of code that uses them.
365
+
366
+ /**
367
+ * Synonym for {@link Jasmine#addMatchingSpecFiles}
368
+ * @function
369
+ * @name Jasmine#addSpecFiles
370
+ * @deprecated Use {@link Jasmine#addMatchingSpecFiles|addMatchingSpecFiles},
371
+ * {@link Jasmine#loadConfig|loadConfig}, or {@link Jasmine#loadConfigFile|loadConfigFile}
372
+ * instead.
373
+ */
374
+ Jasmine . prototype . addSpecFiles = Jasmine . prototype . addMatchingSpecFiles ;
375
+ /**
376
+ * Synonym for {@link Jasmine#addMatchingHelperFiles}
377
+ * @name Jasmine#addHelperFiles
378
+ * @function
379
+ * @deprecated Use {@link Jasmine#addMatchingHelperFiles|addMatchingHelperFiles},
380
+ * {@link Jasmine#loadConfig|loadConfig}, or {@link Jasmine#loadConfigFile|loadConfigFile}
381
+ * instead.
382
+ */
383
+ Jasmine . prototype . addHelperFiles = Jasmine . prototype . addMatchingHelperFiles ;
334
384
335
385
Jasmine . prototype . addRequires = function ( requires ) {
336
386
var jasmineRunner = this ;
0 commit comments