mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 10:58:56 +00:00
* fix console.timeLog * fix console.timeLog can log arguments * console timeLog test use bunEnv Co-authored-by: Ashcon Partovi <ashcon@partovi.net> * fix console timeLog test * Update console.timeLog Co-authored-by: dave caruso <me@paperdave.net> * Update test/js/web/console/console-timeLog.js Co-authored-by: Radhi Rasho <54078496+RadhiRasho@users.noreply.github.com> * Update console-timeLog.js * fix console-timeLog.js test * fix timeLog tests due to trailing comma PR --------- Co-authored-by: Ashcon Partovi <ashcon@partovi.net> Co-authored-by: dave caruso <me@paperdave.net> Co-authored-by: Radhi Rasho <54078496+RadhiRasho@users.noreply.github.com>
18 lines
638 B
TypeScript
18 lines
638 B
TypeScript
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, ""));
|
|
});
|