Skip to content

Commit b3bef1e

Browse files
authored
🐛Fix Tests not continuous running if only parent is selected (#163)
1 parent e9da991 commit b3bef1e

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/pesterTestController.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import {
3838
IPowerShellExtensionClient,
3939
PowerShellExtensionClient
4040
} from './powershellExtensionClient'
41-
import { clear, findTestItem, forAll, getTestItems, isTestItemOptions } from './testItemUtils'
41+
import { clear, findTestItem, forAll, getTestItems, getUniqueTestItems, isTestItemOptions } from './testItemUtils'
4242
import debounce = require('debounce-promise')
4343
import { isDeepStrictEqual } from 'util'
4444
/** A wrapper for the vscode TestController API specific to PowerShell Pester Test Suite.
@@ -193,8 +193,17 @@ export class PesterTestController implements Disposable {
193193
// If tests were changed that were marked for continuous run, we want to start a run for them
194194
const outdatedTests = new Set<TestItem>()
195195

196+
197+
//Get all children of the standing continuous run tests so that we make sure to run them if they are changed.
198+
const allContinuousRunTests = new Set<TestItem>(this.continuousRunTests)
199+
this.continuousRunTests.forEach(test =>
200+
getUniqueTestItems(test.children).forEach(
201+
child => allContinuousRunTests.add(child)
202+
)
203+
)
204+
196205
newAndChangedTests.forEach(test => {
197-
if (this.continuousRunTests.has(test)) {
206+
if (allContinuousRunTests.has(test)) {
198207
outdatedTests.add(test)
199208
}
200209
})

0 commit comments

Comments
 (0)