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
44 lines (36 loc) • 1.27 kB
JavaScript
;
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
function _chai() {
const data = require("chai");
_chai = function () {
return data;
};
return data;
}
function _indexer() {
const data = _interopRequireDefault(require("../search/indexer"));
_indexer = function () {
return data;
};
return data;
}
// @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
describe('Indexer', () => {
describe('tokenizeStr', () => {
it('should split by camelCase', () => {
(0, _chai().expect)(_indexer().default.tokenizeStr('camelCase')).to.equal('camel case');
});
it('should split by hyphen', () => {
(0, _chai().expect)(_indexer().default.tokenizeStr('foo-bar')).to.equal('foo bar');
});
it('should split by underscore', () => {
(0, _chai().expect)(_indexer().default.tokenizeStr('foo_bar')).to.equal('foo bar');
});
it('should lowercase', () => {
(0, _chai().expect)(_indexer().default.tokenizeStr('Foo')).to.equal('foo');
});
it('should tokenize various combinations', () => {
(0, _chai().expect)(_indexer().default.tokenizeStr('CamelCase-with-hyphen_and_underscore')).to.equal('camel case with hyphen and underscore');
});
});
});