@opra/testing 1.12.3 → 1.12.4

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.
@@ -6,6 +6,7 @@ const tslib_1 = require("tslib");
6
6
  const type_is_1 = tslib_1.__importDefault(require("@browsery/type-is"));
7
7
  const objects_1 = require("@jsopen/objects");
8
8
  const common_1 = require("@opra/common");
9
+ const expect_1 = require("expect");
9
10
  const rule_judgment_1 = tslib_1.__importDefault(require("rule-judgment"));
10
11
  const api_expect_base_js_1 = require("./api-expect-base.js");
11
12
  const ruleJudgment = typeof rule_judgment_1.default === 'object'
@@ -96,7 +97,7 @@ class ApiExpectCollection extends api_expect_base_js_1.ApiExpectBase {
96
97
  ? this.response.body.payload
97
98
  : this.response.body;
98
99
  for (const item of data) {
99
- this._expect(Object.keys(item)).toEqual(expect.arrayContaining(fields));
100
+ this._expect(Object.keys(item)).toEqual(expect_1.expect.arrayContaining(fields));
100
101
  }
101
102
  }
102
103
  catch (e) {
@@ -173,7 +174,7 @@ class ApiExpectCollection extends api_expect_base_js_1.ApiExpectBase {
173
174
  }
174
175
  }
175
176
  exports.ApiExpectCollection = ApiExpectCollection;
176
- expect.extend({
177
+ expect_1.expect.extend({
177
178
  opraCollectionToBeSortedBy(received, properties) {
178
179
  const fieldsMap = properties.map(x => x.split('.'));
179
180
  const getValue = (obj, fieldMap) => {
@@ -200,7 +201,7 @@ expect.extend({
200
201
  return 0;
201
202
  });
202
203
  try {
203
- expect(received).toEqual(sorted);
204
+ (0, expect_1.expect)(received).toEqual(sorted);
204
205
  }
205
206
  catch {
206
207
  pass = false;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ApiExpectError = void 0;
4
4
  require("../jest-extend/index.js");
5
5
  const objects_1 = require("@jsopen/objects");
6
+ const expect_1 = require("expect");
6
7
  const api_expect_base_js_1 = require("./api-expect-base.js");
7
8
  class ApiExpectError extends api_expect_base_js_1.ApiExpectBase {
8
9
  toMatch(expected) {
@@ -11,12 +12,12 @@ class ApiExpectError extends api_expect_base_js_1.ApiExpectBase {
11
12
  expected = { message: expected };
12
13
  else if (expected instanceof RegExp) {
13
14
  expected = {
14
- message: expect.stringMatching(expected),
15
+ message: expect_1.expect.stringMatching(expected),
15
16
  };
16
17
  }
17
18
  else
18
19
  expected = (0, objects_1.omitNullish)(expected);
19
- this._expect(this.response.body.errors).toEqual(expect.arrayContaining([expect.objectContaining(expected)]));
20
+ this._expect(this.response.body.errors).toEqual(expect_1.expect.arrayContaining([expect_1.expect.objectContaining(expected)]));
20
21
  }
21
22
  catch (e) {
22
23
  Error.captureStackTrace(e, this.toMatch);
@@ -2,8 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const ansi_colors_1 = tslib_1.__importDefault(require("ansi-colors"));
5
+ const expect_1 = require("expect");
5
6
  const jest_matcher_utils_1 = require("jest-matcher-utils");
6
- expect.extend({
7
+ expect_1.expect.extend({
7
8
  toHaveFields(received, expected) {
8
9
  const expectedKeys = (Array.isArray(expected) ? expected : Object.keys(expected)).map(x => x.toLowerCase());
9
10
  const objectKeys = Object.keys(received).map(x => x.toLowerCase());
@@ -1,6 +1,7 @@
1
1
  import typeIs from '@browsery/type-is';
2
2
  import { omitNullish } from '@jsopen/objects';
3
3
  import { MimeTypes, OpraFilter } from '@opra/common';
4
+ import { expect } from 'expect';
4
5
  import ruleJudgmentLib from 'rule-judgment';
5
6
  import { ApiExpectBase } from './api-expect-base.js';
6
7
  const ruleJudgment = typeof ruleJudgmentLib === 'object'
@@ -1,5 +1,6 @@
1
1
  import '../jest-extend/index.js';
2
2
  import { omitNullish } from '@jsopen/objects';
3
+ import { expect } from 'expect';
3
4
  import { ApiExpectBase } from './api-expect-base.js';
4
5
  export class ApiExpectError extends ApiExpectBase {
5
6
  toMatch(expected) {
@@ -1,4 +1,5 @@
1
1
  import colors from 'ansi-colors';
2
+ import { expect } from 'expect';
2
3
  import { matcherHint, printExpected, printReceived, } from 'jest-matcher-utils';
3
4
  expect.extend({
4
5
  toHaveFields(received, expected) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opra/testing",
3
- "version": "1.12.3",
3
+ "version": "1.12.4",
4
4
  "description": "Opra testing package",
5
5
  "author": "Panates",
6
6
  "license": "MIT",
@@ -8,13 +8,14 @@
8
8
  "@browsery/type-is": "^1.6.18-r8",
9
9
  "@jsopen/objects": "^1.5.2",
10
10
  "ansi-colors": "^4.1.3",
11
- "jest-matcher-utils": "^29.7.0",
12
11
  "rule-judgment": "^1.1.5",
13
12
  "tslib": "^2.8.1"
14
13
  },
15
14
  "peerDependencies": {
16
- "@opra/client": "^1.12.3",
17
- "@opra/common": "^1.12.3"
15
+ "@opra/client": "^1.12.4",
16
+ "@opra/common": "^1.12.4",
17
+ "expect": "^29.0.0 || ^30.0.0",
18
+ "jest-matcher-utils": "^29.0.0 || ^30.0.0"
18
19
  },
19
20
  "type": "module",
20
21
  "exports": {