Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -465,22 +465,25 @@ describe("ProjectService", () => {
const t = tempDir();
t.write("nested/databricks.yml");
const search = heldFileSearch();
const { service, initialized, searched, touch } = setup([t.dir], {
const { service, files, initialized, searched } = setup([t.dir], {
search: search.search,
});
service.start();
await initialized();
search.release();
await searched();
t.write("other/databricks.yml");
// A bundle file event with no bundle written: a pass for the same folder.
await touch(t.path("databricks.yml"));
expect(search.held()).toBe(1);
// A bundle file event with no bundle written: a pass for the same folder. The pass is
// behind two debounce timers, which Windows can wake late, so wait for its new search.
files.touch(t.path("databricks.yml"));
await vi.waitFor(() => expect(search.held()).toBe(1));
expect(service.subProjectSearch.value).toBe("done");
expect(service.subProjects.value.map((p) => p.relative)).toEqual(["nested"]);
search.release();
await new Promise((r) => setTimeout(r, 20));
expect(service.subProjects.value.map((p) => p.relative)).toEqual(["nested", "other"]);
// The status stays "done" during the new search, so wait for what it finds.
await vi.waitFor(() =>
expect(service.subProjects.value.map((p) => p.relative)).toEqual(["nested", "other"]),
);
});

it("keeps the sub-projects it found when a later search of the same folder fails", async () => {
Expand Down
Loading