mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-07 13:44:54 +03:00
chore: add test for build with url and improve file-naming
This commit is contained in:
parent
7ceb434034
commit
754688ba60
|
@ -5,7 +5,7 @@ describe('build', () => {
|
||||||
it('should use .redocly.yaml', () => {
|
it('should use .redocly.yaml', () => {
|
||||||
const r = spawnSync(
|
const r = spawnSync(
|
||||||
'ts-node',
|
'ts-node',
|
||||||
['../../../index.ts', 'build', ' ../../../../demo/openapi.yaml', '--output=redocTest.html'],
|
['../../../index.ts', 'build', ' ../../../../demo/openapi.yaml', '--output=redoc-test.html'],
|
||||||
{
|
{
|
||||||
cwd: __dirname,
|
cwd: __dirname,
|
||||||
shell: true,
|
shell: true,
|
||||||
|
@ -17,7 +17,7 @@ describe('build', () => {
|
||||||
const result = `${out}\n${err}`;
|
const result = `${out}\n${err}`;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const redocStaticFile = readFileSync(`${__dirname}/redocTest.html`, 'utf8');
|
const redocStaticFile = readFileSync(`${__dirname}/redoc-test.html`, 'utf8');
|
||||||
expect(redocStaticFile).toContain('"options":{"disableSearch":true}');
|
expect(redocStaticFile).toContain('"options":{"disableSearch":true}');
|
||||||
expect(redocStaticFile).not.toContain('role="search"');
|
expect(redocStaticFile).not.toContain('role="search"');
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
25
cli/__test__/build/configRedoc/url.test.ts
Normal file
25
cli/__test__/build/configRedoc/url.test.ts
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
import { spawnSync } from 'child_process';
|
||||||
|
|
||||||
|
describe('build with url', () => {
|
||||||
|
// FIXME: remove skip after release
|
||||||
|
it.skip('should not fail on resolving url', () => {
|
||||||
|
const r = spawnSync(
|
||||||
|
'ts-node',
|
||||||
|
[
|
||||||
|
'../../../index.js',
|
||||||
|
'build',
|
||||||
|
'http://petstore.swagger.io/v2/swagger.json',
|
||||||
|
'--output=url-test.html',
|
||||||
|
],
|
||||||
|
{
|
||||||
|
cwd: __dirname,
|
||||||
|
shell: true,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
const out = r.stdout.toString('utf-8');
|
||||||
|
const err = r.stderr.toString('utf-8');
|
||||||
|
const result = `${out}\n${err}`;
|
||||||
|
expect(result).toContain('bundled successfully');
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user