Huáng Jùnliàng f2da186714
refactor: add @babel/helper-validator-option (#12006)
* refactor: add @babel/helper-validator-option

* refactor: simplify validateTopLevelOptions

* perf: the recursive version is not practically fast

* Update packages/babel-helper-validator-option/README.md

Co-authored-by: Brian Ng <bng412@gmail.com>

* Update packages/babel-helper-validator-option/src/validator.js

* fix: incorrect type annotation

* refactor: use babel/helper-option-validator in babel/compat-data

* chore: fix flow types error

* Address review comments

* address review comments

Co-authored-by: Brian Ng <bng412@gmail.com>
2020-09-24 16:23:35 -04:00

11 lines
300 B
JavaScript

import { findSuggestion } from "..";
describe("findSuggestion", function () {
test.each([
["cat", ["cow", "dog", "pig"], "cow"],
["uglifyjs", [], undefined],
])("findSuggestion(%p, %p) returns %p", (str, arr, expected) => {
expect(findSuggestion(str, arr)).toBe(expected);
});
});