Files
mergify/lib/utils/checkConfigExists/index.spec.js
Julien Lengrand-Lambert ab34bc5560 Replace console with logger
2018-04-23 14:50:57 +02:00

27 lines
680 B
JavaScript

const { checkConfigExists } = require('./index.js');
const mock = require('mock-fs');
describe('utils/checkConfigExists', () => {
it('should return true when checking an existing config', async() => {
const configPath = `${__dirname}/../../../.config`;
mock({
[configPath]: ''
});
const fileExists = await checkConfigExists();
return expect(fileExists).toEqual(true);
});
it('should return false when not configured', async() => {
mock({
});
const fileExists = await checkConfigExists();
return expect(fileExists).toEqual(false);
});
afterEach(mock.restore);
});