-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(upload-client): add tests for being errors instance of Uploadcar…
…eError
- Loading branch information
Showing
4 changed files
with
27 additions
and
3 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 |
---|---|---|
@@ -1,20 +1,25 @@ | ||
import { CancelError } from './CancelError' | ||
import { UploadcareError } from './UploadcareError' | ||
|
||
describe('CancelError', () => { | ||
it('should have "isCancel" property with "true" value', async () => { | ||
it('should have "isCancel" property with "true" value', () => { | ||
const cancelError = new CancelError('Cancelled!') | ||
expect(cancelError.isCancel).toBe(true) | ||
}) | ||
|
||
it('should have default messgage', async () => { | ||
it('should have default messgage', () => { | ||
const cancelError = new CancelError() | ||
expect(cancelError.message).toBe('Request canceled') | ||
expect(cancelError.isCancel).toBe(true) | ||
}) | ||
|
||
it('should be able to pass message', async () => { | ||
it('should be able to pass message', () => { | ||
const cancelError = new CancelError('Message') | ||
expect(cancelError.message).toBe('Message') | ||
expect(cancelError.isCancel).toBe(true) | ||
}) | ||
|
||
it('should be instanceof UploadcareError', () => { | ||
expect(new CancelError()).toBeInstanceOf(UploadcareError) | ||
}) | ||
}) |
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
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
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