Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb12f581

Browse files
committed
unit testing setup
1 parentf52d173 commitb12f581

File tree

8 files changed

+790
-14
lines changed

8 files changed

+790
-14
lines changed

‎package.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"react-redux":"4.4.5",
4040
"react-router-sans-urls":"0.1.2",
4141
"react-tap-event-plugin":"1.0.0",
42-
"redux":"3.5.2",
42+
"redux":"3.6.0",
4343
"redux-logger":"2.6.1",
4444
"redux-thunk":"2.1.0",
4545
"reselect":"2.5.3"
@@ -56,5 +56,17 @@
5656
"1.0.0":"consumeStatusBar"
5757
}
5858
}
59+
},
60+
"devDependencies": {
61+
"enzyme":"^2.4.1",
62+
"jest":"^15.1.1",
63+
"react-addons-test-utils":"^15.3.1",
64+
"react-test-renderer":"^15.3.1",
65+
"tslint":"^3.15.1"
66+
},
67+
"jest": {
68+
"scriptPreprocessor":"<rootDir>/src/__tests__/preprocessor.js",
69+
"moduleFileExtensions": ["ts","tsx","js"],
70+
"testRegex":"/src/*/.*\\.test\\.(ts|tsx|js)$"
5971
}
6072
}

‎src/__tests__/preprocessor.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright 2004-present Facebook. All Rights Reserved.
2+
3+
consttsc=require('typescript');
4+
5+
module.exports={
6+
process(src,path){
7+
if(path.endsWith('.ts')||path.endsWith('.tsx')){
8+
returntsc.transpile(
9+
src,
10+
{
11+
module:tsc.ModuleKind.CommonJS,
12+
jsx:tsc.JsxEmit.React,
13+
},
14+
path,
15+
[]
16+
);
17+
}
18+
returnsrc;
19+
},
20+
};

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp