mirror of
https://github.com/expo/explore.git
synced 2026-11-13 20:38:07 -10:00
Co-authored-by: Brent Vatne <[email protected]> Co-authored-by: Szymon Dziedzic <[email protected]>
16 lines
587 B
JavaScript
16 lines
587 B
JavaScript
import assert from "node:assert/strict";
|
|
import test from "node:test";
|
|
import { tsImport } from "tsx/esm/api";
|
|
|
|
const { stderrProgress } = await tsImport("../../src/shared/progress.ts", import.meta.url);
|
|
|
|
test("progress lines carry the elapsed time since the first line was possible", () => {
|
|
let now = 1_000;
|
|
const written = [];
|
|
const progress = stderrProgress({ now: () => now, write: text => written.push(text) });
|
|
progress("planning");
|
|
now += 125_000;
|
|
progress("capturing");
|
|
assert.deepEqual(written, ["[explore 00:00] planning\n", "[explore 02:05] capturing\n"]);
|
|
});
|