UNPKG

@serenity-js/assertions

Version:

Serenity/JS universal assertion library supporting all types of functional tests, including both web and REST API scenarios

32 lines 1.13 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.equals = void 0; const core_1 = require("@serenity-js/core"); const objects_1 = require("tiny-types/lib/objects"); /** * Produces an [expectation](https://serenity-js.org/api/core/class/Expectation/) that is met when the actual value * is equal to the resolved value of `expectedValue`. * * Note that the equality check performs comparison **by value** * using [TinyTypes `equal`](https://github.com/jan-molak/tiny-types/blob/master/src/objects/equal.ts). * * ## Ensuring that the actual value equals expected value * * ```ts * import { actorCalled } from '@serenity-js/core' * import { Ensure, equals } from '@serenity-js/assertions' * * const actual = { name: 'apples' } * const expected = { name: 'apples' } * * await actorCalled('Ester').attemptsTo( * Ensure.that(actual, equals(expected)), * ) * ``` * * @param expectedValue * * @group Expectations */ exports.equals = core_1.Expectation.define('equals', 'equal', (actual, expected) => (0, objects_1.equal)(actual, expected)); //# sourceMappingURL=equals.js.map