Skip to content

Commit

Permalink
Make both app and tests compile now. For tests, Node 6.9 needed
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nilshartmann committed Oct 26, 2016
1 parent f13a436 commit 06b95f4
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 15 deletions.
4 changes: 1 addition & 3 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"postinstall": "typings install",
"install-types": "typings install",
"test": "jest",
"test:watch": "jest --watch --no-cache",
"test:watch": "jest --watchAll --no-cache",
"start": "node server.js",
"build:clean": "rimraf ./public/dist && webpack --config webpack.config.js"
},
Expand All @@ -27,8 +27,6 @@
"whatwg-fetch": "^1.0.0"
},
"devDependencies": {
"@types/enzyme": "^2.4.36",
"@types/jest": "^15.1.32",
"babel-core": "^6.4.0",
"babel-loader": "^6.2.1",
"babel-preset-es2015": "^6.3.13",
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/form/SelectInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ export default ({object, error, name, label, options, onChange}: { object: any,

<div className='col-sm-10'>
<select size={5} className='form-control' name={name} onChange={handleOnChange} value={selectedValue}>
{options.map(option => <option key={option.value} value={option.value}>{option.name}</option>)}
{options.map(option => <option key={option.value} value={option.value as string}>{option.name}</option>)}
</select>
<FieldFeedbackPanel valid={valid} fieldError={fieldError} />
</div>
</div>
);
};
};
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require('jest');

import { url, submitForm } from '../util';
import { url, submitForm } from '../../src/util';

import * as React from 'react';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require('jest');

import * as Constraints from '../Constraints';
import * as Constraints from '../../../../src/components/form/Constraints';

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ require('jest');
import * as React from 'react';
import { shallow } from 'enzyme';

import { NotEmpty } from '../Constraints';
import FieldFeedbackPanel from '../FieldFeedbackPanel';
import { IInputChangeHandler, IError, IConstraint } from '../../../types';
import { NotEmpty } from '../../../../src/components/form/Constraints';
import FieldFeedbackPanel from '../../../../src/components/form/FieldFeedbackPanel';
import { IInputChangeHandler, IError, IConstraint } from '../../../../src/types';

import Input from '../Input';
import Input from '../../../../src/components/form/Input';

describe('Input', () => {

Expand Down
5 changes: 3 additions & 2 deletions client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
"noImplicitAny": false,
"preserveConstEnums": true,
"removeComments": true,
"target": "ES5",
"target": "ES6",
"allowJs": true,
"outDir": "public/dist",
"sourceMap": true
},
"exclude": [
"node_modules",
"typings/browser.d.ts",
"typings/browser"
"typings/browser",
"tests"
]
}
6 changes: 4 additions & 2 deletions client/typings.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
{
"globalDependencies": {
"classnames": "registry:dt/classnames#0.0.0+20160316155526",
"enzyme": "registry:dt/enzyme#2.5.1+20161019142319",
"jest": "registry:dt/jest#15.1.1+20160919141445",
"node": "registry:dt/node#6.0.0+20160921192128",
"react": "registry:dt/react#0.14.0+20161008064207",
"react-dom": "registry:dt/react-dom#0.14.0+20160412154040",
"react-router/history": "registry:dt/react-router/history#2.0.0+20160830150755",
"whatwg-fetch": "registry:dt/whatwg-fetch#0.0.0+20160829180742",
"whatwg-streams": "registry:dt/whatwg-streams#0.0.0+20160829180742"
},
"dependencies": {
"react": "registry:npm/react#15.0.1+20160601175240",
"react-dom": "registry:npm/react-dom#15.0.1+20160826174104",
"react-router": "registry:npm/react-router#2.4.0+20160915183637"
}
}

0 comments on commit 06b95f4

Please sign in to comment.