fix: run updateList before determining what tests changed
This commit is contained in:
parent
01a0024ce7
commit
504cb0a823
|
|
@ -314,9 +314,14 @@ export const UIModeView: React.FC<{}> = ({
|
||||||
|
|
||||||
// Watch implementation.
|
// Watch implementation.
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
if (!testServerConnection)
|
if (!testServerConnection || !teleSuiteUpdater)
|
||||||
return;
|
return;
|
||||||
const disposable = testServerConnection.onTestFilesChanged(params => {
|
const disposable = testServerConnection.onTestFilesChanged(async params => {
|
||||||
|
await updateList();
|
||||||
|
|
||||||
|
const testModel = teleSuiteUpdater.asModel();
|
||||||
|
const testTree = new TestTree('', testModel.rootSuite, testModel.loadErrors, projectFilters, pathSeparator);
|
||||||
|
|
||||||
const testIds: string[] = [];
|
const testIds: string[] = [];
|
||||||
const set = new Set(params.testFiles);
|
const set = new Set(params.testFiles);
|
||||||
if (watchAll) {
|
if (watchAll) {
|
||||||
|
|
@ -339,7 +344,7 @@ export const UIModeView: React.FC<{}> = ({
|
||||||
runTests('queue-if-busy', new Set(testIds));
|
runTests('queue-if-busy', new Set(testIds));
|
||||||
});
|
});
|
||||||
return () => disposable.dispose();
|
return () => disposable.dispose();
|
||||||
}, [runTests, testServerConnection, testTree, watchAll, watchedTreeIds]);
|
}, [runTests, updateList, testServerConnection, watchAll, watchedTreeIds, teleSuiteUpdater, projectFilters]);
|
||||||
|
|
||||||
// Shortcuts.
|
// Shortcuts.
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
|
|
|
||||||
|
|
@ -245,7 +245,7 @@ test('should run added test in watched file', async ({ runUITest, writeFiles })
|
||||||
});
|
});
|
||||||
|
|
||||||
await expect.poll(dumpTestTree(page)).toBe(`
|
await expect.poll(dumpTestTree(page)).toBe(`
|
||||||
▼ ◯ a.test.ts 👁 <=
|
▼ ✅ a.test.ts 👁 <=
|
||||||
✅ foo
|
✅ foo
|
||||||
✅ bar
|
✅ bar
|
||||||
`);
|
`);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue