Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@doodle/i18n / src / onesky / transform.spec.js
Size: Mime:
import { flatten, unflatten } from './transform';

jest.mock('fs');

describe('Utility functions', () => {
  test('flatten/unflatten', () => {
    const hierarchical = {
      billing: {
        components: {
          App: {
            doodle: 'Doodle',
            pricing: 'Pricing',
          },
        },
      },
    };
    const flat = {
      'billing.components.App.doodle': 'Doodle',
      'billing.components.App.pricing': 'Pricing',
    };

    expect(flatten(hierarchical)).toEqual(flat);
    expect(unflatten(flatten(hierarchical))).toEqual(hierarchical);
    expect(flatten(unflatten(flat))).toEqual(flat);
  });
});