-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5bb0bdf
commit ef4e6d8
Showing
5 changed files
with
28 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import * as React from 'react'; | ||
import { renderToString } from 'react-dom/server'; | ||
import { Redoc, createStore } from '../'; | ||
var yaml = require('yaml-js'); | ||
|
||
import { readFileSync } from 'fs'; | ||
import { resolve } from 'path'; | ||
|
||
describe('SSR', () => { | ||
it('should render in SSR mode', async () => { | ||
(global as any).__DEV__ = true; | ||
const spec = yaml.load(readFileSync(resolve(__dirname, '../../demo/openapi.yaml'))); | ||
const store = await createStore(spec, ''); | ||
expect(() => { | ||
renderToString(<Redoc store={store} />); | ||
}).not.toThrow(); | ||
|
||
delete (global as any).__DEV__; | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters