forked from boardgameio/boardgame.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enabling server-side-rendering for boardgame.io (fixes boardgameio#22) (
boardgameio#140) * Removing react-json-view dependency to allow SSR * Disabling socket io connection for ssr * Creating test for Server side rendering * update package-lock.json * replace quotes with <strong>
- Loading branch information
1 parent
80cbd06
commit 7d6f951
Showing
5 changed files
with
48 additions
and
85 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,24 @@ | ||
/** | ||
* @jest-environment node | ||
*/ | ||
|
||
import React from 'react'; | ||
import { Client } from './react'; | ||
import Game from '../core/game'; | ||
import ReactDOMServer from 'react-dom/server'; | ||
|
||
class TestBoard extends React.Component { | ||
render() { | ||
return <div id="board">Board</div>; | ||
} | ||
} | ||
|
||
test('board is rendered - ssr', () => { | ||
const Board = Client({ | ||
game: Game({}), | ||
board: TestBoard, | ||
multiplayer: true, | ||
}); | ||
let ssrRender = ReactDOMServer.renderToString(<Board />); | ||
expect(ssrRender).toContain('debug-ui'); | ||
}); |