Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
BlackAsLight opened this issue Feb 5, 2025 · 0 comments
Open

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

BlackAsLight opened this issue Feb 5, 2025 · 0 comments

Comments

@BlackAsLight
Copy link
Contributor

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();
}
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant