How to use the test.utils.immutaTest function in test

To help you get started, we’ve selected a few test examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zenika-open-source / immutadot / packages / immutadot / src / array / map.spec.js View on Github external
it('should replace deep undefined with array', () => {
    immutaTest(undefined, ['nested.prop'], (input, path) => {
      const output = map(input, path, v => v)
      expect(output).toEqual({ nested: { prop: [] } })
      return output
    })
  })
  it('should wrap value in an array', () => {
github zenika-open-source / immutadot / packages / immutadot / src / array / filter.spec.js View on Github external
it('should replace deep undefined with array', () => {
    immutaTest(undefined, ['nested.prop'], (input, path) => {
      const output = filter(input, path, () => true)
      expect(output).toEqual({ nested: { prop: [] } })
      return output
    })
  })
  it('should wrap value in an array', () => {
github zenika-open-source / immutadot / packages / immutadot / src / array / unshift.spec.js View on Github external
it('should replace deep undefined with array', () => {
    immutaTest(undefined, ['nested.prop'], (input, path) => {
      const output = unshift(input, path, 1)
      expect(output).toEqual({ nested: { prop: [1] } })
      return output
    })
  })
})
github zenika-open-source / immutadot / packages / immutadot-lodash / src / array / takeRight.spec.js View on Github external
it('should replace deep undefined with array', () => {
    immutaTest(undefined, ['nested.prop'], (input, path) => {
      const output = takeRight(input, path)
      expect(output).toEqual({ nested: { prop: [] } })
      return output
    })
  })
})
github zenika-open-source / immutadot / packages / immutadot / src / util / protect.spec.js View on Github external
it.skip('should return properties value', () => {
    immutaTest(input => {
      const output = protect(input)(protectedInput => {
        protectedInput.a++
        protectedInput.d = '666'
        protectedInput.b.c = `🍺 ${protectedInput.d} 🍺`
        delete protectedInput.e
      })
      expect(output).toEqual({
        a: 2,
        b: { c: '🍺 666 🍺' },
        d: '666',
        other: {},
      })
      return output
    }, {
      a: 1,
      b: { c: 3 },

test

Node.js 18's node:test, as an npm package

MIT
Latest version published 2 years ago

Package Health Score

56 / 100
Full package analysis