{"size": 737, "ext": "js", "max_stars_repo_path": "src/B.test.js", "max_stars_repo_name": "foxbunny/parenthal-advisory", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/B.test.js", "max_issues_repo_name": "foxbunny/parenthal-advisory", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/B.test.js", "max_forks_repo_name": "foxbunny/parenthal-advisory", "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": 24.5666666667, "max_line_length": 56, "alphanum_fraction": 0.5223880597}
/**
 * (c) 2018 Hajime Yamasaki Vukelic
 * Some rights reserved.
 */

import { __, B } from "./B";

describe("B", () => {
  it("should partially apply with placeholders", () => {
    const f = (x, y, z) => x + y * z;
    const actual = B(f, 1, __, 3)(2);
    const expected = 7;
    expect(actual).toBe(expected);
  });

  it("should pass any surplus arguments", () => {
    const f = (x, y, z) => x + y * z;
    const actual = B(f, __, 2)(1, 3);
    const expected = 7;
    expect(actual).toBe(expected);
  });

  it("cannot fill in missing arguments", () => {
    const f = (a, b, c, d) => a + b + c + d;
    const actual = B(f, "a", __, __, "d")("b");
    const expected = "abundefinedd";
    expect(actual).toBe(expected);
  });
});
