Skip to content

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

chore: ensure assertions result in a message (#7981)

Max Schmitt4e8e75beb14f
diff --git a/src/utils/utils.ts b/src/utils/utils.ts
index 3fe12549f9..1fbecfa48b 100644
--- a/src/utils/utils.ts
+++ b/src/utils/utils.ts
@@ -186,7 +186,7 @@ export function makeWaitForNextTask() {
export function assert(value: any, message?: string): asserts value {
if (!value)
- throw new Error(message);
+ throw new Error(message || 'Assertion error');
}
export function debugAssert(value: any, message?: string): asserts value {