test: add tests for get-used-version task

This commit is contained in:
Karl-Philipp Wulfert
2019-07-05 15:25:06 +02:00
parent 067a2011c0
commit 92c9604f8d
4 changed files with 1831 additions and 2 deletions

View File

@@ -53,6 +53,7 @@ export async function getUsedVersion(path: PathLike, dependency: string): Promis
export async function getUsedVersionMajorMinor(path: PathLike, dependency: string): Promise<string> {
const versionMatch = (await getUsedVersion(path, dependency)).match(/([0-9]+\.[0-9]+)\.[0-9]+/);
// istanbul ignore if
if (versionMatch === null) {
throw new Error(`Used version of '${dependency}' of project in '${path}' could not be determined.`);
}