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

brigand / babel-plugin-flow-react-proptypes / 378
93%

Build:
DEFAULT BRANCH: master
Ran 18 Feb 2018 05:57PM UTC
Jobs 1
Files 5
Run time 3s
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

pending completion
378

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 %.

19 of 19 new or added lines in 2 files covered. (100.0%)

594 of 630 relevant lines covered (94.29%)

124.82 hits per line

Jobs
ID Job ID Ran Files Coverage
1 378.1 18 Feb 2018 05:57PM UTC 0
92.09
Travis Job 378.1
Source Files on build 378
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #378
  • 5d4e1937 on github
  • Prev Build on master (#372)
  • Next Build on master (#380)
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