@iobroker/testing 5.0.3 → 5.0.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.
@@ -13,10 +13,11 @@ export declare class DBConnection extends EventEmitter {
13
13
  /**
14
14
  * @param appName The branded name of "iobroker"
15
15
  * @param testDir The directory the integration tests are executed in
16
+ * @param logger Logger object
16
17
  */
17
18
  constructor(appName: string, testDir: string, logger: ioBroker.Logger);
18
- private testDataDir;
19
- private testControllerDir;
19
+ private readonly testDataDir;
20
+ private readonly testControllerDir;
20
21
  private _objectsServer;
21
22
  private _statesServer;
22
23
  private _objectsClient;
@@ -48,6 +48,7 @@ class DBConnection extends events_1.default {
48
48
  /**
49
49
  * @param appName The branded name of "iobroker"
50
50
  * @param testDir The directory the integration tests are executed in
51
+ * @param logger Logger object
51
52
  */
52
53
  constructor(appName, testDir, logger) {
53
54
  super();
@@ -85,11 +86,18 @@ class DBConnection extends events_1.default {
85
86
  }
86
87
  return this._statesClient.setStateAsync(...args);
87
88
  });
88
- this.delState = (...args) => {
89
+ this.delState = async (...args) => {
89
90
  if (!this._statesClient) {
90
91
  throw new Error('States DB is not running');
91
92
  }
92
- return this._statesClient.delStateAsync(...args);
93
+ await new Promise((resolve, reject) => this._statesClient.delState(args[0], (err) => {
94
+ if (err) {
95
+ reject(err);
96
+ }
97
+ else {
98
+ resolve();
99
+ }
100
+ }));
93
101
  };
94
102
  this.getObjectViewAsync = (...args) => {
95
103
  if (!this._objectsClient) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iobroker/testing",
3
- "version": "5.0.3",
3
+ "version": "5.0.4",
4
4
  "description": "Shared utilities for adapter and module testing in ioBroker",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -42,7 +42,7 @@
42
42
  "@alcalzone/release-script": "^3.8.0",
43
43
  "@alcalzone/release-script-plugin-license": "^3.7.0",
44
44
  "@iobroker/adapter-core": "^3.2.3",
45
- "@iobroker/eslint-config": "^1.0.0",
45
+ "@iobroker/eslint-config": "^2.0.1",
46
46
  "@iobroker/types": "^7.0.6",
47
47
  "@tsconfig/node16": "^16.1.3",
48
48
  "@types/chai": "^4.3.20",
@@ -50,13 +50,13 @@
50
50
  "@types/debug": "4.1.12",
51
51
  "@types/fs-extra": "^11.0.4",
52
52
  "@types/mocha": "^10.0.10",
53
- "@types/node": "^22.10.7",
54
- "@types/sinon": "^17.0.3",
53
+ "@types/node": "^22.13.13",
54
+ "@types/sinon": "^17.0.4",
55
55
  "@types/sinon-chai": "^3.2.12",
56
56
  "rimraf": "^6.0.1",
57
57
  "source-map-support": "^0.5.21",
58
58
  "ts-node": "^10.9.2",
59
- "typescript": "~5.7.3"
59
+ "typescript": "~5.8.2"
60
60
  },
61
61
  "dependencies": {
62
62
  "alcalzone-shared": "~5.0.0",
@@ -64,8 +64,8 @@
64
64
  "chai-as-promised": "^7.1.2",
65
65
  "debug": "^4.4.0",
66
66
  "fs-extra": "^11.3.0",
67
- "mocha": "^11.0.1",
68
- "sinon": "^19.0.2",
67
+ "mocha": "^11.1.0",
68
+ "sinon": "^19.0.4",
69
69
  "sinon-chai": "^3.7.0"
70
70
  }
71
71
  }