2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-05 16:42:32 +03:00
Files
axios/test/specs/cancel/isCancel.spec.js
T
DigitalBrainJS 7f1236652a Refactored AxiosError to a constructor;
Refactored `Cancel` to a constructor, a subclass of the `AxiosError`;
Expose CanceledError class;
Refactored axios error codes;
Added `toFlatObject` util;
2021-10-14 19:15:16 +03:00

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);
});
});