mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-05 21:00:18 +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', () => {
|
||||
const r = spawnSync(
|
||||
'ts-node',
|
||||
['../../../index.ts', 'build', ' ../../../../demo/openapi.yaml', '--output=redocTest.html'],
|
||||
['../../../index.ts', 'build', ' ../../../../demo/openapi.yaml', '--output=redoc-test.html'],
|
||||
{
|
||||
cwd: __dirname,
|
||||
shell: true,
|
||||
|
@ -17,7 +17,7 @@ describe('build', () => {
|
|||
const result = `${out}\n${err}`;
|
||||
|
||||
try {
|
||||
const redocStaticFile = readFileSync(`${__dirname}/redocTest.html`, 'utf8');
|
||||
const redocStaticFile = readFileSync(`${__dirname}/redoc-test.html`, 'utf8');
|
||||
expect(redocStaticFile).toContain('"options":{"disableSearch":true}');
|
||||
expect(redocStaticFile).not.toContain('role="search"');
|
||||
} 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