@opra/testing 0.7.0 → 0.8.0
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 +0 -2
- package/cjs/api-expect/api-expect-error.js +0 -1
- package/cjs/api-expect/api-expect-object.js +0 -2
- package/cjs/api-expect/api-expect-operation-result.js +0 -2
- package/cjs/api-expect/api-expect.js +0 -2
- package/cjs/test-client.js +2 -3
- package/esm/api-expect/api-expect-collection.d.ts +1 -1
- package/esm/api-expect/api-expect-collection.js +0 -2
- package/esm/api-expect/api-expect-error.d.ts +1 -1
- package/esm/api-expect/api-expect-error.js +0 -1
- package/esm/api-expect/api-expect-object.d.ts +1 -1
- package/esm/api-expect/api-expect-object.js +0 -2
- package/esm/api-expect/api-expect-operation-result.d.ts +1 -1
- package/esm/api-expect/api-expect-operation-result.js +0 -2
- package/esm/api-expect/api-expect.d.ts +1 -1
- package/esm/api-expect/api-expect.js +0 -2
- package/esm/test-client.d.ts +1 -1
- package/esm/test-client.js +1 -2
- package/package.json +4 -6
|
@@ -6,8 +6,6 @@ const lodash_1 = require("lodash");
|
|
|
6
6
|
const rule_judgment_1 = tslib_1.__importDefault(require("rule-judgment"));
|
|
7
7
|
const common_1 = require("@opra/common");
|
|
8
8
|
class ApiExpectCollection {
|
|
9
|
-
response;
|
|
10
|
-
_isNot;
|
|
11
9
|
constructor(response, _isNot = false) {
|
|
12
10
|
this.response = response;
|
|
13
11
|
this._isNot = _isNot;
|
|
@@ -6,7 +6,6 @@ const jest_matcher_utils_1 = tslib_1.__importDefault(require("jest-matcher-utils
|
|
|
6
6
|
const object_matches_util_js_1 = require("../utils/object-matches.util.js");
|
|
7
7
|
const api_expect_object_js_1 = require("./api-expect-object.js");
|
|
8
8
|
class ApiExpectError extends api_expect_object_js_1.ApiExpectObject {
|
|
9
|
-
response;
|
|
10
9
|
constructor(response) {
|
|
11
10
|
super(response);
|
|
12
11
|
this.response = response;
|
|
@@ -3,8 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ApiExpectObject = void 0;
|
|
4
4
|
const lodash_1 = require("lodash");
|
|
5
5
|
class ApiExpectObject {
|
|
6
|
-
response;
|
|
7
|
-
_isNot;
|
|
8
6
|
constructor(response, _isNot = false) {
|
|
9
7
|
this.response = response;
|
|
10
8
|
this._isNot = _isNot;
|
|
@@ -6,8 +6,6 @@ const api_expect_error_js_1 = require("./api-expect-error.js");
|
|
|
6
6
|
const api_expect_object_js_1 = require("./api-expect-object.js");
|
|
7
7
|
const api_expect_operation_result_js_1 = require("./api-expect-operation-result.js");
|
|
8
8
|
class ApiExpect {
|
|
9
|
-
response;
|
|
10
|
-
_isNot;
|
|
11
9
|
constructor(response, _isNot = false) {
|
|
12
10
|
this.response = response;
|
|
13
11
|
this._isNot = _isNot;
|
package/cjs/test-client.js
CHANGED
|
@@ -3,12 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.OpraTestClient = void 0;
|
|
4
4
|
const http_1 = require("http");
|
|
5
5
|
const url_1 = require("url");
|
|
6
|
-
const client_1 = require("@opra/client");
|
|
7
6
|
const common_1 = require("@opra/common");
|
|
7
|
+
const node_client_1 = require("@opra/node-client");
|
|
8
8
|
const api_expect_js_1 = require("./api-expect/api-expect.js");
|
|
9
9
|
const is_absolute_url_util_js_1 = require("./utils/is-absolute-url.util.js");
|
|
10
|
-
class OpraTestClient extends
|
|
11
|
-
_server;
|
|
10
|
+
class OpraTestClient extends node_client_1.OpraHttpClient {
|
|
12
11
|
constructor(app, options) {
|
|
13
12
|
super('/', options);
|
|
14
13
|
this._server = app instanceof http_1.Server ? app : (0, http_1.createServer)(app);
|
|
@@ -2,8 +2,6 @@ import { isNil, omitBy } from 'lodash';
|
|
|
2
2
|
import ruleJudgment from 'rule-judgment';
|
|
3
3
|
import { ArrayExpression, BooleanLiteral, ComparisonExpression, DateLiteral, LogicalExpression, NullLiteral, NumberLiteral, ParenthesesExpression, parseFilter, QualifiedIdentifier, StringLiteral, TimeLiteral } from '@opra/common';
|
|
4
4
|
export class ApiExpectCollection {
|
|
5
|
-
response;
|
|
6
|
-
_isNot;
|
|
7
5
|
constructor(response, _isNot = false) {
|
|
8
6
|
this.response = response;
|
|
9
7
|
this._isNot = _isNot;
|
|
@@ -2,7 +2,6 @@ import matcherUtils from 'jest-matcher-utils';
|
|
|
2
2
|
import { objectMatches } from '../utils/object-matches.util.js';
|
|
3
3
|
import { ApiExpectObject } from './api-expect-object.js';
|
|
4
4
|
export class ApiExpectError extends ApiExpectObject {
|
|
5
|
-
response;
|
|
6
5
|
constructor(response) {
|
|
7
6
|
super(response);
|
|
8
7
|
this.response = response;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HttpResponse } from '@opra/client';
|
|
1
|
+
import { HttpResponse } from '@opra/node-client';
|
|
2
2
|
import { ApiExpectCollection } from './api-expect-collection.js';
|
|
3
3
|
import { ApiExpectError } from './api-expect-error.js';
|
|
4
4
|
import { ApiExpectObject } from './api-expect-object.js';
|
|
@@ -3,8 +3,6 @@ import { ApiExpectError } from './api-expect-error.js';
|
|
|
3
3
|
import { ApiExpectObject } from './api-expect-object.js';
|
|
4
4
|
import { ApiExpectOperationResult } from './api-expect-operation-result.js';
|
|
5
5
|
export class ApiExpect {
|
|
6
|
-
response;
|
|
7
|
-
_isNot;
|
|
8
6
|
constructor(response, _isNot = false) {
|
|
9
7
|
this.response = response;
|
|
10
8
|
this._isNot = _isNot;
|
package/esm/test-client.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { IncomingMessage, Server, ServerResponse } from 'http';
|
|
3
3
|
import { Type } from 'ts-gems';
|
|
4
|
-
import { BatchRequest, HttpCollectionService, HttpRequest, HttpResponse, HttpSingletonService, OpraHttpClient, OpraHttpClientOptions } from '@opra/client';
|
|
4
|
+
import { BatchRequest, HttpCollectionService, HttpRequest, HttpResponse, HttpSingletonService, OpraHttpClient, OpraHttpClientOptions } from '@opra/node-client';
|
|
5
5
|
import { ApiExpect } from './api-expect/api-expect.js';
|
|
6
6
|
declare type RequestListener = (req: IncomingMessage, res: ServerResponse) => void;
|
|
7
7
|
declare type Handler = RequestListener | Server;
|
package/esm/test-client.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { createServer, Server } from 'http';
|
|
2
2
|
import { URL } from 'url';
|
|
3
|
-
import { OpraHttpClient, } from '@opra/client';
|
|
4
3
|
import { joinPath } from '@opra/common';
|
|
4
|
+
import { OpraHttpClient, } from '@opra/node-client';
|
|
5
5
|
import { ApiExpect } from './api-expect/api-expect.js';
|
|
6
6
|
import { isAbsoluteUrl } from './utils/is-absolute-url.util.js';
|
|
7
7
|
export class OpraTestClient extends OpraHttpClient {
|
|
8
|
-
_server;
|
|
9
8
|
constructor(app, options) {
|
|
10
9
|
super('/', options);
|
|
11
10
|
this._server = app instanceof Server ? app : createServer(app);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opra/testing",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Opra testing package",
|
|
5
5
|
"author": "Panates",
|
|
6
6
|
"license": "MIT",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"clean:cover": "rimraf ../../coverage/testing"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@opra/client": "^0.
|
|
29
|
-
"@opra/common": "^0.
|
|
28
|
+
"@opra/node-client": "^0.8.0",
|
|
29
|
+
"@opra/common": "^0.8.0",
|
|
30
30
|
"ansi-colors": "^4.1.3",
|
|
31
31
|
"lodash": "^4.17.21",
|
|
32
32
|
"rule-judgment": "^1.1.5"
|
|
@@ -34,9 +34,7 @@
|
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/supertest": "^2.0.12"
|
|
36
36
|
},
|
|
37
|
-
"peerDependencies": {
|
|
38
|
-
"axios": "^1.2.1"
|
|
39
|
-
},
|
|
37
|
+
"peerDependencies": {},
|
|
40
38
|
"type": "module",
|
|
41
39
|
"types": "esm/index.d.ts",
|
|
42
40
|
"exports": {
|