mirror of
https://github.com/oven-sh/bun
synced 2026-02-16 05:42:43 +00:00
19 lines
678 B
TypeScript
19 lines
678 B
TypeScript
// @known-failing-on-windows: 1 failing
|
|
import { file, spawn } from "bun";
|
|
import { expect, it } from "bun:test";
|
|
import { bunExe, bunEnv } from "harness";
|
|
|
|
it("should log to console correctly", async () => {
|
|
const { stderr, exited } = spawn({
|
|
cmd: [bunExe(), import.meta.dir + "/console-timeLog.js"],
|
|
stdin: null,
|
|
stdout: "pipe",
|
|
stderr: "pipe",
|
|
env: bunEnv,
|
|
});
|
|
expect(await exited).toBe(0);
|
|
const outText = await new Response(stderr).text();
|
|
const expectedText = await new Response(file(import.meta.dir + "/console-timeLog.expected.txt")).text();
|
|
expect(outText.replace(/^\[.+?s\] /gm, "")).toBe(expectedText.replace(/^\[.+?s\] /gm, ""));
|
|
});
|