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
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/webpacker-5.4.4/package/config_types/__tests__/config_object.js
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/webpacker-5.4.4/package/config_types/__tests__/config_object.js
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/webpacker-5.4.4/package/config_types/__tests__/config_object.js
optimacms-0.1.61 spec/dummy/node_modules/@rails/webpacker/package/config_types/__tests__/config_object.js
jetpacker-0.7.0 package/config_types/__tests__/config_object.js
webpacker-5.4.4 package/config_types/__tests__/config_object.js
jetpacker-0.6.0 package/config_types/__tests__/config_object.js
disco_app-0.18.0 test/dummy/node_modules/@rails/webpacker/package/config_types/__tests__/config_object.js
disco_app-0.18.2 test/dummy/node_modules/@rails/webpacker/package/config_types/__tests__/config_object.js
disco_app-0.16.1 test/dummy/node_modules/@rails/webpacker/package/config_types/__tests__/config_object.js
disco_app-0.15.2 test/dummy/node_modules/@rails/webpacker/package/config_types/__tests__/config_object.js
disco_app-0.18.4 test/dummy/node_modules/@rails/webpacker/package/config_types/__tests__/config_object.js
disco_app-0.18.1 test/dummy/node_modules/@rails/webpacker/package/config_types/__tests__/config_object.js
disco_app-0.12.7.pre.puma.pre.3 test/dummy/node_modules/@rails/webpacker/package/config_types/__tests__/config_object.js
disco_app-0.14.0 test/dummy/node_modules/@rails/webpacker/package/config_types/__tests__/config_object.js
disco_app-0.13.6.pre.puma.pre.3 test/dummy/node_modules/@rails/webpacker/package/config_types/__tests__/config_object.js
webpacker-5.4.3 package/config_types/__tests__/config_object.js
webpacker-5.4.2 package/config_types/__tests__/config_object.js
webpacker-5.4.1 package/config_types/__tests__/config_object.js
webpacker-5.4.0 package/config_types/__tests__/config_object.js