Skip to content

Commit

Permalink
Merge pull request #679 from unexpectedjs/ssimonsen/ukkonen
Browse files Browse the repository at this point in the history
Replace leven with ukkonen
  • Loading branch information
sunesimonsen committed Dec 26, 2019
2 parents 9666674 + 24d3926 commit 2fdba25
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/createTopLevelExpect.js
Expand Up @@ -2,7 +2,7 @@ const createStandardErrorMessage = require('./createStandardErrorMessage');
const utils = require('./utils');
const magicpen = require('magicpen');
const extend = utils.extend;
const leven = require('leven');
const ukkonen = require('ukkonen');
const makePromise = require('./makePromise');
const addAdditionalPromiseMethods = require('./addAdditionalPromiseMethods');
const wrapPromiseIfNecessary = require('./wrapPromiseIfNecessary');
Expand Down Expand Up @@ -1141,7 +1141,7 @@ expectPrototype.throwAssertionNotFoundError = function(
};

assertionStrings.forEach(assertionString => {
const score = leven(testDescriptionString, assertionString);
const score = ukkonen(testDescriptionString, assertionString);

assertionsWithScore.push({
assertion: assertionString,
Expand Down
4 changes: 2 additions & 2 deletions lib/types.js
Expand Up @@ -2,7 +2,7 @@ const utils = require('./utils');
const isRegExp = utils.isRegExp;
const leftPad = utils.leftPad;
const arrayChanges = require('array-changes');
const leven = require('leven');
const ukkonen = require('ukkonen');
const detectIndent = require('detect-indent');
const defaultDepth = require('./defaultDepth');
const AssertionString = require('./AssertionString');
Expand Down Expand Up @@ -371,7 +371,7 @@ module.exports = function(expect) {
}

if (typeA === 'string') {
return leven(a, b) < a.length / 2;
return ukkonen(a, b) < a.length / 2;
}

if (typeA !== 'object' || !a) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -29,8 +29,8 @@
"detect-indent": "3.0.1",
"diff": "4.0.1",
"greedy-interval-packer": "1.2.0",
"leven": "2.1.0",
"magicpen": "^6.1.1",
"ukkonen": "^1.4.0",
"unexpected-bluebird": "2.9.34-longstack2"
},
"devDependencies": {
Expand Down

0 comments on commit 2fdba25

Please sign in to comment.