From 6c65025c7de3d84cd0b7bde91a85ed12b85cdb49 Mon Sep 17 00:00:00 2001 From: Paul Merlin Date: Mon, 13 Jan 2020 10:29:20 +0100 Subject: [PATCH] Add : Signed-off-by: Paul Merlin --- __tests__/validate.test.ts | 12 ++++++------ dist/index.js | 6 +++--- src/validate.ts | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/__tests__/validate.test.ts b/__tests__/validate.test.ts index f891e75..271d246 100644 --- a/__tests__/validate.test.ts +++ b/__tests__/validate.test.ts @@ -11,7 +11,7 @@ test('succeeds if all found wrapper jars are valid', async () => { expect(result.isValid()).toBe(true) expect(result.toDisplayString()).toBe( - '✓ Found known Gradle Wrapper JAR files\n' + + '✓ Found known Gradle Wrapper JAR files:\n' + ' e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 __tests__/data/invalid/gradle-wrapper.jar\n' + ' 3888c76faa032ea8394b8a54e04ce2227ab1f4be64f65d450f8509fe112d38ce __tests__/data/valid/gradle-wrapper.jar' ) @@ -37,9 +37,9 @@ test('fails if invalid wrapper jars are found', async () => { ]) expect(result.toDisplayString()).toBe( - '✗ Found unknown Gradle Wrapper JAR files\n' + + '✗ Found unknown Gradle Wrapper JAR files:\n' + ' e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 __tests__/data/invalid/gradle-wrapper.jar\n' + - '✓ Found known Gradle Wrapper JAR files\n' + + '✓ Found known Gradle Wrapper JAR files:\n' + ' 3888c76faa032ea8394b8a54e04ce2227ab1f4be64f65d450f8509fe112d38ce __tests__/data/valid/gradle-wrapper.jar' ) }) @@ -54,11 +54,11 @@ test('fails if not enough wrapper jars are found', async () => { ]) expect(result.toDisplayString()).toBe( - '✗ Found unknown Gradle Wrapper JAR files\n' + + '✗ Found unknown Gradle Wrapper JAR files:\n' + ' e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 __tests__/data/invalid/gradle-wrapper.jar\n' + - '✗ Other validation errors\n' + + '✗ Other validation errors:\n' + ' Expected to find at least 3 Gradle Wrapper JARs but got only 2\n' + - '✓ Found known Gradle Wrapper JAR files\n' + + '✓ Found known Gradle Wrapper JAR files:\n' + ' 3888c76faa032ea8394b8a54e04ce2227ab1f4be64f65d450f8509fe112d38ce __tests__/data/valid/gradle-wrapper.jar' ) }) diff --git a/dist/index.js b/dist/index.js index 6ea81fd..11e34c0 100644 --- a/dist/index.js +++ b/dist/index.js @@ -980,17 +980,17 @@ class ValidationResult { toDisplayString() { let displayString = ''; if (this.invalid.length > 0) { - displayString += `✗ Found unknown Gradle Wrapper JAR files\n${ValidationResult.toDisplayList(this.invalid)}`; + displayString += `✗ Found unknown Gradle Wrapper JAR files:\n${ValidationResult.toDisplayList(this.invalid)}`; } if (this.errors.length > 0) { if (displayString.length > 0) displayString += '\n'; - displayString += `✗ Other validation errors\n ${this.errors.join(`\n `)}`; + displayString += `✗ Other validation errors:\n ${this.errors.join(`\n `)}`; } if (this.valid.length > 0) { if (displayString.length > 0) displayString += '\n'; - displayString += `✓ Found known Gradle Wrapper JAR files\n${ValidationResult.toDisplayList(this.valid)}`; + displayString += `✓ Found known Gradle Wrapper JAR files:\n${ValidationResult.toDisplayList(this.valid)}`; } return displayString; } diff --git a/src/validate.ts b/src/validate.ts index 45b0545..f10a771 100644 --- a/src/validate.ts +++ b/src/validate.ts @@ -47,19 +47,19 @@ export class ValidationResult { toDisplayString(): string { let displayString = '' if (this.invalid.length > 0) { - displayString += `✗ Found unknown Gradle Wrapper JAR files\n${ValidationResult.toDisplayList( + displayString += `✗ Found unknown Gradle Wrapper JAR files:\n${ValidationResult.toDisplayList( this.invalid )}` } if (this.errors.length > 0) { if (displayString.length > 0) displayString += '\n' - displayString += `✗ Other validation errors\n ${this.errors.join( + displayString += `✗ Other validation errors:\n ${this.errors.join( `\n ` )}` } if (this.valid.length > 0) { if (displayString.length > 0) displayString += '\n' - displayString += `✓ Found known Gradle Wrapper JAR files\n${ValidationResult.toDisplayList( + displayString += `✓ Found known Gradle Wrapper JAR files:\n${ValidationResult.toDisplayList( this.valid )}` }