@tachybase/test 1.3.43 → 1.3.44
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/es/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { mockDatabase } from "@tachybase/database";
|
|
|
4
4
|
import { mockDatabase as mockDatabase2 } from "@tachybase/database";
|
|
5
5
|
import supertest from "supertest";
|
|
6
6
|
import { default as default2 } from "supertest";
|
|
7
|
-
import { Application, Gateway, AppSupervisor, PluginManager } from "@
|
|
7
|
+
import { Application, Gateway, AppSupervisor, PluginManager } from "@tego/core";
|
|
8
8
|
import jwt from "jsonwebtoken";
|
|
9
9
|
import qs from "qs";
|
|
10
10
|
class MockServer extends Application {
|
package/lib/server/mockServer.js
CHANGED
|
@@ -36,11 +36,11 @@ __export(mockServer_exports, {
|
|
|
36
36
|
});
|
|
37
37
|
module.exports = __toCommonJS(mockServer_exports);
|
|
38
38
|
var import_database = require("@tachybase/database");
|
|
39
|
-
var
|
|
39
|
+
var import_core = require("@tego/core");
|
|
40
40
|
var import_jsonwebtoken = __toESM(require("jsonwebtoken"));
|
|
41
41
|
var import_qs = __toESM(require("qs"));
|
|
42
42
|
var import_supertest = __toESM(require("supertest"));
|
|
43
|
-
const _MockServer = class _MockServer extends
|
|
43
|
+
const _MockServer = class _MockServer extends import_core.Application {
|
|
44
44
|
async loadAndInstall(options = {}) {
|
|
45
45
|
await this.load({ method: "install" });
|
|
46
46
|
if (options.afterLoad) {
|
|
@@ -68,8 +68,8 @@ const _MockServer = class _MockServer extends import_server.Application {
|
|
|
68
68
|
}
|
|
69
69
|
async destroy(options = {}) {
|
|
70
70
|
await super.destroy(options);
|
|
71
|
-
|
|
72
|
-
await
|
|
71
|
+
import_core.Gateway.getInstance().destroy();
|
|
72
|
+
await import_core.AppSupervisor.getInstance().destroy();
|
|
73
73
|
}
|
|
74
74
|
agent() {
|
|
75
75
|
const agent = import_supertest.default.agent(this.callback());
|
|
@@ -159,14 +159,14 @@ function mockServer(options = {}) {
|
|
|
159
159
|
if (typeof TextDecoder === "undefined") {
|
|
160
160
|
global.TextDecoder = require("node:util").TextDecoder;
|
|
161
161
|
}
|
|
162
|
-
|
|
163
|
-
if (!
|
|
164
|
-
|
|
162
|
+
import_core.Gateway.getInstance().reset();
|
|
163
|
+
if (!import_core.PluginManager.findPackagePatched) {
|
|
164
|
+
import_core.PluginManager.getPackageJson = async () => {
|
|
165
165
|
return {
|
|
166
166
|
version: "0.0.0"
|
|
167
167
|
};
|
|
168
168
|
};
|
|
169
|
-
|
|
169
|
+
import_core.PluginManager.findPackagePatched = true;
|
|
170
170
|
}
|
|
171
171
|
const app = new MockServer({
|
|
172
172
|
acl: false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tachybase/test",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.44",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -64,8 +64,8 @@
|
|
|
64
64
|
"vite": "^5.4.11",
|
|
65
65
|
"vitest": "^3.2.4",
|
|
66
66
|
"ws": "^8.18.0",
|
|
67
|
-
"@tachybase/database": "1.3.
|
|
68
|
-
"@tachybase/schema": "1.3.
|
|
69
|
-
"@
|
|
67
|
+
"@tachybase/database": "1.3.44",
|
|
68
|
+
"@tachybase/schema": "1.3.44",
|
|
69
|
+
"@tego/core": "1.3.44"
|
|
70
70
|
}
|
|
71
71
|
}
|