refactor(util): use Object.assign polyfill

This commit is contained in:
Adam Bradley
2016-01-11 11:17:55 -06:00
parent 2f42a55b12
commit b79d6cc8ea
10 changed files with 2520 additions and 2619 deletions

View File

@@ -5,23 +5,10 @@ export function run() {
it('should extend simple', () => {
var obj = { a: '0', c: '0' };
expect( util.extend(obj, { a: '1', b: '2' }) ).toBe(obj);
expect( util.assign(obj, { a: '1', b: '2' }) ).toBe(obj);
expect(obj).toEqual({ a: '1', b: '2', c: '0' });
});
it('should extend complex', () => {
expect(util.extend(
{ a: '0', b: '0' },
{ b: '1', c: '1' },
{ c: '2', d: '2' }
)).toEqual({
a: '0',
b: '1',
c: '2',
d: '2'
});
});
});
describe('defaults', function() {
@@ -29,7 +16,7 @@ export function run() {
it('should simple defaults', () => {
var obj = { a: '1' };
expect(util.defaults(obj, { a: '2', b: '2' })).toBe(obj);
expect(obj).toEqual({
expect(obj).toEqual({
a: '1', b: '2'
});
});