krisk / Fuse

Lightweight fuzzy-search, in JavaScript
https://fusejs.io/
Apache License 2.0
18.36k stars 772 forks source link

Installing Fuse using yarn does not return a constructor in jsdom #328

Closed Shivang-Bhandari closed 5 years ago

Shivang-Bhandari commented 5 years ago

Installed fuse in one of my projects using yarn and it throws an error in tests built using Jest

Usage

import Fuse from "fuse.js";
const Fuse = _fuse.current = new Fuse(options, fuseOptions);

Error:

TypeError: _fuse.default is not a constructor

doing an npm install works and fixes this issue.

Shivang-Bhandari commented 5 years ago

deleting the yarn.lock and node_modules files and doing yarn install again fixed this.