'use strict';

import isDev from '../isDev';

describe('Utils/Dev', () => {
    test('isDev returns true and calls the given callback', () => {
        const spy = jest.fn();
        expect(isDev(spy)).toBe(true);
        expect(spy).toBeCalled();
    });
    test('isDev returns false and does not call the callback', () => {
        const NODE_ENV_orig = process.env.NODE_ENV;
        process.env.NODE_ENV = 'production';
        const spy = jest.fn();
        expect(isDev(spy)).toBe(false);
        expect(spy).not.toHaveBeenCalled();
        process.env.NODE_ENV = NODE_ENV_orig;
    });
});
