Getting Started
Some text
Other Section
Other text
Yet Another Section
More text
describe('Basic html theme search', function() { describe('terms search', function() { it('should find "C++" when in index', function() { index = { docnames:["index"], filenames:["index.rst"], terms:{'c++':0}, titles:["<no title>"], titleterms:{} } Search.setIndex(index); searchterms = ['c++']; excluded = []; terms = index.terms; titleterms = index.titleterms; hits = [[ "index", "<no title>", "", null, 5, "index.rst" ]]; expect(Search.performTermsSearch(searchterms, excluded, terms, titleterms)).toEqual(hits); }); it('should be able to search for multiple terms', function() { index = { alltitles: { 'Main Page': [[0, 'main-page']], }, docnames:["index"], filenames:["index.rst"], terms:{main:0, page:0}, titles:["Main Page"], titleterms:{ main:0, page:0 } } Search.setIndex(index); searchterms = ['main', 'page']; excluded = []; terms = index.terms; titleterms = index.titleterms; hits = [[ 'index', 'Main Page', '', null, 15, 'index.rst']]; expect(Search.performTermsSearch(searchterms, excluded, terms, titleterms)).toEqual(hits); }); it('should partially-match "sphinx" when in title index', function() { index = { docnames:["index"], filenames:["index.rst"], terms:{'useful': 0, 'utilities': 0}, titles:["sphinx_utils module"], titleterms:{'sphinx_utils': 0} } Search.setIndex(index); searchterms = ['sphinx']; excluded = []; terms = index.terms; titleterms = index.titleterms; hits = [[ "index", "sphinx_utils module", "", null, 7, "index.rst" ]]; expect(Search.performTermsSearch(searchterms, excluded, terms, titleterms)).toEqual(hits); }); }); }); describe("htmlToText", function() { const testHTML = `
Some text
Other text
More text