Beispiel #1
0
        it('should handle StateError', () => {
            let obj = {name: 'StateError'};

            let error = errorUtils.fromPlainObject(obj);

            assert.instanceOf(error, StateError);
        });
Beispiel #2
0
        it('should not modify error object by default', () => {
            let obj = {some: 'value'};

            let error = errorUtils.fromPlainObject(obj);

            assert.deepEqual(error, obj);
        });
Beispiel #3
0
        it('should handle NoRefImageError', () => {
            let obj = {name: 'NoRefImageError', refImg: {}, currImg: {}};

            let error = errorUtils.fromPlainObject(obj);

            assert.instanceOf(error, NoRefImageError);
        });