diff options
Diffstat (limited to 'tests')
| -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)) |
