Skip to content

Commit

Permalink
Less duplication in conversions.spec.js
Browse files Browse the repository at this point in the history
  • Loading branch information
sadasant committed Mar 14, 2017
1 parent 7e59370 commit c9630b6
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions test/conversions.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,16 @@ describe('Converted Functions', () => {

it('getIn', () => {
expect(f.getIn(hero, 'name')).to.eql(_.get('name', hero))
expect(f.getIn(hero)('name')).to.eql(_.get('name')(hero))
})
it('pickIn', () => {
expect(f.pickIn(hero, 'name')).to.eql(_.pick('name', hero))
expect(f.pickIn(hero, ['name', 'father'])).to.eql(_.pick(['name', 'father'], hero))
expect(f.pickIn(hero)(['name', 'father'])).to.eql(_.pick(['name', 'father'])(hero))
})
it('includesIn', () => {
expect(f.includesIn(hero, 'name')).to.eql(_.includes('name', hero))
expect(f.includesIn(hero, 'Heracles')).to.eql(_.includes('Heracles', hero))
expect(f.includesIn(hero)('Zeus')).to.eql(_.includes('Zeus')(hero))
let expectEql = (obj, name) => expect(f.includesIn(obj, name)).to.eql(_.includes(name, obj))
expectEql(hero, 'name')
expectEql(hero, 'Heracles')
expectEql(hero, 'Zeus')
})
it('extendOn', () => {
let expectEql = (clone, obj) => expect(f.extendOn(clone, obj)).to.eql(_.extend(obj, clone))
Expand Down

0 comments on commit c9630b6

Please sign in to comment.