UNPKG

shamjs

Version:
26 lines (24 loc) 682 B
var expect = require('expect.js') var sham = require('../../lib/index') describe('query/fuzzy.js', function () { it('fuzzy(content, target)', function () { expect( sham.query.fuzzy("abcdef", "abc") ).to.be.ok() expect( sham.query.fuzzy("abcdef", "123") ).to.not.be.ok() expect( sham.query.fuzzy("123456", 12) ).to.be.ok() expect( sham.query.fuzzy(undefined, 'undefined') ).to.not.be.ok() expect( sham.query.fuzzy("123456", undefined) ).to.be.ok() expect( sham.query.fuzzy("123456", '') ).to.be.ok() }) })