UNPKG

e2ed

Version:

E2E testing framework over Playwright

21 lines (20 loc) 619 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.assertValueHasProperty = assertValueHasProperty; const error_1 = require("../error"); /** * Asserts that the value has concrete property (maybe not own). */ function assertValueHasProperty(value, property, options) { const { check, payload, skipCheckInRuntime } = options; if (skipCheckInRuntime) { return; } if (!(property in value)) { throw new error_1.E2edError(`Asserted value has no property ${String(property)}`, { check, payload, value, }); } }