diff --git a/types/grunt/grunt-tests.ts b/types/grunt/grunt-tests.ts index d4027da3fb..7dd6dcf47c 100644 --- a/types/grunt/grunt-tests.ts +++ b/types/grunt/grunt-tests.ts @@ -133,4 +133,9 @@ exports.exports = function(grunt: IGrunt) { let myTest = function (grunt: IGrunt) { grunt.file.expand(['*.ts']); grunt.file.expand('*.ts'); + + // 'cwd' in options, and string pattern + grunt.file.expand({ + cwd: '.' + }, '*.ts'); } diff --git a/types/grunt/index.d.ts b/types/grunt/index.d.ts index 5187e5e965..15fd9f0959 100644 --- a/types/grunt/index.d.ts +++ b/types/grunt/index.d.ts @@ -446,7 +446,7 @@ declare namespace grunt { * grunt.file.setBase or the --base command-line option. */ expand(patterns: string | string[]): string[]; - expand(options: IFilesConfig, patterns: string[]): string[]; + expand(options: IFilesConfig, patterns: string | string[]): string[]; /** * Returns an array of src-dest file mapping objects. @@ -595,6 +595,12 @@ declare namespace grunt { // filter?: string // filter?: (src: string) => boolean filter?: any; + + /** + * Patterns will be matched relative to this path, and all returned filepaths will + * also be relative to this path. + */ + cwd?: string; } /**