UNPKG

@opra/testing

Version:
29 lines (28 loc) 994 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ApiExpectOperationResult = void 0; require("../expect-extend/index.js"); const api_expect_base_js_1 = require("./api-expect-base.js"); class ApiExpectOperationResult extends api_expect_base_js_1.ApiExpectBase { get not() { return new ApiExpectOperationResult(this.response, !this.isNot); } toBeAffected(min, max) { let msg = ''; try { msg += `The value of "affected" do not match. `; const l = this.response.body.affected; this._expect(l).toBeGreaterThanOrEqual(min || 1); if (max) this._expect(l).toBeLessThanOrEqual(max); } catch (e) { if (msg) e.message = msg + '\n\n' + e.message; Error.captureStackTrace(e, this.toBeAffected); throw e; } return this; } } exports.ApiExpectOperationResult = ApiExpectOperationResult;