@opra/testing 0.32.3 → 0.32.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.
@@ -2,8 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.convertFilter = exports.ApiExpectCollection = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const lodash_isnil_1 = tslib_1.__importDefault(require("lodash.isnil"));
6
- const lodash_omitby_1 = tslib_1.__importDefault(require("lodash.omitby"));
7
5
  const rule_judgment_1 = tslib_1.__importDefault(require("rule-judgment"));
8
6
  const common_1 = require("@opra/common");
9
7
  const api_expect_base_js_1 = require("./api-expect-base.js");
@@ -58,7 +56,7 @@ class ApiExpectCollection extends api_expect_base_js_1.ApiExpectBase {
58
56
  */
59
57
  toMatch(expected) {
60
58
  try {
61
- expected = (0, lodash_omitby_1.default)(expected, lodash_isnil_1.default);
59
+ expected = (0, common_1.omitNullish)(expected);
62
60
  this._expect(this.response.body.payload).toEqual(expect.arrayContaining([expect.objectContaining(expected)]));
63
61
  }
64
62
  catch (e) {
@@ -1,10 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ApiExpectError = void 0;
4
- const tslib_1 = require("tslib");
5
4
  require("../jest-extend/index.js");
6
- const lodash_isnil_1 = tslib_1.__importDefault(require("lodash.isnil"));
7
- const lodash_omitby_1 = tslib_1.__importDefault(require("lodash.omitby"));
5
+ const common_1 = require("@opra/common");
8
6
  const api_expect_base_js_1 = require("./api-expect-base.js");
9
7
  class ApiExpectError extends api_expect_base_js_1.ApiExpectBase {
10
8
  toMatch(expected) {
@@ -13,7 +11,7 @@ class ApiExpectError extends api_expect_base_js_1.ApiExpectBase {
13
11
  expected = { message: expected };
14
12
  else if (expected instanceof RegExp)
15
13
  expected = { message: expect.stringMatching(expected) };
16
- expected = (0, lodash_omitby_1.default)(expected, lodash_isnil_1.default);
14
+ expected = (0, common_1.omitNullish)(expected);
17
15
  this._expect(this.response.body.errors).toEqual(expect.arrayContaining([expect.objectContaining(expected)]));
18
16
  }
19
17
  catch (e) {
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ApiExpectObject = void 0;
4
- const tslib_1 = require("tslib");
5
- const lodash_isnil_1 = tslib_1.__importDefault(require("lodash.isnil"));
6
- const lodash_omitby_1 = tslib_1.__importDefault(require("lodash.omitby"));
4
+ const common_1 = require("@opra/common");
7
5
  const api_expect_base_js_1 = require("./api-expect-base.js");
8
6
  class ApiExpectObject extends api_expect_base_js_1.ApiExpectBase {
9
7
  get not() {
@@ -15,7 +13,7 @@ class ApiExpectObject extends api_expect_base_js_1.ApiExpectBase {
15
13
  */
16
14
  toMatch(expected) {
17
15
  try {
18
- expected = (0, lodash_omitby_1.default)(expected, lodash_isnil_1.default);
16
+ expected = (0, common_1.omitNullish)(expected);
19
17
  this._expect(this.response.body.payload).toEqual(expect.objectContaining(expected));
20
18
  }
21
19
  catch (e) {
@@ -1,7 +1,5 @@
1
- import isNil from 'lodash.isnil';
2
- import omitBy from 'lodash.omitby';
3
1
  import ruleJudgmentLib from 'rule-judgment';
4
- import { OpraFilter } from '@opra/common';
2
+ import { omitNullish, OpraFilter } from '@opra/common';
5
3
  import { ApiExpectBase } from './api-expect-base.js';
6
4
  // @ts-ignore
7
5
  const ruleJudgment = typeof ruleJudgmentLib === 'object' ? ruleJudgmentLib.default : ruleJudgmentLib;
@@ -54,7 +52,7 @@ export class ApiExpectCollection extends ApiExpectBase {
54
52
  */
55
53
  toMatch(expected) {
56
54
  try {
57
- expected = omitBy(expected, isNil);
55
+ expected = omitNullish(expected);
58
56
  this._expect(this.response.body.payload).toEqual(expect.arrayContaining([expect.objectContaining(expected)]));
59
57
  }
60
58
  catch (e) {
@@ -1,6 +1,5 @@
1
1
  import '../jest-extend/index.js';
2
- import isNil from 'lodash.isnil';
3
- import omitBy from 'lodash.omitby';
2
+ import { omitNullish } from '@opra/common';
4
3
  import { ApiExpectBase } from './api-expect-base.js';
5
4
  export class ApiExpectError extends ApiExpectBase {
6
5
  toMatch(expected) {
@@ -9,7 +8,7 @@ export class ApiExpectError extends ApiExpectBase {
9
8
  expected = { message: expected };
10
9
  else if (expected instanceof RegExp)
11
10
  expected = { message: expect.stringMatching(expected) };
12
- expected = omitBy(expected, isNil);
11
+ expected = omitNullish(expected);
13
12
  this._expect(this.response.body.errors).toEqual(expect.arrayContaining([expect.objectContaining(expected)]));
14
13
  }
15
14
  catch (e) {
@@ -1,5 +1,4 @@
1
- import isNil from 'lodash.isnil';
2
- import omitBy from 'lodash.omitby';
1
+ import { omitNullish } from '@opra/common';
3
2
  import { ApiExpectBase } from './api-expect-base.js';
4
3
  export class ApiExpectObject extends ApiExpectBase {
5
4
  get not() {
@@ -11,7 +10,7 @@ export class ApiExpectObject extends ApiExpectBase {
11
10
  */
12
11
  toMatch(expected) {
13
12
  try {
14
- expected = omitBy(expected, isNil);
13
+ expected = omitNullish(expected);
15
14
  this._expect(this.response.body.payload).toEqual(expect.objectContaining(expected));
16
15
  }
17
16
  catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opra/testing",
3
- "version": "0.32.3",
3
+ "version": "0.32.4",
4
4
  "description": "Opra testing package",
5
5
  "author": "Panates",
6
6
  "license": "MIT",
@@ -26,17 +26,11 @@
26
26
  "clean:cover": "rimraf ../../coverage/testing"
27
27
  },
28
28
  "dependencies": {
29
- "@opra/client": "^0.32.3",
30
- "@opra/common": "^0.32.3",
29
+ "@opra/client": "^0.32.4",
30
+ "@opra/common": "^0.32.4",
31
31
  "ansi-colors": "^4.1.3",
32
- "lodash.isnil": "^4.0.0",
33
- "lodash.omitby": "^4.6.0",
34
32
  "rule-judgment": "^1.1.5"
35
33
  },
36
- "devDependencies": {
37
- "@types/lodash.isnil": "^4.0.9",
38
- "@types/lodash.omitby": "^4.6.9"
39
- },
40
34
  "type": "module",
41
35
  "module": "./esm/index.js",
42
36
  "main": "./cjs/index.js",