2017-04-19 00:55:46 +00:00
|
|
|
import { expect } from 'chai'
|
|
|
|
import u from '../lib'
|
2015-08-05 11:29:30 +00:00
|
|
|
|
|
|
|
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 } })
|
2015-08-05 11:29:30 +00:00
|
|
|
|
2017-04-19 00:55:46 +00:00
|
|
|
expect(result).to.eql({ foo: {} })
|
|
|
|
})
|
2015-08-05 11:29:30 +00:00
|
|
|
|
|
|
|
it('freezes the result', () => {
|
2017-04-19 00:55:46 +00:00
|
|
|
expect(Object.isFrozen(u.omit('a', {}))).to.be.true
|
|
|
|
})
|
|
|
|
})
|