File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+ // Copyright (c) 2021 MC-Market (Mick Capital Pty. Ltd.)
2+ // MIT License (https://github.com/MC-Market-org/js-api-wrapper/blob/main/LICENSE)
3+
4+ const { SortOptions } = require ( "../src/SortOptions.js" ) ;
5+
6+ function single_sort ( ) {
7+ let options = new SortOptions ( ) ;
8+ options . sort = "purchases" ;
9+
10+ if ( options . toQueryString ( ) !== "?sort=purchases" ) {
11+ throw "single_sort() failed - expected did not match actual." ;
12+ }
13+ }
14+
15+ function single_order ( ) {
16+ let options = new SortOptions ( ) ;
17+ options . order = "asc" ;
18+
19+ if ( options . toQueryString ( ) !== "?order=asc" ) {
20+ throw "single_order() failed - expected did not match actual." ;
21+ }
22+ }
23+
24+ function single_page ( ) {
25+ let options = new SortOptions ( ) ;
26+ options . page = 5 ;
27+
28+ if ( options . toQueryString ( ) !== "?page=5" ) {
29+ throw "single_page() failed - expected did not match actual." ;
30+ }
31+ }
32+
33+ single_sort ( ) ;
34+ single_order ( ) ;
35+ single_page ( ) ;
Original file line number Diff line number Diff line change 22// MIT License (https://github.com/MC-Market-org/js-api-wrapper/blob/main/LICENSE)
33
44require ( "./base.js" ) ;
5+ require ( "./sort_options.js" ) ;
6+
57throw "Test" ;
You can’t perform that action at this time.
0 commit comments