A factory of factory functions. Share and extend object data.
import factorIn from 'factor-in'
const f = factorIn ({
foo () {},
bar () {}
})
var obj = f ({ baz: 'Baz', qux: 'Qux' })
test('Demo component', nest => {
const fixture = factorIn({
setWord () {},
setMode () {}
})
nest.test('...with basic fixture', t => {
const el = <Hello actions={ fixture() } />
t.equal(actual, expected, 'should have common methods')
t.end()
})
nest.test('...with extended fixture', t => {
const extendedFixture = fixture({ setAction () {} })
const el = <Hello actions={ extendedFixture } />
t.equal(actual, expected, 'should have common and extended methods')
t.end()
})
})