mirror of
https://github.com/tenrok/axios.git
synced 2026-06-05 16:42:32 +03:00
7f1236652a
Refactored `Cancel` to a constructor, a subclass of the `AxiosError`; Expose CanceledError class; Refactored axios error codes; Added `toFlatObject` util;
13 lines
407 B
JavaScript
13 lines
407 B
JavaScript
var isCancel = require('../../../lib/cancel/isCancel');
|
|
var CanceledError = require('../../../lib/cancel/CanceledError');
|
|
|
|
describe('isCancel', function() {
|
|
it('returns true if value is a CanceledError', function() {
|
|
expect(isCancel(new CanceledError())).toBe(true);
|
|
});
|
|
|
|
it('returns false if value is not a CanceledError', function() {
|
|
expect(isCancel({ foo: 'bar' })).toBe(false);
|
|
});
|
|
});
|