@opra/testing 1.0.0-alpha.37 → 1.0.0-alpha.39
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/test-backend.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TestBackend = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
const node_http_1 = require("node:http");
|
|
5
6
|
const path = tslib_1.__importStar(require("node:path"));
|
|
6
7
|
const client_1 = require("@opra/client");
|
|
7
|
-
const http_1 = require("http");
|
|
8
8
|
const api_expect_js_1 = require("./api-expect/api-expect.js");
|
|
9
9
|
/**
|
|
10
10
|
*
|
|
@@ -13,7 +13,7 @@ const api_expect_js_1 = require("./api-expect/api-expect.js");
|
|
|
13
13
|
class TestBackend extends client_1.FetchBackend {
|
|
14
14
|
constructor(app, options) {
|
|
15
15
|
super(options?.basePath ? path.join('http://tempuri.org', options.basePath) : 'http://tempuri.org', options);
|
|
16
|
-
this._server = app instanceof
|
|
16
|
+
this._server = app instanceof node_http_1.Server ? app : (0, node_http_1.createServer)(app);
|
|
17
17
|
}
|
|
18
18
|
send(req) {
|
|
19
19
|
return new Promise((resolve, reject) => {
|
package/esm/test-backend.js
CHANGED
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opra/testing",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.39",
|
|
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
|
-
"@opra/client": "^1.0.0-alpha.
|
|
10
|
-
"@opra/common": "^1.0.0-alpha.
|
|
9
|
+
"@opra/client": "^1.0.0-alpha.39",
|
|
10
|
+
"@opra/common": "^1.0.0-alpha.39",
|
|
11
11
|
"ansi-colors": "^4.1.3",
|
|
12
12
|
"jest-matcher-utils": "^29.7.0",
|
|
13
13
|
"rule-judgment": "^1.1.5",
|
|
14
|
-
"tslib": "^2.
|
|
14
|
+
"tslib": "^2.7.0"
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"exports": {
|
package/types/test-backend.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { IncomingMessage, Server, ServerResponse } from 'node:http';
|
|
1
2
|
import { FetchBackend, HttpResponse } from '@opra/client';
|
|
2
|
-
import { IncomingMessage, Server, ServerResponse } from 'http';
|
|
3
3
|
import { ApiExpect } from './api-expect/api-expect.js';
|
|
4
4
|
import type { OpraTestClient } from './test-client.js';
|
|
5
5
|
declare type RequestListener = (req: IncomingMessage, res: ServerResponse) => void;
|