Passing Test, routes and config to ts and tsx format.

This commit is contained in:
Alejandro Lembke Barrientos 2022-05-23 15:32:14 +00:00
parent 5fb382832d
commit 1c5117f6d4
7 changed files with 8 additions and 8 deletions

View File

@ -3,4 +3,4 @@ const config = {
port: process.env.PORT ? process.env.PORT : 80,
};
module.exports = { config: config };
export default config;

View File

@ -1,6 +1,6 @@
{
"name": "@aleleba/create-react-ssr",
"version": "2.0.2",
"version": "2.0.3",
"description": "Starter Kit of server side render of react",
"bin": "./bin/cli.js",
"main": "src/server/index",

View File

@ -5,17 +5,17 @@ import App from '../App';
describe('<App/> Component', () => {
beforeEach(() => {
fetch.resetMocks();
fetchMock.resetMocks();
});
test('Should render root <App /> Component', async () => {
fetch.mockResponseOnce(JSON.stringify({
fetchMock.mockResponseOnce(JSON.stringify({
//First Data Fetch
data: 'data'
}));
render(
<ProviderMock>
<ProviderMock initialState={undefined}>
<App />
</ProviderMock>
)

View File

@ -6,7 +6,7 @@ import { BrowserRouter as Router } from 'react-router-dom';
import { Provider } from 'react-redux';
import { IInitialState } from './reducers/index';
import setStore from './setStore';
import { config } from '../../config';
import config from '../../config';
import './styles/global.sass';
import App from './components/App';

View File

@ -2,7 +2,7 @@
import { createStore } from 'redux'; //, applyMiddleware
// import { Provider } from 'react-redux';
import { composeWithDevTools as composeWithDevToolsWeb } from 'redux-devtools-extension';
import { config } from '../../config';
import config from '../../config';
import reducer, { IInitialState } from './reducers';

View File

@ -1,6 +1,6 @@
//Dependencies of Server
import express from 'express';
import { config } from '../../config';
import config from '../../config';
import webpack from 'webpack';
import helmet from 'helmet';