diff --git a/lib/sort.test.js b/lib/sort.test.js index 2289ea9..0388d41 100644 --- a/lib/sort.test.js +++ b/lib/sort.test.js @@ -40,5 +40,16 @@ test('sort by age descending', () => { ]) }) +test('sort by new descending', () => { + const result = data.sort(sortby(['new', 'desc'])) + + + equal(result, [ + { age: 40, name: "Persone 1", new: true }, + { age: 17, name: "Persone 2", new: false }, + ]) +}) + + import { runifmain, summaryreporter, errorreporter } from 'metaltest' await runifmain(import.meta, () => test.run(summaryreporter(), errorreporter())) \ No newline at end of file