mirror of
https://github.com/aleleba/create-react-ssr.git
synced 2025-01-09 13:36:54 -06:00
Passing Test, routes and config to ts and tsx format.
This commit is contained in:
parent
5fb382832d
commit
1c5117f6d4
@ -3,4 +3,4 @@ const config = {
|
|||||||
port: process.env.PORT ? process.env.PORT : 80,
|
port: process.env.PORT ? process.env.PORT : 80,
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = { config: config };
|
export default config;
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@aleleba/create-react-ssr",
|
"name": "@aleleba/create-react-ssr",
|
||||||
"version": "2.0.2",
|
"version": "2.0.3",
|
||||||
"description": "Starter Kit of server side render of react",
|
"description": "Starter Kit of server side render of react",
|
||||||
"bin": "./bin/cli.js",
|
"bin": "./bin/cli.js",
|
||||||
"main": "src/server/index",
|
"main": "src/server/index",
|
||||||
|
@ -5,17 +5,17 @@ import App from '../App';
|
|||||||
|
|
||||||
describe('<App/> Component', () => {
|
describe('<App/> Component', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fetch.resetMocks();
|
fetchMock.resetMocks();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Should render root <App /> Component', async () => {
|
test('Should render root <App /> Component', async () => {
|
||||||
fetch.mockResponseOnce(JSON.stringify({
|
fetchMock.mockResponseOnce(JSON.stringify({
|
||||||
//First Data Fetch
|
//First Data Fetch
|
||||||
data: 'data'
|
data: 'data'
|
||||||
}));
|
}));
|
||||||
|
|
||||||
render(
|
render(
|
||||||
<ProviderMock>
|
<ProviderMock initialState={undefined}>
|
||||||
<App />
|
<App />
|
||||||
</ProviderMock>
|
</ProviderMock>
|
||||||
)
|
)
|
@ -6,7 +6,7 @@ import { BrowserRouter as Router } from 'react-router-dom';
|
|||||||
import { Provider } from 'react-redux';
|
import { Provider } from 'react-redux';
|
||||||
import { IInitialState } from './reducers/index';
|
import { IInitialState } from './reducers/index';
|
||||||
import setStore from './setStore';
|
import setStore from './setStore';
|
||||||
import { config } from '../../config';
|
import config from '../../config';
|
||||||
|
|
||||||
import './styles/global.sass';
|
import './styles/global.sass';
|
||||||
import App from './components/App';
|
import App from './components/App';
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
import { createStore } from 'redux'; //, applyMiddleware
|
import { createStore } from 'redux'; //, applyMiddleware
|
||||||
// import { Provider } from 'react-redux';
|
// import { Provider } from 'react-redux';
|
||||||
import { composeWithDevTools as composeWithDevToolsWeb } from 'redux-devtools-extension';
|
import { composeWithDevTools as composeWithDevToolsWeb } from 'redux-devtools-extension';
|
||||||
import { config } from '../../config';
|
import config from '../../config';
|
||||||
import reducer, { IInitialState } from './reducers';
|
import reducer, { IInitialState } from './reducers';
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
//Dependencies of Server
|
//Dependencies of Server
|
||||||
import express from 'express';
|
import express from 'express';
|
||||||
import { config } from '../../config';
|
import config from '../../config';
|
||||||
import webpack from 'webpack';
|
import webpack from 'webpack';
|
||||||
import helmet from 'helmet';
|
import helmet from 'helmet';
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user