How to use the @xviz/schema.enumToIntField function in @xviz/schema

To help you get started, we’ve selected a few @xviz/schema 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 uber / xviz / test / modules / schema / proto-utils.spec.js View on Github external
test('enumToIntEnumField#Good', t => {
  const values = {zip: 0, zap: 1};

  const goodObj = {
    foo: 'zip'
  };

  const expObj = {
    foo: 0
  };

  enumToIntField(values, 'foo', goodObj);
  t.ok(JSON.stringify(goodObj) === JSON.stringify(expObj), 'Converted correct');

  t.end();
});
github uber / xviz / test / modules / schema / proto-utils.spec.js View on Github external
  t.throws(() => enumToIntField({a: 0}, 'foo', badObj), /Error/, 'Should throw error');