@cloudpss/fetch 0.5.42 → 0.5.43

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudpss/fetch",
3
- "version": "0.5.42",
3
+ "version": "0.5.43",
4
4
  "author": "CloudPSS",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -24,7 +24,7 @@
24
24
  }
25
25
  },
26
26
  "dependencies": {
27
- "undici": "^6.20.1"
27
+ "undici": "^6.21.0"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@types/ws": "^8.5.13"
package/src/undici.d.ts CHANGED
@@ -9,18 +9,22 @@ declare module 'undici/lib/core/symbols.js' {
9
9
  kClose,
10
10
  kDestroy,
11
11
  kDispatch,
12
- };
12
+ } as const;
13
13
  }
14
14
 
15
15
  declare module 'undici/lib/dispatcher/dispatcher-base.js' {
16
16
  import { Dispatcher } from 'undici';
17
- import { kDestroy, kClose, kDispatch } from 'undici/lib/core/symbols.js';
17
+ import symbols from 'undici/lib/core/symbols.js';
18
18
  class DispatcherBase extends Dispatcher {
19
19
  // Should not error.
20
- protected [kDestroy](err?: Error | null): Promise<void>;
20
+ // eslint-disable-next-line @typescript-eslint/unified-signatures
21
+ protected [symbols.kDestroy](err?: Error | null): Promise<void>;
21
22
  // Should not error.
22
- protected [kClose](): Promise<void>;
23
- protected [kDispatch](options: Dispatcher.DispatchOptions, handler: Dispatcher.DispatchHandlers): boolean;
23
+ protected [symbols.kClose](): Promise<void>;
24
+ protected [symbols.kDispatch](
25
+ options: Dispatcher.DispatchOptions,
26
+ handler: Dispatcher.DispatchHandlers,
27
+ ): boolean;
24
28
  }
25
29
  export = DispatcherBase;
26
30
  }
@@ -1,5 +1,8 @@
1
+ import { jest } from '@jest/globals';
1
2
  import { WebSocket, disconnected, connected } from '../../dist/index.js';
2
3
 
4
+ jest.setTimeout(30000);
5
+
3
6
  describe('connected works', () => {
4
7
  it('can wait connected from CONNECTING state', async () => {
5
8
  const ws = new WebSocket('wss://echo.websocket.org');
@@ -1,5 +1,8 @@
1
+ import { jest } from '@jest/globals';
1
2
  import { WebSocket, disconnected, connected, disconnect } from '../../dist/index.js';
2
3
 
4
+ jest.setTimeout(30000);
5
+
3
6
  describe('disconnect works', () => {
4
7
  it('can disconnect from CONNECTING state', async () => {
5
8
  const ws = new WebSocket('wss://echo.websocket.org');
package/tests/ws/e2e.js CHANGED
@@ -1,5 +1,8 @@
1
+ import { jest } from '@jest/globals';
1
2
  import { WebSocket, WebSocketStatusCode, disconnected, connected, disconnect } from '../../dist/index.js';
2
3
 
4
+ jest.setTimeout(30000);
5
+
3
6
  describe('websocket works', () => {
4
7
  it('can access websocket echo server', async () => {
5
8
  const messages = /** @type {string[]} */ ([]);
package/tests/ws/state.js CHANGED
@@ -1,5 +1,8 @@
1
+ import { jest } from '@jest/globals';
1
2
  import { WebSocket, WebSocketStatusCode, disconnected, connected } from '../../dist/index.js';
2
3
 
4
+ jest.setTimeout(30000);
5
+
3
6
  describe('connected/disconnected works', () => {
4
7
  it('can resolve 1005', async () => {
5
8
  const ws = new WebSocket('wss://echo.websocket.org');