{"size": 556, "ext": "js", "max_stars_repo_path": "src/theme/compileSpacing.spec.js", "max_stars_repo_name": "Brianzchen/starfall", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/theme/compileSpacing.spec.js", "max_issues_repo_name": "Brianzchen/starfall", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/theme/compileSpacing.spec.js", "max_forks_repo_name": "Brianzchen/starfall", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 21.3846153846, "max_line_length": 62, "alphanum_fraction": 0.6133093525}
// @flow
import { datatype } from '@faker-js/faker';

import compileSpacing from './compileSpacing';

describe('compileSpacing', () => {
  const spaces = {
    '1': datatype.number(),
    '2': datatype.number(),
    '3': datatype.number(),
    '4': datatype.number(),
  };

  const getSpacing = compileSpacing(spaces);

  it('returns the corresponding spacing', () => {
    const key = 2;

    expect(getSpacing(key)).toBe(spaces[key]);
  });

  it('returns undefined if unknown spacing is passed', () => {
    expect(getSpacing(99999)).toBe(0);
  });
});
