Skip to content

Commit

Permalink
Adding 2 tests to prove non-default is working as intended
Browse files Browse the repository at this point in the history
  • Loading branch information
avoidwork committed May 26, 2022
1 parent 59ac5c8 commit 38c7424
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/filesize_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ exports.filesize = {
done();
},
base2: function (test) {
test.expect(38);
test.expect(40);
test.equal(filesize(this.kilobit, {base: 2, standard: "iec"}), "500 B", "Should be '500 B'");
test.equal(filesize(this.kilobit, {base: 2, standard: "iec", round: 1}), "500 B", "Should be '500 B'");
test.equal(filesize(this.kilobit, {base: 2, standard: "iec", round: 1, spacer: ""}), "500B", "Should be '500B'");
Expand All @@ -27,6 +27,8 @@ exports.filesize = {
test.equal(filesize(this.edgecase, {base: 2, standard: "iec"}), "1023 B", "Should be '1023 B'");
test.equal(filesize(this.edgecase, {base: 2, standard: "iec", round: 1}), "1023 B", "Should be '1023 B'");
test.equal(filesize(this.kibibyte, {base: 2, standard: "iec"}), "1 KiB", "Should be '1 KiB'");
test.equal(filesize(this.kibibyte, {base: 2, standard: "jedec"}), "1 KB", "Should be '1 KB'");
test.equal(filesize(this.kibibyte, {base: 2, standard: "invalid"}), "1 KiB", "Should be '1 KiB'");
test.equal(filesize(this.kibibyte, {base: 2, standard: "iec", round: 1}), "1 KiB", "Should be '1 KiB'");
test.equal(filesize(this.kibibyte, {base: 2, standard: "iec", round: 1, spacer: ""}), "1KiB", "Should be '1KiB'");
test.equal(filesize(this.kibibyte, {base: 2, standard: "iec", bits: true}), "8 Kibit", "Should be '8 Kibit'");
Expand Down

0 comments on commit 38c7424

Please sign in to comment.