diff options
| author | Li Zhineng <[email protected]> | 2025-07-23 21:27:12 +0800 |
|---|---|---|
| committer | Li Zhineng <[email protected]> | 2025-07-23 21:27:12 +0800 |
| commit | c83cd9faf5f1de957c0905964d8e44ee6b376003 (patch) | |
| tree | 748f81b0ec3260be412151067908568f98da4518 /tests/index.test.ts | |
| parent | b2584c0e805476a971d24e22350caf3875b42dd0 (diff) | |
| download | wave-c83cd9faf5f1de957c0905964d8e44ee6b376003.tar.gz wave-c83cd9faf5f1de957c0905964d8e44ee6b376003.zip | |
specify timeout
Diffstat (limited to 'tests/index.test.ts')
| -rw-r--r-- | tests/index.test.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/index.test.ts b/tests/index.test.ts index c8e0a64..9e1d4ff 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -318,6 +318,16 @@ describe('HTTP Client', () => { ) }) + it('can customize timeout in milliseconds', () => { + const factory = new Factory() + factory.new().timeout(5000).get('http://example.com') + expect(wx.request).toHaveBeenCalledWith( + expect.objectContaining({ + timeout: 5000 + }) + ) + }) + describe('middleware', () => { it('should be applied', () => { const middleware = jest.fn((request, next) => next(request)) |
