UNPKG

bit-bin

Version:

<a href="https://opensource.org/licenses/Apache-2.0"><img alt="apache" src="https://img.shields.io/badge/License-Apache%202.0-blue.svg"></a> <a href="https://github.com/teambit/bit/blob/master/CONTRIBUTING.md"><img alt="prs" src="https://img.shields.io/b

32 lines 1.2 kB
// import { expect } from 'chai'; // import sinon from 'sinon'; // import * as path from 'path'; // import searchIndex from 'search-index'; // import serverlessIndex from '../search/serverless-index'; // // describe('SeverLessIndex', () => { // describe('initializeIndex', () => { // it('should initial the index using search-index lib with some default settings', () => { // // this hack was taken from: https://github.com/sinonjs/sinon/issues/562#issuecomment-164522794 // // it is needed because search-index library returns a function, not object. // const myStubbedModule = (moduleName) => { // const stub = sinon.stub(); // require.cache[require.resolve(moduleName)] = { // default: stub, // exports: stub // }; // return stub; // }; // myStubbedModule('search-index'); // const result = serverlessIndex.initializeIndex('test_path'); // // sinon.assert.calledWith(searchIndex, { // indexPath: path.normalize('test_path/search_index'), // logLevel: 'error', // stopwords: [] // }); // expect(result).to.be.a('Promise'); // }); // }); // }); "use strict";