Added list property in typings (#348)

This commit is contained in:
Elvin Dzhavadov 2020-03-02 05:42:21 +02:00 committed by GitHub
parent 2efc7b3242
commit be759d5c08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

1
src/typings.d.ts vendored
View File

@ -28,6 +28,7 @@ declare class Fuse<T, O extends Fuse.FuseOptions<T>> {
)
setCollection(list: ReadonlyArray<T>): ReadonlyArray<T>;
list: ReadonlyArray<T>
}
declare namespace Fuse {

View File

@ -42,6 +42,10 @@ describe('Flat list of strings: ["Apple", "Orange", "Banana"]', () => {
expect(fuse).toMatchObject(expected)
})
it('should have the list property', () => {
expect(fuse.list).toBe(defaultList)
})
describe('When searching for the term "Apple"', () => {
let result
beforeEach(() => result = fuse.search('Apple'))