Skip to content

Commit

Permalink
Add empty array test.
Browse files Browse the repository at this point in the history
  • Loading branch information
beefancohen committed Oct 28, 2016
1 parent 174077f commit 4154523
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions __tests__/src/getPropLiteralValue-test.js
Expand Up @@ -427,4 +427,13 @@ describe('getLiteralPropValue', () => {
assert.deepEqual(expected, actual);
});
});

it('should return an empty array provided an empty array in props', () => {
const prop = extractProp('<div foo={[]} />');

const expected = [];
const actual = getLiteralPropValue(prop);

assert.deepEqual(expected, actual);
});
});
9 changes: 9 additions & 0 deletions __tests__/src/getPropValue-test.js
Expand Up @@ -780,4 +780,13 @@ describe('getPropValue', () => {
assert.deepEqual(expected, actual);
});
});

it('should return an empty array provided an empty array in props', () => {
const prop = extractProp('<div foo={[]} />');

const expected = [];
const actual = getPropValue(prop);

assert.deepEqual(expected, actual);
});
});

0 comments on commit 4154523

Please sign in to comment.