Skip to content

@std/cli/unstable_spinner.ts has flaky test #6385

Closed
@BlackAsLight

Description

@BlackAsLight

https://github.com/denoland/std/actions/runs/13148545139/job/36691645547

ERRORS 

Spinner constructor accepts interval => ./cli/unstable_spinner_test.ts:136:6
error: AssertionError: Values are not equal.


    [Diff] Actual / Expected


    [
      "\r\x1b[K⠋\x1b[0m ",
      "\r\x1b[K⠙\x1b[0m ",
      "\r\x1b[K⠹\x1b[0m ",
-     "\r\x1b[K⠸\x1b[0m ",
      "\r\x1b[K",
    ]

  throw new AssertionError(message);
        ^
    at assertEquals (file:///D:/a/std/std/assert/equals.ts:64:9)
    at file:///D:/a/std/std/cli/unstable_spinner_test.ts:163:5

 FAILURES 

Spinner constructor accepts interval => ./cli/unstable_spinner_test.ts:136:6

FAILED | 3088 passed (2720 steps) | 1 failed | 22 ignored (1m31s)

error: Test failed
Error: Process completed with exit code 1.

Deno.test("Spinner constructor accepts interval", async () => {
try {
stub(Deno.stdin, "setRaw");
const expectedOutput = [
"\r\x1b[K⠋\x1b[0m ",
"\r\x1b[K⠙\x1b[0m ",
"\r\x1b[K⠹\x1b[0m ",
"\r\x1b[K",
];
const actualOutput: string[] = [];
stub(
Deno.stdout,
"writeSync",
(data: Uint8Array) => {
const output = decoder.decode(data);
actualOutput.push(output);
return data.length;
},
);
const spinner = new Spinner({ interval: 300 });
spinner.start();
await delay(1000); // 100ms buffer
spinner.stop();
assertEquals(actualOutput, expectedOutput);
} finally {
restore();
}
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions