@mtcute/test 0.22.0 → 0.24.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/client.js CHANGED
@@ -13,7 +13,7 @@ class StubTelegramClient extends BaseTelegramClient {
13
13
  super({
14
14
  apiId: 0,
15
15
  apiHash: "",
16
- logLevel: 9,
16
+ logLevel: 0,
17
17
  storage,
18
18
  disableUpdates: true,
19
19
  transport: new StubTelegramTransport({
@@ -211,7 +211,7 @@ class StubTelegramClient extends BaseTelegramClient {
211
211
  } catch (e) {
212
212
  error = e;
213
213
  }
214
- await this.close();
214
+ await this.destroy();
215
215
  this.onError.remove(handler);
216
216
  if (error) {
217
217
  throw error;
package/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "@mtcute/test",
3
3
  "type": "module",
4
- "version": "0.22.0",
4
+ "version": "0.24.0",
5
5
  "description": "Test utilities for mtcute",
6
6
  "license": "MIT",
7
7
  "dependencies": {
8
8
  "long": "5.2.3",
9
- "@fuman/utils": "0.0.4",
10
- "@fuman/net": "0.0.9"
9
+ "@fuman/utils": "0.0.14",
10
+ "@fuman/net": "0.0.14"
11
11
  },
12
12
  "peerDependencies": {
13
- "@mtcute/core": "^0.22.0",
14
- "@mtcute/node": "^0.22.0",
15
- "@mtcute/tl": "200.0.0",
16
- "@mtcute/web": "^0.22.0",
13
+ "@mtcute/core": "^0.24.0",
14
+ "@mtcute/node": "^0.24.0",
15
+ "@mtcute/tl": "203.0.0",
16
+ "@mtcute/web": "^0.24.0",
17
17
  "vitest": "*"
18
18
  },
19
19
  "exports": {
@@ -21,10 +21,6 @@
21
21
  "import": {
22
22
  "types": "./index.d.ts",
23
23
  "default": "./index.js"
24
- },
25
- "require": {
26
- "types": "./index.d.cts",
27
- "default": "./index.cjs"
28
24
  }
29
25
  }
30
26
  },
package/transport.js CHANGED
@@ -1,5 +1,10 @@
1
1
  import { FakeConnection } from "@fuman/net";
2
2
  import { IntermediatePacketCodec } from "@mtcute/core";
3
+ class FakeConnectionFixed extends FakeConnection {
4
+ async write(data) {
5
+ await this["tx"].write(data);
6
+ }
7
+ }
3
8
  class StubTelegramTransport {
4
9
  constructor(params) {
5
10
  this.params = params;
@@ -8,7 +13,7 @@ class StubTelegramTransport {
8
13
  async connect(dc) {
9
14
  this.params.onConnect?.(dc);
10
15
  this._dcId = dc.id;
11
- return new FakeConnection(dc);
16
+ return new FakeConnectionFixed(dc);
12
17
  }
13
18
  packetCodec() {
14
19
  const inner = this.params.packetCodec?.() ?? new IntermediatePacketCodec();