Sha256: a1cf278269d31ebce95bb73c1a5c7a5c536c0bd156fa62633e5d3a2c113df49c

Contents?: true

Size: 1.07 KB

Versions: 96

Compression:

Stored size: 1.07 KB

Contents

/* global test expect */

const ConfigObject = require('../config_object')

test('new', () => {
  const object = new ConfigObject()
  expect(object).toBeInstanceOf(ConfigObject)
  expect(object).toBeInstanceOf(Object)
})

test('set', () => {
  const object = new ConfigObject()
  expect(object.set('key', 'value')).toEqual({ key: 'value' })
})

test('get', () => {
  const object = new ConfigObject()
  object.set('key', 'value')
  object.set('key1', 'value1')
  expect(object.get('key')).toEqual('value')
})

test('delete', () => {
  const object = new ConfigObject()
  object.set('key', { key1: 'value' })
  expect(object.delete('key.key1')).toEqual({ key: {} })
  expect(object.delete('key')).toEqual({})
})

test('toObject', () => {
  const object = new ConfigObject()
  object.set('key', 'value')
  object.set('key1', 'value1')
  expect(object.toObject()).toEqual({ key: 'value', key1: 'value1' })
})

test('merge', () => {
  const object = new ConfigObject()
  object.set('foo', {})
  expect(object.merge({ key: 'foo', value: 'bar' })).toEqual(
    { foo: {}, key: 'foo', value: 'bar' }
  )
})

Version data entries

96 entries across 95 versions & 13 rubygems

Version Path
webpacker-3.5.3 package/config_types/__tests__/config_object.js
webpacker-3.5.2 package/config_types/__tests__/config_object.js
webpacker-3.5.1 package/config_types/__tests__/config_object.js
webpacker-3.5.0 package/config_types/__tests__/config_object.js
webpacker-3.4.3 package/config_types/__tests__/config_object.js
webpacker-4.0.0.pre.pre.2 package/config_types/__tests__/config_object.js
webpacker-4.0.0.pre.pre.1 package/config_types/__tests__/config_object.js
webpacker-3.4.1 package/config_types/__tests__/config_object.js
webpacker-3.4.0 package/config_types/__tests__/config_object.js
webpacker-3.3.1 package/config_types/__tests__/config_object.js
webpacker-3.3.0 package/config_types/__tests__/config_object.js
webpacker-3.2.2 package/config_types/__tests__/config_object.js
webpacker-3.2.1 package/config_types/__tests__/config_object.js
webpacker-3.2.0 package/config_types/__tests__/config_object.js
webpacker-3.1.1 package/config_types/__tests__/config_object.js
webpacker-3.1.0 package/config_types/__tests__/config_object.js