Skip to content

Commit

Permalink
Mocha test revision, package.json removing ^ from dependencies, corre…
Browse files Browse the repository at this point in the history
…ction part of todo comment
  • Loading branch information
tomRzeznik committed Jan 9, 2018
1 parent 370def0 commit 4bb2dca
Show file tree
Hide file tree
Showing 10 changed files with 106 additions and 92 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
/config-test.yaml
/*.sublime-*
/dont-commit-*
package-lock.json
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ npm run start -- --examples
Next connect Turnilo to Druid cluster by simply pointing it to broker host:

```
npm run start -- --druid your.druid.broker.host:8082
npm run start -- --druid your.druid.broker.host (default to 8082)
```

Turnilo will automatically introspect your Druid cluster and figure out datasets.
Expand Down
3 changes: 2 additions & 1 deletion config/webpack.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ var path = require("path");
var webpack = require('webpack');
var hotMiddlewareScript = 'webpack-hot-middleware/client';


module.exports = {
entry: {
'swiv-entry': [hotMiddlewareScript, './src/client/swiv-entry.ts']
Expand All @@ -12,7 +13,7 @@ module.exports = {
chunkFilename: "[name].[hash].js",
publicPath: '/'
},
devtool: "#source-map",
devtool: "source-map",
resolve: {
extensions: [".ts", ".tsx", ".js", ".json"]
},
Expand Down
18 changes: 1 addition & 17 deletions config/webpack.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,6 @@ module.exports = {
plugins: [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production')
}),
/* new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false,
dead_code: true,
unused: true,
comparisons: true,
sequences: true,
evaluate: true,
conditionals: true,
if_return: true,
join_vars: true
},
output: {
comments: false
}
})*/
})
]
};
129 changes: 66 additions & 63 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,84 +29,87 @@
"test": "test"
},
"scripts": {
"test": "npm run test:common | npm run test:client | npm run test:server",
"test:common": "node_modules/mocha/bin/mocha build/common/**/*.mocha.js",
"test:client": "node_modules/mocha/bin/mocha build/client/**/*.mocha.js",
"test:server": "node_modules/mocha/bin/mocha build/server/**/*.mocha.js",
"test": "npm run test:client | npm run test:common | npm run test:server",
"test:common": "node_modules/.bin/mocha --compilers ts:ts-node/register --require ignore-styles src/common/**/*.mocha.ts",
"test:client": "node_modules/.bin/mocha --compilers ts:ts-node/register --require ignore-styles src/client/**/*.mocha.ts",
"test:server": "node_modules/.bin/mocha --compilers ts:ts-node/register src/server/**/*.mocha.ts",
"start": "./bin/swiv",
"start-prod": "NODE_ENV=production ./bin/swiv",
"build": "npm run clean | tsc | webpack --config config/webpack.dev.js",
"build:prod": "npm run clean | tsc | webpack --config config/webpack.prod.js",
"build": "npm run clean | npm run tsc -- -p tsconfig-server.json | webpack --config config/webpack.dev.js",
"build:prod": "npm run clean | npm run tsc -- -p tsconfig-server.json | webpack --config config/webpack.prod.js",
"clean": "rm -rf ./build/*",
"tsc": "tsc -t ES2015 --lib \"ES2015\",\"DOM\",\"ScriptHost\""
"tsc": "node_modules/.bin/tsc"
},
"dependencies": {
"body-parser": "^1.18.2",
"browser-filesaver": "^1.1.1",
"body-parser": "1.18.2",
"browser-filesaver": "1.1.1",
"chronoshift": "0.5.7",
"clipboard": "^1.7.1",
"compression": "^1.7.1",
"d3": "^3.5.17",
"debug": "^3.1.0",
"express": "^4.16.2",
"fs-promise": "^2.0.3",
"hsts": "^2.1.0",
"immutable": "^3.8.2",
"clipboard": "1.7.1",
"compression": "1.7.1",
"d3": "3.5.17",
"debug": "3.1.0",
"express": "4.16.2",
"fs-promise": "2.0.3",
"hsts": "2.1.0",
"immutable": "3.8.2",
"immutable-class": "0.6.9",
"js-yaml": "^3.10.0",
"js-yaml": "3.10.0",
"logger-tracker": "0.0.23",
"lz-string": "^1.4.4",
"node-spawn-server": "^1.0.1",
"nopt": "^4.0.1",
"numeral": "^2.0.6",
"lz-string": "1.4.4",
"node-spawn-server": "1.0.1",
"nopt": "4.0.1",
"numeral": "2.0.6",
"plywood-druid-requester": "1.5.4",
"plywood-mysql-requester": "^2.1.0",
"plywood-postgres-requester": "^1.2.0",
"q": "^1.5.1",
"qajax": "^1.3.0",
"react": "^16.2.0",
"react-addons-css-transition-group": "^15.6.2",
"react-dom": "^16.2.0",
"request": "^2.83.0",
"plywood-mysql-requester": "2.1.0",
"plywood-postgres-requester": "1.2.0",
"q": "1.5.1",
"qajax": "1.3.0",
"react": "16.2.0",
"react-addons-css-transition-group": "15.6.2",
"react-dom": "16.2.0",
"request": "2.83.0",
"swiv-plywood": "0.12.17"
},
"devDependencies": {
"@types/body-parser": "^1.16.8",
"@types/chai": "^4.0.10",
"@types/body-parser": "1.16.8",
"@types/chai": "4.0.10",
"@types/compression": "0.0.35",
"@types/express": "^4.11.0",
"@types/express-session": "^1.15.6",
"@types/geojson": "^7946.0.0",
"@types/js-yaml": "^3.10.1",
"@types/node": "^8.5.2",
"@types/q": "^1.0.6",
"@types/express": "4.11.0",
"@types/express-session": "1.15.6",
"@types/geojson": "7946.0.0",
"@types/js-yaml": "3.10.1",
"@types/node": "8.5.2",
"@types/q": "1.0.6",
"@types/qajax": "0.0.29",
"@types/react": "^16.0.31",
"@types/react-dom": "^16.0.3",
"@types/superagent": "^3.5.6",
"@types/supertest": "^2.0.4",
"@types/webpack-env": "^1.13.3",
"awesome-typescript-loader": "^3.4.1",
"create-react-class": "^15.6.2",
"css-loader": "^0.28.7",
"immutable-class-tester": "^0.5.12",
"@types/react": "16.0.31",
"@types/react-dom": "16.0.3",
"@types/superagent": "3.5.6",
"@types/supertest": "2.0.4",
"@types/webpack-env": "1.13.3",
"awesome-typescript-loader": "3.4.1",
"create-react-class": "15.6.2",
"css-loader": "0.28.7",
"ignore-styles": "5.0.1",
"immutable-class-tester": "0.5.12",
"jsdom": "9.4.2",
"mocha": "^4.1.0",
"node-sass": "^4.7.2",
"pre-commit": "^1.2.2",
"react-addons-test-utils": "^15.6.2",
"react-hot-loader": "^3.1.3",
"rewire": "^3.0.2",
"sass-lint-rules": "^1.0.2",
"sass-loader": "^6.0.6",
"source-map-loader": "^0.2.3",
"style-loader": "^0.19.1",
"supertest": "^3.0.0",
"svg-inline-loader": "^0.8.0",
"mocha": "4.1.0",
"node-sass": "4.7.2",
"react-addons-test-utils": "15.6.2",
"react-hot-loader": "3.1.3",
"regex-replace-loader": "1.0.0",
"rewire": "3.0.2",
"sass-lint-rules": "1.0.2",
"sass-loader": "6.0.6",
"source-map-loader": "0.2.3",
"style-loader": "0.19.1",
"supertest": "3.0.0",
"svg-inline-loader": "0.8.0",
"svg-loader": "0.0.2",
"typescript": "^2.6.2",
"webpack": "^3.10.0",
"webpack-dev-middleware": "^2.0.3",
"webpack-hot-middleware": "^2.21.0"
"ts-node": "4.1.0",
"typescript": "2.6.2",
"webpack": "3.10.0",
"webpack-dev-middleware": "2.0.3",
"webpack-hot-middleware": "2.21.0",
"webpack2-replace-loader": "1.1.3"
}
}
3 changes: 0 additions & 3 deletions src/client/utils/test-utils/find-dom-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ import * as TestUtils from 'react-dom/test-utils';
import { BodyPortal } from '../../components/body-portal/body-portal';

