warn users when they use unsupported options (#386)

* warn users about unsupported options

* do the rest

* don't report that Warn() isn't tested
This commit is contained in:
Boris Verkhovskiy
2022-04-16 21:56:33 -07:00
committed by GitHub
parent d83919e85c
commit 467f093a72
23 changed files with 1086 additions and 160 deletions

View File

@@ -10,7 +10,7 @@ export const fixturesDir = path.resolve(__dirname, "../../test/fixtures");
// Special case that returns the parsed argument object
const toParser = (curl: string | string[]): string => {
const parserOutput = utils.parseCurlCommand(curl);
const [parserOutput, warnings] = utils.parseCurlCommand(curl);
const code = JSON.stringify(parserOutput, null, 2);
return code + "\n";
};
@@ -132,7 +132,7 @@ const availableConverters = Object.entries(curlconverter)
.map((c) => c[1].name)
.filter((n) => n !== "CCError");
const missing = availableConverters.filter(
(c) => !testedConverters.includes(c)
(c) => !testedConverters.includes(c) && !c.endsWith("Warn")
);
const extra = testedConverters.filter(
(c) => !availableConverters.includes(c) && c !== "toParser"