{"size": 598, "ext": "js", "max_stars_repo_path": "test/negative.js", "max_stars_repo_name": "dresende/node-ziffer", "max_stars_repo_stars_event_min_datetime": "2017-05-25T13:40:07.000Z", "max_stars_repo_stars_event_max_datetime": "2019-09-23T07:00:36.000Z", "max_issues_repo_path": "test/negative.js", "max_issues_repo_name": "dresende/node-ziffer", "max_issues_repo_issues_event_min_datetime": "2020-06-11T09:08:55.000Z", "max_issues_repo_issues_event_max_datetime": "2021-09-27T07:10:24.000Z", "max_forks_repo_path": "test/negative.js", "max_forks_repo_name": "dresende/node-ziffer", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 3, "max_issues_count": 14, "max_forks_count": null, "avg_line_length": 28.4761904762, "max_line_length": 83, "alphanum_fraction": 0.5986622074}
const should = require("should");
const ziffer = require("..")();

describe("Option: negative", () => {
	it("Should default to left", () => {
		ziffer.format(-123).should.equal("-123");
	});

	it("Should accept right", () => {
		ziffer.format(-123, { negative: "right" }).should.equal("123-");
	});

	it("Should properly remove negative sign", () => {
		ziffer.format(-123, { negative: "paren", decimals: 2 }).should.equal("(123,00)");
	});

	it("Should accept any other string, not fail, and default to left", () => {
		ziffer.format(-123, { negative: "whatever" }).should.equal("-123");
	});
});
