mc-publish/tests/unit/utils/logging/logger.spec.ts
2023-05-16 19:40:10 +03:00

15 lines
479 B
TypeScript

import {
CONSOLE_LOGGER,
PROCESS_LOGGER,
getDefaultLogger,
} from "@/utils/logging/logger";
describe("getDefaultLogger", () => {
test("returns PROCESS_LOGGER if we are in a GitHub Actions environment", () => {
expect(getDefaultLogger({ GITHUB_ACTIONS: "true" })).toBe(PROCESS_LOGGER);
});
test("returns CONSOLE_LOGGER if we are not in a GitHub Actions environment", () => {
expect(getDefaultLogger({})).toBe(CONSOLE_LOGGER);
});
});