diff --git a/src/project-wide-dependency-checker.js b/src/project-wide-dependency-checker.js index 3218ad9..f8c751c 100644 --- a/src/project-wide-dependency-checker.js +++ b/src/project-wide-dependency-checker.js @@ -61,10 +61,16 @@ module.exports = class ProjectWideDependencyChecker { return true; } - let message = - customMessage || - `[ember-cli-version-checker] This project requires a single implementation version of the npm package \`${name}\`, but there're multiple. Please resolve \`${name}\` to same version:`; - + let message; + if (uniqueImplementations.size < 1) { + message = `[ember-cli-version-checker] This project requires a single implementation version of the npm package \`${name}\`, but none where found.`; + } else { + if (customMessage) { + message = customMessage; + } else { + message = `[ember-cli-version-checker] This project requires a single implementation version of the npm package \`${name}\`, but there're multiple. Please resolve \`${name}\` to same version:`; + } + } for (let root of uniqueImplementations) { message += `\n - ${name} @ ${root}`; } diff --git a/tests/index-tests.js b/tests/index-tests.js index 3c0056d..600474d 100644 --- a/tests/index-tests.js +++ b/tests/index-tests.js @@ -452,6 +452,9 @@ describe('ember-cli-version-checker', function() { }); it('#assertSingleImplementation throws correctly', function() { + assert.throws(() => { + checker.assertSingleImplementation('--no-such-addon--'); + }, /This project requires a single implementation version of the npm package `--no-such-addon--`, but none where found./); assert.throws(() => { checker.assertSingleImplementation('bar'); }, /This project requires a single implementation version of the npm package `bar`, but there're multiple. Please resolve `bar` to same version./);