Skip to content

Commit af43f5a

Browse files
committed
fix: reload config files
1 parent 26b2902 commit af43f5a

2 files changed

Lines changed: 2 additions & 7 deletions

File tree

src/test/repository.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,10 @@ export class TestRepository implements vscode.Disposable {
8080

8181
// Get specs from configuration
8282
const allConfigSpecs = this.convertPathString(config.specs)
83-
if (allConfigSpecs.length === 0) {
83+
if (!filePaths || filePaths.length === 0) {
8484
for (const [fileId] of this._fileMap.entries()) {
8585
this.removeSpecFileById(fileId)
8686
}
87-
return
8887
}
8988
// Filter specs to only include those that match the provided file paths
9089
const specsToReload =

tests/test/repository.spec.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -292,16 +292,12 @@ describe('TestRepository', () => {
292292
})
293293

294294
it('should handle empty file paths array', async () => {
295-
// Setup
296-
const removeSpecFileSpy = sandbox.spy(testRepository, 'removeSpecFile')
297-
298295
// Execute
299296
await testRepository.reloadSpecFiles([])
300297

301298
// Verify
302299
expect(readSpecsStub).to.have.been.calledWithExactly({ specs: [mockSpecPath, mockSpecPath2] })
303-
expect(removeSpecFileSpy).to.have.been.calledWith(mockSpecPath)
304-
expect(removeSpecFileSpy).to.have.been.calledWith(mockSpecPath2)
300+
305301
expect(log.debug).to.have.been.calledWith('Reloading 2 spec files')
306302
expect(log.debug).to.have.been.calledWith('Successfully reloaded 2 spec files')
307303
})

0 commit comments

Comments
 (0)