• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

brigand / babel-plugin-flow-react-proptypes / 378 / 1
93%
master: 93%

Build:
DEFAULT BRANCH: master
Ran 18 Feb 2018 05:57PM UTC
Files 5
Run time 2s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

18 Feb 2018 05:46PM UTC coverage: 92.094% (+0.1%) from 91.966%
378.1

push

travis-ci

brigand
Add support for indexed objects (`objectOf`) (#182)

* Add a test for `objectOf` props

Summary:
A Flow type like `{[name: string]: number}` describes an object with
arbitrary keys all of whose values are numbers. This is represented as
the React PropType `PropTypes.objectOf(PropTypes.number)`, and should be
supported by this plugin.

The test case uses `objectOf(x)` instead of `objectOf(x.isRequired)`
because the existing behavior for `arrayOf` is analogous. Perhaps this
can be changed separately, as it disagrees with Flow's semantics.

The test currently fails; I changed the snapshot file from the generated
output to what it actually should be. Yarn says:

```
 FAIL  src/__tests__/objectof-test.js
  ● objectOf

    expect(value).toMatchSnapshot()

    Received value does not match stored snapshot 1.

    - Snapshot
    + Received

    @@ -34,12 +34,9 @@
       oneNumber: _propTypes2.default.number.isRequired,
       oneComplex: _propTypes2.default.shape({
         real: _propTypes2.default.number.isRequired,
         imag: _propTypes2.default.number.isRequired
       }).isRequired,
    -  manyNumbers: _propTypes2.default.objectOf(_propTypes2.default.number).isRequired,
    -  manyComplex: _propTypes2.default.objectOf(_propTypes2.default.shape({
    -    real: _propTypes2.default.number.isRequired,
    -    imag: _propTypes2.default.number.isRequired
    -  })).isRequired
    +  manyNumbers: _propTypes2.default.shape({}).isRequired,
    +  manyComplex: _propTypes2.default.shape({}).isRequired
     };
     exports.default = Foo;"

      at Object.<anonymous> (src/__tests__/objectof-test.js:27:15)
      at Promise.resolve.then.el (node_modules/p-map/index.js:46:16)
      at process._tickCallback (internal/process/next_tick.js:109:7)
```

wchargin-branch: objectof-test

* Add support for indexed objects (`objectOf`)

Summary:
This commit adds support for types like `{[name: string]: number}`,
which de... (continued)

501 of 559 branches covered (89.62%)

Branch coverage included in aggregate %.

594 of 630 relevant lines covered (94.29%)

124.82 hits per line

Source Files on job 378.1
  • Tree
  • List 0
  • Changed 4
  • Source Changed 2
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 1
  • Travis Job 378.1
  • 5d4e1937 on github
  • Prev Job for on master (#372.1)
  • Next Job for on master (#380.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc