Migrate navigation tests
Summary: Migrated all the tests. I've put these in a single diff as there were only a couple of lines that had to be changed in each file. Reviewed By: danielbuechele Differential Revision: D17181587 fbshipit-source-id: cdcc20d71a47e786db4cefbebe9ea686d5e235e5
This commit is contained in:
committed by
Facebook Github Bot
parent
5b883351c4
commit
d7814b19da
@@ -6,17 +6,14 @@
|
|||||||
* @flow strict-local
|
* @flow strict-local
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {filterMatchPatterns} from '../util/autoCompleteProvider.tsx';
|
import {filterMatchPatterns} from '../util/autoCompleteProvider';
|
||||||
|
|
||||||
import type {URI} from '../flow-types';
|
import {URI} from '../types';
|
||||||
|
|
||||||
// choose all k length combinations from array
|
// choose all k length combinations from array
|
||||||
const stringCombination: (Array<string>, number) => Array<string> = (
|
const stringCombination = (patterns: Array<string>, k: number) => {
|
||||||
patterns,
|
|
||||||
k,
|
|
||||||
) => {
|
|
||||||
const n = patterns.length;
|
const n = patterns.length;
|
||||||
const returnArr = new Array(0);
|
const returnArr: Array<string> = new Array(0);
|
||||||
const args = new Array(k).fill(0).map((_, idx) => idx);
|
const args = new Array(k).fill(0).map((_, idx) => idx);
|
||||||
(function build(args) {
|
(function build(args) {
|
||||||
const pattern = args.map(i => patterns[i]).join('');
|
const pattern = args.map(i => patterns[i]).join('');
|
||||||
@@ -11,7 +11,7 @@ import {
|
|||||||
parameterIsNumberType,
|
parameterIsNumberType,
|
||||||
replaceRequiredParametersWithValues,
|
replaceRequiredParametersWithValues,
|
||||||
filterOptionalParameters,
|
filterOptionalParameters,
|
||||||
} from '../util/uri.tsx';
|
} from '../util/uri';
|
||||||
|
|
||||||
test('parse required parameters from uri', () => {
|
test('parse required parameters from uri', () => {
|
||||||
const testURI =
|
const testURI =
|
||||||
Reference in New Issue
Block a user