mirror of
https://github.com/LukeHagar/redocly-cli.git
synced 2025-12-10 12:47:49 +00:00
fix: cleanup version in e2e tests (#503)
This commit is contained in:
@@ -7,7 +7,7 @@ exports[`E2E bundle lint format bundle lint: should be formatted by format: json
|
||||
"warnings": 0,
|
||||
"ignored": 0
|
||||
},
|
||||
"version": "1.0.0-beta.78",
|
||||
"version": "<version>",
|
||||
"problems": [
|
||||
{
|
||||
"ruleId": "spec",
|
||||
@@ -31,7 +31,7 @@ exports[`E2E bundle lint format bundle lint: should be formatted by format: json
|
||||
"warnings": 0,
|
||||
"ignored": 0
|
||||
},
|
||||
"version": "1.0.0-beta.78",
|
||||
"version": "<version>",
|
||||
"problems": []
|
||||
}
|
||||
No configurations were defined in extends -- using built in recommended configuration by default.
|
||||
|
||||
@@ -13,9 +13,13 @@ expect.extend({
|
||||
|
||||
addSerializer({
|
||||
test: (val: any) => typeof val === 'string',
|
||||
print: (v: any) => v as string,
|
||||
print: (v: any) => cleanUpVersion(v),
|
||||
});
|
||||
|
||||
function cleanUpVersion(str: string): string {
|
||||
return str.replace(/"version":\s(\".*\")*/g, '"version": "<version>"');
|
||||
}
|
||||
|
||||
function getEntrypoints(folderPath: string) {
|
||||
const redoclyYamlFile = readFileSync(join(folderPath, ".redocly.yaml"), "utf8");
|
||||
const redoclyYaml = parseYaml(redoclyYamlFile) as { apiDefinitions: Record<string, string>; };
|
||||
|
||||
Reference in New Issue
Block a user