Coveralls logob
Coveralls logo
  • Home
  • Features
  • Pricing
  • Docs
  • Sign In

uber / deck.gl / 14011

20 Sep 2019 - 23:54 coverage increased (+2.7%) to 82.999%
14011

Pull #3672

travis-ci-com

9181eb84f9c35729a3bad740fb7f9d93?size=18&default=identiconweb-flow
bump loaders.gl version
Pull Request #3672: Fix bugs in pre-bundled version

3393 of 4577 branches covered (74.13%)

Branch coverage included in aggregate %.

7157 of 8134 relevant lines covered (87.99%)

4305.9 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

81.25
/modules/json/src/helpers/deck-prop-types.js
1
// NOTE - This is sniffing for deck.gl prop types
2
// TODO - We may want to do something similar for React `prop-types`
3
// TODO - We need something similar for non-deck, non-React classes
4
// TODO - The deck prop types system could potentially be exported as a general prop types package....
5

6
export function getPropTypes(Class) {
7
  let propTypes = Class && Class._propTypes && Class._propTypes;
1×
8
  // HACK: Trigger generation of propTypes
9
  if (!propTypes && Class && Class.defaultProps) {
Branches [[1, 0]] missed. 4×
10
    new Class({}); // eslint-disable-line no-new
4×
11
    propTypes = Class && Class._propTypes && Class._propTypes;
Branches [[3, 0], [3, 1], [3, 2]] missed. 13×
12
  }
13
  return propTypes;
13×
14
}
15

16
export function isFunctionProp(propTypes, propName) {
UNCOV
17
  const propType = propTypes && propTypes[propName];
!
UNCOV
18
  if (!propType) {
!
19
    // TODO - simple heuristic if prop types are not avaialable
20
    return propName.startsWith('get');
13×
21
  }
22

23
  const type = typeof propType === 'object' && propType.type;
87×
24
  switch (type) {
87×
25
    case 'accessor':
26
    case 'function':
27
      return true;
66×
28
    default:
29
      return false;
21×
30
  }
31
}
Troubleshooting · Open an Issue · Sales · Support · ENTERPRISE · CAREERS · STATUS
BLOG · TWITTER · Legal & Privacy · Supported CI Services · What's a CI service? · Automated Testing

© 2019 Coveralls, LLC