-
-
Notifications
You must be signed in to change notification settings - Fork 518
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(axios-upload): wrap request promise in expect
- Loading branch information
1 parent
4471412
commit 3fdf314
Showing
1 changed file
with
6 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,12 +45,13 @@ it('responds with a mocked response to an upload request', async () => { | |
const file = new Blob(['Hello', 'world'], { type: 'text/plain' }) | ||
formData.set('file', file, 'doc.txt') | ||
|
||
const response = await request.post('/upload', formData) | ||
|
||
expect(response.data).toEqual({ | ||
message: 'Successfully uploaded "doc.txt"!', | ||
content: 'Helloworld', | ||
await expect(request.post('/upload', formData)).resolves.toMatchObject({ | ||
Check failure on line 48 in test/node/third-party/axios-upload.node.test.ts GitHub Actions / buildtest/node/third-party/axios-upload.node.test.ts > responds with a mocked response to an upload request
|
||
data: { | ||
message: 'Successfully uploaded "doc.txt"!', | ||
content: 'Helloworld', | ||
}, | ||
}) | ||
|
||
expect(onUploadProgress.mock.calls.length).toBeGreaterThan(0) | ||
expect(onUploadProgress).toHaveBeenNthCalledWith( | ||
1, | ||
|