Welcome to mirror list, hosted at ThFree Co, Russian Federation.

did-you-mean.js « utils « lib « test - github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0c9c95c7f9e60f5452a1dbb27b3204c472f3f04f (plain)
1
2
3
4
5
6
7
const t = require('tap')
const dym = require('../../../lib/utils/did-you-mean.js')
t.equal(dym('asdfa', ['asdf', 'asfd', 'adfs', 'safd', 'foobarbaz', 'foobar']),
  '\nDid you mean this?\n    asdf')
t.equal(dym('asdfa', ['asdf', 'sdfa', 'foo', 'bar', 'fdsa']),
  '\nDid you mean one of these?\n    asdf\n    sdfa')
t.equal(dym('asdfa', ['install', 'list', 'test']), '')