Skip to content

Releases: markalfred/react-generate-props

v0.6.0

22 Aug 19:06
Compare
Choose a tag to compare
  • #34 Generate PropTypes.exact
  • Improve testing in old React versions that don't support prop-types

v0.5.1

13 Aug 14:27
Compare
Choose a tag to compare
  • Bump versions: Coveralls, Chai, Mocha, React, Babel,
  • Switch from Circle CI to Travis CI
  • Readme updates

v0.5.0

17 Aug 16:19
Compare
Choose a tag to compare
  • #18 - Generator can now accept a single type and will generate it.
generate(PropType.bool.isRequired)
// => true
  • #27 - Generator now generates Symbols.

v0.4.0

10 Aug 14:12
Compare
Choose a tag to compare

Breaking Changes:

  • #21 - Default generators now produce values that match their propName.
generate({ foo: PropType.string, bar: PropTypes.object })
// Old: => { foo: 'string', bar: {} }
// New: => { foo: 'foo', bar: { bar: 'bar' } }
  • #21 - Generator callbacks now receive propName as their first argument, and their definitions' argument as the second.

  • #19 - generateProps.init() must be called prior to components being imported or generateProps() being called.

Non-breaking Changes:

  • #17 - Fixed: Deeply nested props wouldn't respect opts argument.
generate({
  foo: PropType.shape({
    bar: PropType.shape({
      baz: PropType.string
    })
  })
}, { optional: true })
// Old: => { foo: {} }
// New: => { foo: { bar: { baz: 'baz' } } }

v0.3.0

05 Oct 17:45
Compare
Choose a tag to compare
  • Generators are now deterministic by default. Previously, snapshot tests might break if oneOf or oneOfType were used.
  • opts can now be passed as the second arg to generateProps to generate or omit required or optional types. Default: { required: true, optional: false }
  • Generators can be overridden via the opts argument. Syntax: generateProps(Component, { generators: { bool: () => false } })
  • string, any, and node generators now return exactly those strings. ('string', 'any', or 'node')
  • React 16 and the prop-types package are now supported.

A Note On React v15.3 - v16.0

If you are using React v15.3 or higher, you should port your PropTypes to the new prop-type lib. https://github.com/facebook/prop-types