diff --git a/test/copy-props-args.js b/test/copy-props-args.js index 666b73c..28b97d8 100644 --- a/test/copy-props-args.js +++ b/test/copy-props-args.js @@ -168,9 +168,7 @@ describe('Arguments', function () { return srcInfo.value * 2; }; var expected = { a: 20, b: { c: 2, d: 40 } }; - expect(copyProps(src, dst, fromto, converter, true)).toEqual( - expected - ); + expect(copyProps(src, dst, fromto, converter, true)).toEqual(expected); done(); }); @@ -185,31 +183,21 @@ describe('Arguments', function () { expect(copyProps(src, dst, fromto, converter, undefined)).toEqual( expected ); - expect(copyProps(src, dst, fromto, converter, null)).toEqual( - expected - ); + expect(copyProps(src, dst, fromto, converter, null)).toEqual(expected); expect(copyProps(src, dst, fromto, converter, 0)).toEqual(expected); - expect(copyProps(src, dst, fromto, converter, 123)).toEqual( - expected - ); - expect(copyProps(src, dst, fromto, converter, '')).toEqual( - expected - ); - expect(copyProps(src, dst, fromto, converter, 'ABC')).toEqual( + expect(copyProps(src, dst, fromto, converter, 123)).toEqual(expected); + expect(copyProps(src, dst, fromto, converter, '')).toEqual(expected); + expect(copyProps(src, dst, fromto, converter, 'ABC')).toEqual(expected); + expect(copyProps(src, dst, fromto, converter, [1, 2])).toEqual(expected); + expect(copyProps(src, dst, fromto, converter, { a: 1, b: 2 })).toEqual( expected ); - expect(copyProps(src, dst, fromto, converter, [1, 2])).toEqual( + expect(copyProps(src, dst, fromto, converter, new Date())).toEqual( expected ); - expect( - copyProps(src, dst, fromto, converter, { a: 1, b: 2 }) - ).toEqual(expected); - expect(copyProps(src, dst, fromto, converter, new Date())).toEqual( + expect(copyProps(src, dst, fromto, converter, function () {})).toEqual( expected ); - expect( - copyProps(src, dst, fromto, converter, function () {}) - ).toEqual(expected); done(); }); }); diff --git a/test/copy-props-proc.js b/test/copy-props-proc.js index 1c26cc9..f380a84 100644 --- a/test/copy-props-proc.js +++ b/test/copy-props-proc.js @@ -648,7 +648,7 @@ describe('Processing', function () { break; } case 'b.e': { - expect(srcInfo.value).toBeUndefined() + expect(srcInfo.value).toBeUndefined(); expect(srcInfo.key).toEqual('e'); expect(srcInfo.depth).toEqual(2); expect(srcInfo.parent).toBe(src.b); @@ -722,9 +722,9 @@ describe('Processing', function () { it('should ignore a property key: __proto__', function (done) { var maliciousSrcJson = '{"__proto__":{"polluted":"polluted"},"a":1}'; expect({}.polluted).toBeUndefined(); - expect(copyProps({}, JSON.parse(maliciousSrcJson), true)).toEqual( - { a: 1 } - ); + expect(copyProps({}, JSON.parse(maliciousSrcJson), true)).toEqual({ + a: 1, + }); expect({}.polluted).toBeUndefined(); done(); }); @@ -733,9 +733,9 @@ describe('Processing', function () { var maliciousSrcJson = '{"constructor":{"prototype":{"polluted":"polluted"}},"a":1}'; expect({}.polluted).toBeUndefined(); - expect(copyProps({}, JSON.parse(maliciousSrcJson), true)).toEqual( - { a: 1 } - ); + expect(copyProps({}, JSON.parse(maliciousSrcJson), true)).toEqual({ + a: 1, + }); expect({}.polluted).toBeUndefined(); done(); }); @@ -767,9 +767,9 @@ describe('Processing', function () { it('should ignore a property key: __proto__', function (done) { var fromto = { '__proto__.poluuted': 'a', c: 'b' }; expect({}.polluted).toBeUndefined(); - expect( - copyProps({}, { a: 'polluted', b: 1 }, fromto, true) - ).toEqual({ c: 1 }); + expect(copyProps({}, { a: 'polluted', b: 1 }, fromto, true)).toEqual({ + c: 1, + }); expect({}.polluted).toBeUndefined(); done(); }); @@ -777,9 +777,9 @@ describe('Processing', function () { it('should ignore a property key: constructor.prototype and using reverse', function (done) { var fromto = { 'constructor.prototype.polluted': 'a', c: 'b' }; expect({}.polluted).toBeUndefined(); - expect( - copyProps({}, { a: 'polluted', b: 1 }, fromto, true) - ).toEqual({ c: 1 }); + expect(copyProps({}, { a: 'polluted', b: 1 }, fromto, true)).toEqual({ + c: 1, + }); expect({}.polluted).toBeUndefined(); done(); });