Skip to content
This repository was archived by the owner on Apr 19, 2024. It is now read-only.

Commit c9031e2

Browse files
authored
Merge pull request #3 from rodolfo2488/fix-types
Thanks Rodolfo, merging this in and I may refactor where I can
2 parents c2e2f1a + b3de5b4 commit c9031e2

File tree

6 files changed

+14
-10
lines changed

6 files changed

+14
-10
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
"license": "ISC",
1919
"devDependencies": {
2020
"@types/enzyme": "^2.7.7",
21-
"@types/jasmine": "^2.5.47",
2221
"@types/jest": "19.2.2",
2322
"@types/react": "^15.0.21",
2423
"@types/react-addons-test-utils": "0.14.18",

src/Hello/__test__/hello.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import DefaultState from "../interfaces/defaultState";
12
jest.mock("../actions");
23

34
import * as React from "react";
@@ -10,9 +11,8 @@ import Counter from "../containers/Counter";
1011
import {IRootState} from "../../rootReducer";
1112
import {incrementAction, decrementAction} from "../actions";
1213

13-
1414
describe("Hello Component", () => {
15-
let helloComponent: ShallowWrapper<Hello, any>;
15+
let helloComponent: ShallowWrapper<Hello, DefaultState>;
1616
let props: HelloProps;
1717
let increment: ActionFunction0<Action<void>>;
1818
let decrement: ActionFunction0<Action<void>>;
@@ -65,7 +65,7 @@ describe("Hello Component", () => {
6565
counters: counters
6666
};
6767

68-
let props = mapStateToProps(state);
68+
let props : any = mapStateToProps(state);
6969

7070
expect(props.counter).toBe(1);
7171
});

src/Hello/actions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ export enum actionTypes {
55
DECREMENT
66
}
77

8-
export const incrementAction = createAction<void>(
8+
export const incrementAction : any = createAction<void>(
99
actionTypes.INCREMENT.toString(),
1010
() => {
1111
}
1212
);
1313

14-
export const decrementAction = createAction<void>(
14+
export const decrementAction : any = createAction<void>(
1515
actionTypes.DECREMENT.toString(),
1616
() => {
1717
}

src/Hello/containers/__test__/Counter.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import * as React from "react";
2-
import {shallow} from "enzyme";
2+
import {shallow, ShallowWrapper} from "enzyme";
33

44
import Counter from "../Counter";
55

66
describe("counter container", () => {
7-
let subject: any,
7+
let subject: ShallowWrapper<T, any>,
88
mockIncrement: () => {},
99
mockDecrement: () => {};
1010
beforeEach(() => {

src/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import * as React from "react";
22
import * as ReactDOM from "react-dom";
3-
import { Provider } from 'react-redux';
3+
import {Provider, Store} from 'react-redux';
44

55
import configureStore from "./configureStore";
66
import Hello from "./Hello/Hello";
77

8-
const store = configureStore();
8+
const store : Store<any> = configureStore();
99
ReactDOM.render(
1010
<Provider store={store}>
1111
<Hello/>

tsconfig.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,10 @@
1717
},
1818
"include": [
1919
"src/**/*"
20+
],
21+
"exclude": [
22+
"node_modules",
23+
"%40types",
24+
"**/*.test.*"
2025
]
2126
}

0 commit comments

Comments
 (0)