@opra/testing 1.2.1 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/api-expect/api-expect-collection.js +2 -1
- package/cjs/api-expect/api-expect-error.js +2 -2
- package/cjs/api-expect/api-expect-object.js +2 -1
- package/esm/api-expect/api-expect-collection.js +2 -1
- package/esm/api-expect/api-expect-error.js +1 -1
- package/esm/api-expect/api-expect-object.js +2 -1
- package/package.json +4 -3
|
@@ -4,6 +4,7 @@ exports.ApiExpectCollection = void 0;
|
|
|
4
4
|
exports.convertFilter = convertFilter;
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
6
|
const type_is_1 = tslib_1.__importDefault(require("@browsery/type-is"));
|
|
7
|
+
const objects_1 = require("@jsopen/objects");
|
|
7
8
|
const common_1 = require("@opra/common");
|
|
8
9
|
const rule_judgment_1 = tslib_1.__importDefault(require("rule-judgment"));
|
|
9
10
|
const api_expect_base_js_1 = require("./api-expect-base.js");
|
|
@@ -63,7 +64,7 @@ class ApiExpectCollection extends api_expect_base_js_1.ApiExpectBase {
|
|
|
63
64
|
*/
|
|
64
65
|
toMatch(expected) {
|
|
65
66
|
try {
|
|
66
|
-
expected = (0,
|
|
67
|
+
expected = (0, objects_1.omitNullish)(expected);
|
|
67
68
|
const data = type_is_1.default.is(this.response.contentType, [common_1.MimeTypes.opra_response_json])
|
|
68
69
|
? this.response.body.payload
|
|
69
70
|
: this.response.body;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ApiExpectError = void 0;
|
|
4
4
|
require("../jest-extend/index.js");
|
|
5
|
-
const
|
|
5
|
+
const objects_1 = require("@jsopen/objects");
|
|
6
6
|
const api_expect_base_js_1 = require("./api-expect-base.js");
|
|
7
7
|
class ApiExpectError extends api_expect_base_js_1.ApiExpectBase {
|
|
8
8
|
toMatch(expected) {
|
|
@@ -13,7 +13,7 @@ class ApiExpectError extends api_expect_base_js_1.ApiExpectBase {
|
|
|
13
13
|
expected = { message: expect.stringMatching(expected) };
|
|
14
14
|
}
|
|
15
15
|
else
|
|
16
|
-
expected = (0,
|
|
16
|
+
expected = (0, objects_1.omitNullish)(expected);
|
|
17
17
|
this._expect(this.response.body.errors).toEqual(expect.arrayContaining([expect.objectContaining(expected)]));
|
|
18
18
|
}
|
|
19
19
|
catch (e) {
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ApiExpectObject = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const type_is_1 = tslib_1.__importDefault(require("@browsery/type-is"));
|
|
6
|
+
const objects_1 = require("@jsopen/objects");
|
|
6
7
|
const common_1 = require("@opra/common");
|
|
7
8
|
const api_expect_base_js_1 = require("./api-expect-base.js");
|
|
8
9
|
class ApiExpectObject extends api_expect_base_js_1.ApiExpectBase {
|
|
@@ -15,7 +16,7 @@ class ApiExpectObject extends api_expect_base_js_1.ApiExpectBase {
|
|
|
15
16
|
*/
|
|
16
17
|
toMatch(expected) {
|
|
17
18
|
try {
|
|
18
|
-
expected = (0,
|
|
19
|
+
expected = (0, objects_1.omitNullish)(expected);
|
|
19
20
|
const data = type_is_1.default.is(this.response.contentType, [common_1.MimeTypes.opra_response_json])
|
|
20
21
|
? this.response.body.payload
|
|
21
22
|
: this.response.body;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import typeIs from '@browsery/type-is';
|
|
2
|
-
import {
|
|
2
|
+
import { omitNullish } from '@jsopen/objects';
|
|
3
|
+
import { MimeTypes, OpraFilter } from '@opra/common';
|
|
3
4
|
import ruleJudgmentLib from 'rule-judgment';
|
|
4
5
|
import { ApiExpectBase } from './api-expect-base.js';
|
|
5
6
|
// @ts-ignore
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import typeIs from '@browsery/type-is';
|
|
2
|
-
import {
|
|
2
|
+
import { omitNullish } from '@jsopen/objects';
|
|
3
|
+
import { MimeTypes } from '@opra/common';
|
|
3
4
|
import { ApiExpectBase } from './api-expect-base.js';
|
|
4
5
|
export class ApiExpectObject extends ApiExpectBase {
|
|
5
6
|
get not() {
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opra/testing",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.3",
|
|
4
4
|
"description": "Opra testing package",
|
|
5
5
|
"author": "Panates",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@browsery/type-is": "^1.6.18-r5",
|
|
9
|
-
"@
|
|
10
|
-
"@opra/
|
|
9
|
+
"@jsopen/objects": "^1.5.0",
|
|
10
|
+
"@opra/client": "^1.2.3",
|
|
11
|
+
"@opra/common": "^1.2.3",
|
|
11
12
|
"ansi-colors": "^4.1.3",
|
|
12
13
|
"jest-matcher-utils": "^29.7.0",
|
|
13
14
|
"rule-judgment": "^1.1.5",
|