2021-11-11 11:23:49 +05:30
|
|
|
import { logHello } from '~/lib/logger/hello';
|
|
|
|
|
|
|
|
describe('~/lib/logger/hello', () => {
|
|
|
|
let consoleLogSpy;
|
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
// We don't `mockImplementation` so we can validate there's no errors thrown
|
|
|
|
consoleLogSpy = jest.spyOn(console, 'log');
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('logHello', () => {
|
2021-11-18 22:05:49 +05:30
|
|
|
describe('when on dot_com', () => {
|
|
|
|
beforeEach(() => {
|
|
|
|
gon.dot_com = true;
|
|
|
|
});
|
2021-11-11 11:23:49 +05:30
|
|
|
|
2021-11-18 22:05:49 +05:30
|
|
|
it('console logs a friendly hello message including the careers page', () => {
|
|
|
|
expect(consoleLogSpy).not.toHaveBeenCalled();
|
2021-11-11 11:23:49 +05:30
|
|
|
|
2021-11-18 22:05:49 +05:30
|
|
|
logHello();
|
|
|
|
|
|
|
|
expect(consoleLogSpy.mock.calls).toMatchSnapshot();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('when on self managed', () => {
|
|
|
|
beforeEach(() => {
|
|
|
|
gon.dot_com = false;
|
|
|
|
});
|
|
|
|
|
|
|
|
it('console logs a friendly hello message without including the careers page', () => {
|
|
|
|
expect(consoleLogSpy).not.toHaveBeenCalled();
|
|
|
|
|
|
|
|
logHello();
|
|
|
|
|
|
|
|
expect(consoleLogSpy.mock.calls).toMatchSnapshot();
|
|
|
|
});
|
2021-11-11 11:23:49 +05:30
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|