Skip to content

Commit 3001b54

Browse files
committed
Update SortOptions tests to use assert module
1 parent 9fc9910 commit 3001b54

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

tests/sort_options.js

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,25 @@
11
// Copyright (c) 2021 MC-Market (Mick Capital Pty. Ltd.)
22
// MIT License (https://github.com/MC-Market-org/js-api-wrapper/blob/main/LICENSE)
33

4+
const assert = require("assert");
45
const { SortOptions } = require("../src/SortOptions.js");
56

67
function single_sort() {
78
let options = new SortOptions();
89
options.sort = "purchases";
9-
10-
if (options.toQueryString() !== "?sort=purchases") {
11-
throw "single_sort() failed - expected did not match actual.";
12-
}
10+
assert.strictEqual(options.toQueryString(), "?sort=purchases");
1311
}
1412

1513
function single_order() {
1614
let options = new SortOptions();
1715
options.order = "asc";
18-
19-
if (options.toQueryString() !== "?order=asc") {
20-
throw "single_order() failed - expected did not match actual.";
21-
}
16+
assert.strictEqual(options.toQueryString(), "?order=asc");
2217
}
2318

2419
function single_page() {
2520
let options = new SortOptions();
2621
options.page = 5;
27-
28-
if (options.toQueryString() !== "?page=5") {
29-
throw "single_page() failed - expected did not match actual.";
30-
}
22+
assert.strictEqual(options.toQueryString(), "?page=5");
3123
}
3224

3325
single_sort();

0 commit comments

Comments
 (0)