Skip to content

Commit

Permalink
feat: improve markdown output (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisBrunner authored Oct 26, 2023
1 parent e72b5d4 commit 445cb90
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/notifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ export const createComment = async (
body: `## ${getTitle(label)}: ${result.passed ? 'Success' : 'Failure'}
${result.summary}
\`\`\`
${result.output}
\`\`\`
`,
});
};
4 changes: 2 additions & 2 deletions src/processing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ const compareTolerance = (expected: Inputs.Tolerance, result: Inputs.Tolerance):

const getSummary = (passed: boolean, expected: Inputs.Tolerance, result: Inputs.Tolerance): string => {
if (!passed) {
return `Expected tolerance '${expected}' but got '${result}' instead`;
return `Expected tolerance \`${expected}\` but got \`${result}\` instead`;
}
return `Check succeeded with tolerance '${result}' (expected '${expected}' or better)`;
return `Check succeeded with tolerance \`${result}\` (expected \`${expected}\` or better)`;
};

export const processDiff = (old: string, newPath: string, mode: Inputs.Mode, expected: Inputs.Tolerance): Result => {
Expand Down

0 comments on commit 445cb90

Please sign in to comment.