diff --git a/cli/unstable_progress_bar.ts b/cli/unstable_progress_bar.ts index 4f13230a5570..7f6869433b0f 100644 --- a/cli/unstable_progress_bar.ts +++ b/cli/unstable_progress_bar.ts @@ -270,7 +270,7 @@ export class ProgressBar { * await progressBar.end() * ``` */ - async end(): Promise { + async stop(): Promise { clearInterval(this.#id); await this.#print() .then(() => this.#writer.write(this.#clear ? "\r\u001b[K" : "\n")) diff --git a/cli/unstable_progress_bar_stream.ts b/cli/unstable_progress_bar_stream.ts index 2a46af40281e..9bbe5899e007 100644 --- a/cli/unstable_progress_bar_stream.ts +++ b/cli/unstable_progress_bar_stream.ts @@ -61,10 +61,10 @@ export class ProgressBarStream extends TransformStream { controller.enqueue(chunk); }, flush(_controller) { - bar?.end(); + bar?.stop(); }, cancel() { - bar?.end(); + bar?.stop(); }, }); } diff --git a/cli/unstable_progress_bar_test.ts b/cli/unstable_progress_bar_test.ts index eac413eb82a7..4a86d8bdf28d 100644 --- a/cli/unstable_progress_bar_test.ts +++ b/cli/unstable_progress_bar_test.ts @@ -18,7 +18,7 @@ Deno.test("ProgressBar() outputs default result", async () => { const bar = new ProgressBar(writable, { max: 10 * 1000 }); for await (const a of getData(10, 1000)) bar.add(a.length); - bar.end().then(() => writable.close()); + bar.stop().then(() => writable.close()); for await (const buffer of readable) { if (buffer.length == 1) { @@ -67,7 +67,7 @@ Deno.test("ProgressBar() can handle a readable.cancel() correctly", async () => const bar = new ProgressBar(writable, { max: 10 * 1000 }); for await (const a of getData(10, 1000)) bar.add(a.length); - bar.end(); + bar.stop(); await readable.cancel(); }); @@ -80,7 +80,7 @@ Deno.test("ProgressBar() can remove itself when finished", async () => { }); for await (const a of getData(10, 1000)) bar.add(a.length); - bar.end() + bar.stop() .then(() => writable.close()); for await (const buffer of readable) { @@ -105,7 +105,7 @@ Deno.test("ProgressBar() passes correct values to formatter", async () => { }); for await (const a of getData(10, 1000)) bar.add(a.length); - bar.end(); + bar.stop(); await new Response(readable).bytes(); }); @@ -125,6 +125,6 @@ Deno.test("ProgressBar() uses correct unit type", async () => { assertEquals(decoder.decode(buffer.subarray(-5, -2)), unit); break; } - bar.end(); + bar.stop(); } });