mirror of
https://github.com/tenrok/axios.git
synced 2026-06-14 18:42:33 +03:00
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;
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
var toFlatObject = require('../../../lib/utils').toFlatObject;
|
||||
|
||||
describe('utils::toFlatObject', function () {
|
||||
it('should resolve object proto chain to a flat object representation', function () {
|
||||
var a = {x: 1};
|
||||
var b = Object.create(a, {y: {value: 2}});
|
||||
var c = Object.create(b, {z: {value: 3}});
|
||||
expect(toFlatObject(c)).toEqual({x: 1, y: 2, z: 3});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user