File tree 5 files changed +82
-1
lines changed
5 files changed +82
-1
lines changed Original file line number Diff line number Diff line change @@ -9,4 +9,5 @@ __site_prerender__
9
9
internal
10
10
docs /api
11
11
dist
12
+ .tmp
12
13
* .swp
Original file line number Diff line number Diff line change 17
17
"babel-preset-es2015" : " ^6.9.0" ,
18
18
"babel-preset-react" : " ^6.11.1" ,
19
19
"bundle-loader" : " ^0.5.2" ,
20
+ "chai" : " ^3.5.0" ,
20
21
"css-loader" : " ^0.9.1" ,
21
22
"extract-text-webpack-plugin" : " ^0.3.8" ,
22
23
"faker" : " ^2.1.2" ,
26
27
"less" : " ^2.2.0" ,
27
28
"less-loader" : " ^2.0.0" ,
28
29
"marked" : " ^0.3.2" ,
30
+ "mocha" : " ^2.5.3" ,
29
31
"null-loader" : " ^0.1.0" ,
30
32
"postcss" : " ^4.0.2" ,
31
33
"postcss-custom-properties" : " 3.0.1" ,
34
+ "react" : " ^15.2.1" ,
35
+ "react-addons-test-utils" : " ^15.2.1" ,
32
36
"react-docgen" : " ^1.2.0" ,
33
37
"react-tools" : " ^0.12.2" ,
34
38
"style-loader" : " ^0.8.3" ,
44
48
"build-docs" : " ./build_helpers/buildAPIDocs.sh" ,
45
49
"publish-site" : " ./build_helpers/publishStaticSite.sh" ,
46
50
"publish-package" : " ./build_helpers/publishPackage.sh" ,
47
- "test" : " echo \" Error: no test specified\" && exit 1"
51
+ "test" : " mocha-webpack --webpack-config webpack.config-test.js \" src/**/*-test.js\" " ,
52
+ "test:watch" : " mocha-webpack --webpack-config webpack.config-test.js --watch \" src/**/*-test.js\" " ,
53
+ "test:server" : " webpack-dev-server --config webpack.config-test.js --hot --inline"
48
54
},
49
55
"repository" : {
50
56
"type" : " git" ,
Original file line number Diff line number Diff line change
1
+ import { assert } from 'chai' ;
2
+ import React from 'react' ;
3
+ import FixedDataTable from './FixedDataTableRoot' ;
4
+ import { createRenderer , isElement } from 'react-addons-test-utils' ;
5
+
6
+ const { Table, Column } = FixedDataTable ;
7
+
8
+ describe ( 'FixedDataTableRoot' , function ( ) {
9
+ describe ( 'render ' , function ( ) {
10
+ it ( 'should not crash and burn' , function ( ) {
11
+ var table = (
12
+ < Table
13
+ width = { 600 }
14
+ height = { 400 }
15
+ rowsCount = { 5 }
16
+ rowHeight = { 100 }
17
+ headerHeight = { 50 }
18
+ >
19
+ < Column
20
+ width = { 300 }
21
+ />
22
+ </ Table >
23
+ ) ;
24
+ var renderer = createRenderer ( ) ;
25
+ renderer . render ( table ) ;
26
+ var tableRender = renderer . getRenderOutput ( ) ;
27
+
28
+ assert . isTrue ( isElement ( tableRender ) ) ;
29
+ } ) ;
30
+ } ) ;
31
+ } ) ;
32
+
Original file line number Diff line number Diff line change
1
+ const context = require . context ( './src' , true , / .+ - t e s t \. j s $ / )
2
+ context . keys ( ) . forEach ( context )
3
+
4
+ module . exports = context
Original file line number Diff line number Diff line change
1
+ var webpack = require ( 'webpack' ) ;
2
+ var resolvers = require ( './build_helpers/resolvers' ) ;
3
+ var path = require ( 'path' ) ;
4
+
5
+ module . exports = {
6
+ devServer : {
7
+ host : 'localhost' ,
8
+ port : '8081'
9
+ } ,
10
+
11
+ devtool : 'eval' ,
12
+
13
+ entry : {
14
+ 'test' : [ `mocha!./testRunner.js` ]
15
+ } ,
16
+
17
+ output : {
18
+ filename : 'test.js' ,
19
+ publicPath : 'http://localhost:8081/'
20
+ } ,
21
+
22
+ module : {
23
+ loaders : [
24
+ {
25
+ test : / \. j s $ / ,
26
+ exclude : / n o d e _ m o d u l e s / ,
27
+ loader : 'babel-loader'
28
+ }
29
+ ]
30
+ } ,
31
+
32
+ plugins : [
33
+ new webpack . DefinePlugin ( {
34
+ '__DEV__' : JSON . stringify ( process . env . NODE_ENV !== 'production' )
35
+ } ) ,
36
+ resolvers . resolveHasteDefines
37
+ ]
38
+ } ;
You can’t perform that action at this time.
0 commit comments