export function findDOMNode(element: __React.Component<any, any> | Element ): Element {
/* if(element instanceof Element) {
return Element;
}*/
var portal: any = TestUtils.scryRenderedComponentsWithType(element, BodyPortal)[0];
return portal ? portal.target.childNodes[0] : ReactDOM.findDOMNode(element);
}
2 changes: 1 addition & 1 deletion src/server/routes/swiv/swiv.mocha.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ app.use((req: SwivRequest, res: express.Response, next: Function) => {
next();
});

app.use('/', swivRouter);
//app.use('/', swivRouter);

describe('swiv router', () => {
it('does a query (value)', (testComplete:any) => {
Expand Down
6 changes: 3 additions & 3 deletions src/server/utils/cluster-manager/cluster-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ export class ClusterManager {
public requestDecoratorModule: DruidRequestDecoratorModule;

private sourceListRefreshInterval: number = 0;
private sourceListRefreshTimer: any = null; // TODO check why there was an error for the NodeJS.Timer type
private sourceListRefreshTimer: NodeJS.Timer = null;
private sourceReintrospectInterval: number = 0;
private sourceReintrospectTimer: any = null; // TODO check why there was an error for the NodeJS.Timer type
private sourceReintrospectTimer: NodeJS.Timer = null;

private initialConnectionTimer: any = null; /// TODO check why there was an error for the NodeJS.Timer type
private initialConnectionTimer: NodeJS.Timer = null;

constructor(cluster: Cluster, options: ClusterManagerOptions) {
if (!cluster) throw new Error('must have cluster');
Expand Down
27 changes: 27 additions & 0 deletions tsconfig-server.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"compilerOptions": {
"sourceMap": true,
"noImplicitAny": true,
"noEmitOnError": true,
"declaration": true,
"removeComments": true,
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"strictNullChecks": false,
"skipLibCheck": true,
"target": "es5",
"module": "commonjs",
"rootDir": "src",
"outDir": "build",
"moduleResolution": "node",
"jsx": "react",
"types" : ["node", "express", "webpack-env"]
},
"include": [
"src/server/**/*.ts",
"src/server/**/*.tsx",
"src/common/**/*.ts",
"src/common/**/*.tsx",
"typings/**/*.d.ts"
]
}
7 changes: 4 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@
"rootDir": "src",
"outDir": "build",
"moduleResolution": "node",
"jsx": "react"
"jsx": "react",
"types" : ["node", "express", "webpack-env"]
},
"include": [
"src/**/*.ts",
"src/**/*.tsx",
"src/client/**/*.ts",
"src/client/**/*.tsx",
"typings/**/*.d.ts"
]
}

0 comments on commit 4bb2dca

Please sign in to comment.