Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

chore: output both received value and diff for string expected results (#1287)

Andrey Lushnikov3dc48f96c075
diff --git a/utils/testrunner/Matchers.js b/utils/testrunner/Matchers.js
index b9273ca509..9d2bb30d44 100644
--- a/utils/testrunner/Matchers.js
+++ b/utils/testrunner/Matchers.js
@@ -83,11 +83,12 @@ function stringFormatter(received, expected) {
}).join('');
const output = [
`Expected: ${expected}`,
- `Received: ${highlighted}`,
+ `Received: ${received}`,
+ ` Diff: ${highlighted}`,
];
for (let i = 0; i < Math.min(expected.length, received.length); ++i) {
if (expected[i] !== received[i]) {
- const padding = ' '.repeat('Expected: '.length);
+ const padding = ' '.repeat(' Diff: '.length);
const firstDiffCharacter = '~'.repeat(i) + '^';
output.push(colors.red(padding + firstDiffCharacter));
break;