@nocobase/test 1.2.10-alpha → 1.2.12-alpha

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/e2e/index.mjs CHANGED
@@ -9,6 +9,7 @@ const defineConfig = (config) => {
9
9
  expect: {
10
10
  timeout: 10 * 1e3
11
11
  },
12
+ globalTimeout: 60 * 60 * 1e3,
12
13
  // Look for test files in the "tests" directory, relative to this configuration file.
13
14
  testDir: "packages",
14
15
  // Match all test files in the e2e and __e2e__ directories.
@@ -37,6 +37,7 @@ const defineConfig = /* @__PURE__ */ __name((config) => {
37
37
  expect: {
38
38
  timeout: 10 * 1e3
39
39
  },
40
+ globalTimeout: 60 * 60 * 1e3,
40
41
  // Look for test files in the "tests" directory, relative to this configuration file.
41
42
  testDir: "packages",
42
43
  // Match all test files in the e2e and __e2e__ directories.
@@ -50,6 +50,9 @@ const _BaseClient = class _BaseClient {
50
50
  }
51
51
  await this._createDB(name);
52
52
  this.createdDBs.add(name);
53
+ setTimeout(async () => {
54
+ await this.removeDB(name);
55
+ }, 3 * 60 * 1e3);
53
56
  }
54
57
  async releaseAll() {
55
58
  if (!this._client) {
@@ -62,6 +65,15 @@ const _BaseClient = class _BaseClient {
62
65
  this.createdDBs.delete(name);
63
66
  }
64
67
  }
68
+ async removeDB(name) {
69
+ if (!this._client) {
70
+ return;
71
+ }
72
+ if (this.createdDBs.has(name)) {
73
+ await this._removeDB(name);
74
+ this.createdDBs.delete(name);
75
+ }
76
+ }
65
77
  };
66
78
  __name(_BaseClient, "BaseClient");
67
79
  let BaseClient = _BaseClient;
@@ -155,7 +167,8 @@ const server = import_http.default.createServer((req, res) => {
155
167
  res.end(JSON.stringify({ error }));
156
168
  });
157
169
  } else if (trimmedPath === "release") {
158
- dbClient.releaseAll().then(() => {
170
+ const name = parsedUrl.query.name;
171
+ dbClient.removeDB(name).then(() => {
159
172
  res.writeHead(200, { "Content-Type": "application/json" });
160
173
  res.end();
161
174
  }).catch((error) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/test",
3
- "version": "1.2.10-alpha",
3
+ "version": "1.2.12-alpha",
4
4
  "main": "lib/index.js",
5
5
  "module": "./src/index.ts",
6
6
  "types": "./lib/index.d.ts",
@@ -51,7 +51,7 @@
51
51
  },
52
52
  "dependencies": {
53
53
  "@faker-js/faker": "8.1.0",
54
- "@nocobase/server": "1.2.10-alpha",
54
+ "@nocobase/server": "1.2.12-alpha",
55
55
  "@playwright/test": "^1.44.0",
56
56
  "@testing-library/jest-dom": "^6.4.2",
57
57
  "@testing-library/react": "^14.0.0",
@@ -76,5 +76,5 @@
76
76
  "vitest-dom": "^0.1.1",
77
77
  "ws": "^8.13.0"
78
78
  },
79
- "gitHead": "378bfb33c8d124ef79074e5474c1cf2199aeb8da"
79
+ "gitHead": "553231d4882496cb7f1f17fa7541899ce82a27ab"
80
80
  }