Skip to content

Commit adc1dfa

Browse files
authored
test(cli): narrow config pull live pin (CLI-2324) (#6468)
## TL;DR spotted in: https://github.com/supabase/cli/actions/runs/33807759564/job/100822219503 passes now: https://github.com/supabase/cli/actions/runs/33867343063 ## ref: - closes: CLI-2324 - same as: #6437
1 parent c7e6481 commit adc1dfa

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

apps/cli/src/legacy/commands/config/pull/pull.live.test.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,25 @@ import { requireLiveSuccess, test } from "../../../../../tests/helpers/live.ts";
55
// Golden path only: the one thing mocks cannot prove is a real
66
// `GET /v2/projects/{ref}/config` response decoding, planning, and writing
77
// cleanly against a real (freshly-initialized) `supabase/config.toml`, and
8-
// that a second run against the SAME project converges to nothing (the
8+
// that a second run against the SAME project leaves nothing to write (the
99
// convergence check's own real-world counterpart — branch coverage lives in
1010
// pull.integration.test.ts). The `workspace` fixture behind `cli` is a fresh
1111
// `supabase init` project directory.
12-
test("pulls remote config into a fresh project, converging to nothing on a second run", async ({
12+
test("pulls remote config into a fresh project, leaving nothing to write on a second run", async ({
1313
cli,
1414
project,
1515
}) => {
16-
const first = await cli(["config", "pull", "--project-ref", project.ref, "--yes"]);
17-
expect(`${first.stdout}${first.stderr}`).not.toContain("Unauthorized");
16+
const args = ["config", "pull", "--project-ref", project.ref, "--yes", "--output-format", "json"];
17+
const first = await cli(args);
1818
requireLiveSuccess(first, "config pull");
19+
expect(JSON.parse(first.stdout)).toEqual(expect.objectContaining({ wrote: true }));
1920

20-
const second = await cli(["config", "pull", "--project-ref", project.ref, "--yes"]);
21+
const second = await cli(args);
2122
requireLiveSuccess(second, "config pull");
22-
expect(second.stdout).toContain("No config differences found.");
23+
expect(JSON.parse(second.stdout)).toEqual(
24+
expect.objectContaining({
25+
wrote: false,
26+
scope: expect.objectContaining({ present: expect.arrayContaining(["auth"]) }),
27+
}),
28+
);
2329
});

0 commit comments

Comments
 (0)