Skip to content

Commit 06b95f4

Browse files
committed
Make both app and tests compile now. For tests, Node 6.9 needed
Due to a bug in ts-loader (TypeStrong/ts-loader#267) tests will always be compiled even from webpack. So I've moved them for now to a separate folder. TODO: need to re-check why type declarations from npm (@types) does not work.
1 parent f13a436 commit 06b95f4

File tree

8 files changed

+16
-15
lines changed

8 files changed

+16
-15
lines changed

client/package.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"postinstall": "typings install",
99
"install-types": "typings install",
1010
"test": "jest",
11-
"test:watch": "jest --watch --no-cache",
11+
"test:watch": "jest --watchAll --no-cache",
1212
"start": "node server.js",
1313
"build:clean": "rimraf ./public/dist && webpack --config webpack.config.js"
1414
},
@@ -27,8 +27,6 @@
2727
"whatwg-fetch": "^1.0.0"
2828
},
2929
"devDependencies": {
30-
"@types/enzyme": "^2.4.36",
31-
"@types/jest": "^15.1.32",
3230
"babel-core": "^6.4.0",
3331
"babel-loader": "^6.2.1",
3432
"babel-preset-es2015": "^6.3.13",

client/src/components/form/SelectInput.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ export default ({object, error, name, label, options, onChange}: { object: any,
2323

2424
<div className='col-sm-10'>
2525
<select size={5} className='form-control' name={name} onChange={handleOnChange} value={selectedValue}>
26-
{options.map(option => <option key={option.value} value={option.value}>{option.name}</option>)}
26+
{options.map(option => <option key={option.value} value={option.value as string}>{option.name}</option>)}
2727
</select>
2828
<FieldFeedbackPanel valid={valid} fieldError={fieldError} />
2929
</div>
3030
</div>
3131
);
32-
};
32+
};

client/src/__tests__/util.test.tsx renamed to client/tests/__tests__/util.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require('jest');
22

3-
import { url, submitForm } from '../util';
3+
import { url, submitForm } from '../../src/util';
44

55
import * as React from 'react';
66

client/src/components/form/__tests__/Constraints.test.tsx renamed to client/tests/components/form/__tests__/Constraints.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require('jest');
22

3-
import * as Constraints from '../Constraints';
3+
import * as Constraints from '../../../../src/components/form/Constraints';
44

55
const afunc = ({a}) => {};
66

client/src/components/form/__tests__/Input.test.tsx renamed to client/tests/components/form/__tests__/Input.test.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ require('jest');
22
import * as React from 'react';
33
import { shallow } from 'enzyme';
44

5-
import { NotEmpty } from '../Constraints';
6-
import FieldFeedbackPanel from '../FieldFeedbackPanel';
7-
import { IInputChangeHandler, IError, IConstraint } from '../../../types';
5+
import { NotEmpty } from '../../../../src/components/form/Constraints';
6+
import FieldFeedbackPanel from '../../../../src/components/form/FieldFeedbackPanel';
7+
import { IInputChangeHandler, IError, IConstraint } from '../../../../src/types';
88

9-
import Input from '../Input';
9+
import Input from '../../../../src/components/form/Input';
1010

1111
describe('Input', () => {
1212

client/tsconfig.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@
55
"noImplicitAny": false,
66
"preserveConstEnums": true,
77
"removeComments": true,
8-
"target": "ES5",
8+
"target": "ES6",
99
"allowJs": true,
1010
"outDir": "public/dist",
1111
"sourceMap": true
1212
},
1313
"exclude": [
1414
"node_modules",
1515
"typings/browser.d.ts",
16-
"typings/browser"
16+
"typings/browser",
17+
"tests"
1718
]
1819
}

client/typings.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
{
22
"globalDependencies": {
33
"classnames": "registry:dt/classnames#0.0.0+20160316155526",
4+
"enzyme": "registry:dt/enzyme#2.5.1+20161019142319",
5+
"jest": "registry:dt/jest#15.1.1+20160919141445",
46
"node": "registry:dt/node#6.0.0+20160921192128",
7+
"react": "registry:dt/react#0.14.0+20161008064207",
8+
"react-dom": "registry:dt/react-dom#0.14.0+20160412154040",
59
"react-router/history": "registry:dt/react-router/history#2.0.0+20160830150755",
610
"whatwg-fetch": "registry:dt/whatwg-fetch#0.0.0+20160829180742",
711
"whatwg-streams": "registry:dt/whatwg-streams#0.0.0+20160829180742"
812
},
913
"dependencies": {
10-
"react": "registry:npm/react#15.0.1+20160601175240",
11-
"react-dom": "registry:npm/react-dom#15.0.1+20160826174104",
1214
"react-router": "registry:npm/react-router#2.4.0+20160915183637"
1315
}
1416
}

0 commit comments

Comments
 (0)