lava-oushudb-dt-sql-parser/test/jest.d.ts
JackWang032 a05f099aa1
feat: add toMatchUnorderedArrary matcher and apply it (#271)
* feat: add toMatchUnorderedArrary matcher replace tokenSuggestion test

* fix: revert benchmark and replace matcher of trinosql

---------

Co-authored-by: jialan <jialan@dtstack.com>
2024-03-01 16:48:53 +08:00

18 lines
615 B
TypeScript

namespace jest {
interface Matchers<R = void, T = {}> {
/**
* @description
* Check whether two arrays are equal without considering the order of items.
*
* Make sure expected array has no duplicate item.
*
* Every item must be primitive type, like string, number, etc.
*
* @example
* expect(['a', 'b']).toMatchUnorderedArrary(['b', 'a']) // pass
* expect(['b', 'a']).toMatchUnorderedArrary(['c', 'b', 'a']) // not pass, missing item 'c'
*/
toMatchUnorderedArrary(expected: unknown[]): R;
}
}