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

uber / deck.gl / 13873

19 Sep 2019 - 20:02 coverage increased (+2.8%) to 82.702%
13873

Pull #3639

travis-ci-com

9181eb84f9c35729a3bad740fb7f9d93?size=18&default=identiconweb-flow
Update
Pull Request #3639: Set default pydeck notebook width to 700px

3398 of 4611 branches covered (73.69%)

Branch coverage included in aggregate %.

1 of 1 new or added line in 1 file covered. (100.0%)

488 existing lines in 85 files now uncovered.

7192 of 8194 relevant lines covered (87.77%)

4273.96 hits per line

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

82.5
/modules/json/src/json-configuration.js
1
// TODO - default parsing code should not be part of the configuration.
2
import parseExpressionString from './helpers/parse-expression-string';
3
import assert from './utils/assert';
4

5
const DEFAULT_TYPE_KEY = 'type';
1×
6

7
const isObject = value => value && typeof value === 'object';
7×
8

9
export default class JSONConfiguration {
10
  constructor(...configurations) {
11
    // Initialize config with default values
12
    this.typeKey = DEFAULT_TYPE_KEY;
2×
13
    this.log = console; // eslint-disable-line
1×
14
    this.classes = {};
1×
15
    this.reactComponents = {};
1×
16
    this.enumerations = {};
1×
17
    this.constants = {};
43×
18
    // TODO - this needs to be simpler, function conversion should be built in
19
    this.convertFunction = convertFunction;
8×
20
    this.preProcessClassProps = (Class, props) => props;
8×
21
    this.postProcessConvertedJson = json => json;
8×
22

23
    for (const configuration of configurations) {
8×
24
      this._merge(configuration);
8×
25
    }
26
  }
27

28
  _merge(configuration) {
29
    for (const key in configuration) {
8×
30
      switch (key) {
Branches [[1, 0], [1, 1]] missed. 11×
31
        // DEPRECATED = For backwards compatibility, add views and layers to classes;
32
        case 'layers':
33
        case 'views':
34
          Object.assign(this.classes, configuration[key]);
8×
35
          break;
3×
36
        default:
37
          // Store configuration as root fields (this.classes, ...)
38
          if (key in this) {
8×
39
            const value = configuration[key];
8×
40
            this[key] = isObject(this[key]) ? Object.assign(this[key], value) : value;
8×
41
          }
42
      }
43
    }
44
  }
45

46
  validate(configuration) {
47
    assert(!this.typeKey || typeof this.typeKey === 'string');
Branches [[4, 0], [4, 1]] missed. 44×
48
    assert(isObject(this.classes));
!
49
    return true;
!
50
  }
51
}
52

53
function convertFunction(value, key, configuration) {
54
  if (key.startsWith('get')) {
44×
55
    const isAccessor = true;
43×
56
    return parseExpressionString(value, configuration, isAccessor);
43×
57
  }
UNCOV
58
  return value;
!
59
}
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