mirror of
https://github.com/aleleba/create-react-ssr.git
synced 2025-06-19 12:28:37 -06:00
PR-420915: Changing the logic for aliases for one source of truth on tsconfig.json and updating packages.
This commit is contained in:
4
src/@types/index.d.ts
vendored
4
src/@types/index.d.ts
vendored
@ -2,7 +2,3 @@ declare module "*.svg" {
|
||||
const content: any;
|
||||
export default content;
|
||||
}
|
||||
|
||||
declare module "@config" {
|
||||
export const config: any;
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import { createMemoryHistory } from 'history';
|
||||
import initialStateReducer from '../frontend/reducers/initialState';
|
||||
import setStore from '../frontend/setStore';
|
||||
|
||||
const ProviderMock = ({ children, initialState }) => {
|
||||
export const ProviderMock = ({ children, initialState }: { children: any, initialState?: any}) => {
|
||||
let initialStateMock = initialStateReducer
|
||||
|
||||
if(initialState !== undefined){
|
||||
@ -24,4 +24,4 @@ const ProviderMock = ({ children, initialState }) => {
|
||||
)
|
||||
}
|
||||
|
||||
export default ProviderMock;
|
||||
export default ProviderMock;
|
@ -1 +1,2 @@
|
||||
module.exports = '';
|
||||
export const fileMock = '';
|
||||
module.exports = fileMock;
|
||||
|
1
src/__mocks__/index.ts
Normal file
1
src/__mocks__/index.ts
Normal file
@ -0,0 +1 @@
|
||||
export * from './ProviderMock';
|
@ -14,7 +14,7 @@ export interface IChangeHelloPayload {
|
||||
export type TTest = IChangeHello
|
||||
|
||||
const changeHello = (payload: string) => ({
|
||||
type: 'CREATE_USER',
|
||||
type: ActionTypesTest.ChangeHello,
|
||||
payload
|
||||
})
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import { render } from '@testing-library/react';
|
||||
import ProviderMock from '../../../__mocks__/ProviderMock';
|
||||
import App from '../App';
|
||||
import { ProviderMock } from '@mocks';
|
||||
import App from '@components/App';
|
||||
|
||||
describe('<App/> Component', () => {
|
||||
beforeEach(() => {
|
||||
@ -15,7 +15,7 @@ describe('<App/> Component', () => {
|
||||
}));
|
||||
|
||||
render(
|
||||
<ProviderMock initialState={undefined}>
|
||||
<ProviderMock>
|
||||
<App />
|
||||
</ProviderMock>
|
||||
)
|
||||
|
Reference in New Issue
Block a user