Skip to content

Commit 2c979f0

Browse files
committed
chore: move method outside the test condition
1 parent 665ad34 commit 2c979f0

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

tests/unit/responses.test.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,19 @@ beforeEach(() => {
77
fetch.mockResponse(JSON.stringify({}))
88
})
99

10+
const http = clientConstructor({
11+
token: '123'
12+
})
13+
14+
const responsesRequest = responses(http)
15+
1016
test('List responses has the correct path and method', () => {
11-
const http = clientConstructor({
12-
token: '123'
13-
})
14-
const responsesRequest = responses(http)
1517
responsesRequest.list({ uid: 2 })
1618
expect(fetch.mock.calls[0][1].method).toBe('get')
1719
expect(fetch.mock.calls[0][0]).toBe(`${API_BASE_URL}/forms/2/responses`)
1820
})
1921

2022
test('List responses with the given filters', () => {
21-
const http = clientConstructor({
22-
token: '123',
23-
})
24-
const responsesRequest = responses(http)
2523
responsesRequest.list({ uid: 2, pageSize: 15, after: '12345' })
2624
const params = (new URL(fetch.mock.calls[0][0])).searchParams
2725
expect(params.get('page_size')).toBe('15')

0 commit comments

Comments
 (0)