fix: smoke tests and update redoc to v2.1 (#1242)

This commit is contained in:
Ihor Karpiuk
2023-08-22 17:57:57 +03:00
committed by GitHub
parent 06c8fda196
commit c4c7e21880
8 changed files with 218 additions and 108 deletions

View File

@@ -0,0 +1,5 @@
---
'@redocly/cli': patch
---
Updated redoc to v2.1.0.

View File

@@ -50,7 +50,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 20
- run: bash ./__tests__/smoke/run-smoke.sh "npm i redoc redocly-cli.tgz" "npm run"
- run: bash ./__tests__/smoke/run-smoke.sh "npm i redoc redocly-cli.tgz --legacy-peer-deps" "npm run"
run-smoke--npm--node-18:
needs: prepare-smoke
@@ -76,7 +76,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 18
- run: bash ./__tests__/smoke/run-smoke.sh "npm i redoc redocly-cli.tgz" "npm run"
- run: bash ./__tests__/smoke/run-smoke.sh "npm i redoc redocly-cli.tgz --legacy-peer-deps" "npm run"
run-smoke--npm--node-16:
needs: prepare-smoke
@@ -102,7 +102,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 16
- run: bash ./__tests__/smoke/run-smoke.sh "npm i redoc redocly-cli.tgz" "npm run"
- run: bash ./__tests__/smoke/run-smoke.sh "npm i redoc redocly-cli.tgz --legacy-peer-deps" "npm run"
run-smoke--npm--node-14:
needs: prepare-smoke
@@ -241,9 +241,9 @@ jobs:
docker run --rm -v $PWD:/spec redocly/cli:latest bundle openapi.yaml --ext json
docker run --rm -v $PWD:/spec redocly/cli:latest build-docs openapi.yaml
# Check for broken styles (related issue: https://github.com/Redocly/redocly-cli/issues/1073)
if [[ "$(wc -l redoc-static.html)" == "317 redoc-static.html" ]]; then
if [[ "$(wc -l redoc-static.html)" == "319 redoc-static.html" ]]; then
echo "Docs built correctly."
else
echo "Docs built incorrectly. Received lines: $(wc -l redoc-static.html) (expected 317 lines in redoc-static.html)."
echo "Docs built incorrectly. Received lines: $(wc -l redoc-static.html) (expected 319 lines in redoc-static.html)."
exit 1
fi

View File

@@ -2,7 +2,7 @@
exports[`E2E build-docs build docs with config option 1`] = `
🎉 bundled successfully in: nested/redoc-static.html (38 KiB) [⏱ <test>ms].
🎉 bundled successfully in: nested/redoc-static.html (39 KiB) [⏱ <test>ms].
Found nested/redocly.yaml and using theme.openapi options
Prerendering docs

View File

@@ -2,7 +2,7 @@
exports[`E2E build-docs simple build-docs 1`] = `
🎉 bundled successfully in: redoc-static.html (318 KiB) [⏱ <test>ms].
🎉 bundled successfully in: redoc-static.html (321 KiB) [⏱ <test>ms].
Found undefined and using theme.openapi options
Prerendering docs

View File

@@ -397,7 +397,7 @@ describe('E2E', () => {
(<any>expect(result)).toMatchSpecificSnapshot(join(testPath, 'snapshot.js'));
expect(fs.existsSync(join(testPath, 'nested/redoc-static.html'))).toEqual(true);
expect(fs.statSync(join(testPath, 'nested/redoc-static.html')).size).toEqual(38839);
expect(fs.statSync(join(testPath, 'nested/redoc-static.html')).size).toEqual(38998);
});
});
});

View File

@@ -17,9 +17,9 @@ $2 redocly-lint
$2 redocly-bundle
$2 redocly-build-docs
# Check for broken styles (related issue: https://github.com/Redocly/redocly-cli/issues/1073)
if [[ "$(wc -l redoc-static.html)" == "317 redoc-static.html" ]]; then
if [[ "$(wc -l redoc-static.html)" == "319 redoc-static.html" ]]; then
echo "Docs built correctly."
else
echo "Docs built incorrectly. Received lines: $(wc -l redoc-static.html) (expected 317 lines in redoc-static.html)."
echo "Docs built incorrectly. Received lines: $(wc -l redoc-static.html) (expected 319 lines in redoc-static.html)."
exit 1
fi

299
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -44,7 +44,7 @@
"mobx": "^6.0.4",
"react": "^17.0.0",
"react-dom": "^17.0.0",
"redoc": "~2.0.0",
"redoc": "~2.1.0",
"semver": "^7.5.2",
"simple-websocket": "^9.0.0",
"styled-components": "^5.1.1",