diff --git a/@commitlint/load/src/index.js b/@commitlint/load/src/index.js index bedf967d61..d7ced045e4 100644 --- a/@commitlint/load/src/index.js +++ b/@commitlint/load/src/index.js @@ -4,6 +4,7 @@ import resolveExtends from '@commitlint/resolve-extends'; import cosmiconfig from 'cosmiconfig'; import {toPairs, merge, mergeWith, pick} from 'lodash'; import resolveFrom from 'resolve-from'; +// Import chalk from 'chalk'; const w = (a, b) => (Array.isArray(b) ? b : undefined); const valid = input => @@ -96,6 +97,13 @@ async function loadConfig(cwd, configPath) { if (local) { return local; } + // Because local is `null` + // throw new Error(`123`); + + console.log('NEIN DER ZWERG DAS IST JA OTTO'); + + // This does not show up in tests + // chalk.yellow(`⚠ ${chalk.bold('config file')} may not be empty.`); return {}; } diff --git a/@commitlint/load/src/index.serial-test.js b/@commitlint/load/src/index.serial-test.js index 43f499ca66..5a6525b687 100644 --- a/@commitlint/load/src/index.serial-test.js +++ b/@commitlint/load/src/index.serial-test.js @@ -17,3 +17,19 @@ test.serial('default cwd option to process.cwd()', async t => { process.chdir(before); } }); + +// Test.serial('empty cwd option to process.cwd() should throw error message', async t => { +// const cwd = await fix.bootstrap('fixtures/empty-file'); +// const before = process.cwd(); +// process.chdir(cwd); + +// try { +// const actual = await load(); +// } catch (err) { +// console.log('-------------------------') +// // t.true(err.includes('OTTO')); +// // throw err; +// } finally { +// process.chdir(before); +// } +// });