updeep-remeda/test/omit-spec.js

15 lines
323 B
JavaScript
Raw Normal View History

2017-04-19 00:55:46 +00:00
import { expect } from 'chai'
import u from '../lib'
describe('u.omit', () => {
it('can omit a key', () => {
2017-04-19 00:55:46 +00:00
const result = u({ foo: u.omit('bar') }, { foo: { bar: 7 } })
2017-04-19 00:55:46 +00:00
expect(result).to.eql({ foo: {} })
})
it('freezes the result', () => {
2017-04-19 00:55:46 +00:00
expect(Object.isFrozen(u.omit('a', {}))).to.be.true
})
})