smartfuzzy/test/test.objectsorter.ts

20 lines
448 B
TypeScript

import { expect, tap } from '@push.rocks/tapbundle';
import * as smartfuzzy from '../ts/index.js';
tap.test('should sort objects', async () => {
class Car {
constructor(public brand: string) {}
}
const testObjectSorter = new smartfuzzy.ObjectSorter<Car>([
new Car('BMW'),
new Car('Mercedes Benz'),
new Car('Volvo'),
]);
const result = testObjectSorter.sort('Volvo', ['brand']);
console.log(result);
});
tap.start();