UNPKG

e2ed

Version:

E2E testing framework over Playwright

22 lines (21 loc) 731 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.assertValueIsDefined = assertValueIsDefined; exports.assertValueIsUndefined = assertValueIsUndefined; const error_1 = require("../error"); /** * Asserts that the value is defined (is not `undefined`). */ function assertValueIsDefined(value, check, payload) { if (value === undefined) { throw new error_1.E2edError('Asserted value is not defined', { check, payload }); } } /** * Asserts that the value is `undefined` (is not defined). */ function assertValueIsUndefined(value, check, payload) { if (value !== undefined) { throw new error_1.E2edError('Asserted value is defined', { check, payload, value }); } }