diff --git a/docs/WatchPlugins.md b/docs/WatchPlugins.md index 6047382eefc0..89eb3c079fef 100644 --- a/docs/WatchPlugins.md +++ b/docs/WatchPlugins.md @@ -46,7 +46,7 @@ class MyWatchPlugin { Below are the hooks available in Jest. -#### `jestHooks.shouldRunTestSuite(testPath)` +#### `jestHooks.shouldRunTestSuite(testSuite)` Returns a boolean (or `Promise` for handling asynchronous operations) to specify if a test should be run or not. @@ -55,13 +55,13 @@ For example: ```javascript class MyWatchPlugin { apply(jestHooks) { - jestHooks.shouldRunTestSuite(testPath => { - return testPath.includes('my-keyword'); + jestHooks.shouldRunTestSuite(testSuite => { + return testSuite.testPath.includes('my-keyword'); }); // or a promise - jestHooks.shouldRunTestSuite(testPath => { - return Promise.resolve(testPath.includes('my-keyword')); + jestHooks.shouldRunTestSuite(testSuite => { + return Promise.resolve(testSuite.testPath.includes('my-keyword')); }); } }