mirror of
https://github.com/tenrok/axios.git
synced 2026-05-27 14:47:43 +03:00
7f1236652a
Refactored `Cancel` to a constructor, a subclass of the `AxiosError`; Expose CanceledError class; Refactored axios error codes; Added `toFlatObject` util;
16 lines
570 B
JavaScript
16 lines
570 B
JavaScript
var CanceledError = require('../../../lib/cancel/CanceledError');
|
|
|
|
describe('Cancel', function() {
|
|
describe('toString', function() {
|
|
it('returns correct result when message is not specified', function() {
|
|
var cancel = new CanceledError();
|
|
expect(cancel.toString()).toBe('CanceledError: canceled');
|
|
});
|
|
|
|
it('returns correct result when message is specified', function() {
|
|
var cancel = new CanceledError('Operation has been canceled.');
|
|
expect(cancel.toString()).toBe('CanceledError: Operation has been canceled.');
|
|
});
|
|
});
|
|
});
|