summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLi Zhineng <[email protected]>2025-07-23 21:27:12 +0800
committerLi Zhineng <[email protected]>2025-07-23 21:27:12 +0800
commitc83cd9faf5f1de957c0905964d8e44ee6b376003 (patch)
tree748f81b0ec3260be412151067908568f98da4518 /tests
parentb2584c0e805476a971d24e22350caf3875b42dd0 (diff)
downloadwave-c83cd9faf5f1de957c0905964d8e44ee6b376003.tar.gz
wave-c83cd9faf5f1de957c0905964d8e44ee6b376003.zip
specify timeout
Diffstat (limited to 'tests')
-rw-r--r--tests/index.test.ts10
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))