diff --git a/testing/runner.ts b/testing/runner.ts index c4b04c58c9941..7d7426490eb13 100755 --- a/testing/runner.ts +++ b/testing/runner.ts @@ -113,6 +113,7 @@ export async function findTestModules( } export interface RunTestModulesOptions extends RunTestsOptions { + include?: string[]; exclude?: string[]; allowNone?: boolean; } @@ -128,29 +129,31 @@ export interface RunTestModulesOptions extends RunTestsOptions { * * Example: * - * runTestModules(["**\/*_test.ts", "**\/test.ts"]); + * runTestModules({ include: ["**\/*_test.ts", "**\/test.ts"] }); * * Any matched directory `` will expand to: * /**\/?(*_)test.{js,ts} * * So the above example is captured naturally by: * - * runTestModules(["."]); + * runTestModules({ include: ["."] }); + * + * Which is the default used for: + * + * runTestModules(); */ // TODO: Change return type to `Promise` once, `runTests` is updated // to return boolean instead of exiting. -export async function runTestModules( - include: string[], - { - exclude = [], - allowNone = false, - parallel = false, - exitOnFail = false, - only = /[^\s]/, - skip = /^\s*$/, - disableLog = false - }: RunTestModulesOptions = {} -): Promise { +export async function runTestModules({ + include = ["."], + exclude = [], + allowNone = false, + parallel = false, + exitOnFail = false, + only = /[^\s]/, + skip = /^\s*$/, + disableLog = false +}: RunTestModulesOptions = {}): Promise { const testModuleUrls = await findTestModules(include, exclude); if (testModuleUrls.length == 0) { @@ -213,7 +216,8 @@ async function main(): Promise { const exitOnFail = parsedArgs.failfast; const disableLog = parsedArgs.quiet; - await runTestModules(include, { + await runTestModules({ + include, exclude, allowNone, exitOnFail,