From a2877102f1abe9e21ab20c2a2d32e359902a1e6d Mon Sep 17 00:00:00 2001 From: David Kaltschmidt Date: Mon, 26 Oct 2015 14:41:03 +0000 Subject: [PATCH] remove old karma test config, make webpackdevserver optional `npm install` continues to install everything, but `npm install --no-optional` wont install the dev server. --- client/Dockerfile | 3 ++- client/package.json | 10 +++++--- client/test/README.md | 9 ------- client/test/karma.conf.js | 49 ------------------------------------ client/test/polyfill.js | 21 ---------------- client/test/preprocessor.js | 7 ------ client/test/tests.webpack.js | 2 -- 7 files changed, 8 insertions(+), 93 deletions(-) delete mode 100644 client/test/README.md delete mode 100644 client/test/karma.conf.js delete mode 100644 client/test/polyfill.js delete mode 100644 client/test/preprocessor.js delete mode 100644 client/test/tests.webpack.js diff --git a/client/Dockerfile b/client/Dockerfile index b757b42cf..14445b647 100644 --- a/client/Dockerfile +++ b/client/Dockerfile @@ -1,5 +1,6 @@ FROM node:0.10 WORKDIR /home/weave COPY package.json /home/weave/ -RUN npm install +# Dont install optional developer tools +RUN npm install --no-optional COPY webpack.local.config.js webpack.production.config.js server.js .eslintrc /home/weave/ diff --git a/client/package.json b/client/package.json index d80dc3afe..7f22dbc04 100644 --- a/client/package.json +++ b/client/package.json @@ -36,20 +36,22 @@ "eslint-loader": "^0.11.2", "eslint-plugin-jasmine": "^1.0.0", "eslint-plugin-react": "^2.3.0", - "express": "^4.13.3", - "express-http-proxy": "^0.6.0", "file-loader": "^0.8.4", "jest-cli": "0.4.19", "json-loader": "^0.5.2", "less": "^2.5.1", "less-loader": "^2.2.0", "postcss-loader": "^0.4.3", - "proxy-middleware": "^0.13.1", - "react-hot-loader": "^1.2.8", "style-loader": "^0.12.3", "url": "^0.10.3", "url-loader": "^0.5.6", "webpack": "^1.9.10", + }, + "optionalDependencies": { + "express": "^4.13.3", + "express-http-proxy": "^0.6.0", + "proxy-middleware": "^0.13.1", + "react-hot-loader": "^1.2.8", "webpack-dev-server": "^1.10.1" }, "scripts": { diff --git a/client/test/README.md b/client/test/README.md deleted file mode 100644 index f8419bcf9..000000000 --- a/client/test/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# Testing - -Scope unit testing is done unsing Karma/Jasmine. (Jest was too big and slow.) - -To run tests, do `npm test` in the toplevel directory. - -The tests are placed in `__tests__` directories, relative to what they are testing. - -For more info see [Testing Flux Apps with Karma](http://kentor.me/posts/testing-react-and-flux-applications-with-karma-and-webpack/) diff --git a/client/test/karma.conf.js b/client/test/karma.conf.js deleted file mode 100644 index fd7979048..000000000 --- a/client/test/karma.conf.js +++ /dev/null @@ -1,49 +0,0 @@ -module.exports = function(config) { - config.set({ - browsers: [ - 'PhantomJS' - ], - files: [ - './polyfill.js', - { - pattern: 'tests.webpack.js', - watched: false - } - ], - frameworks: [ - 'jasmine' - ], - preprocessors: { - 'tests.webpack.js': ['webpack'] - }, - reporters: [ - 'dots', - 'coverage' - ], - coverageReporter: { - type: 'text-summary' - }, - webpack: { - module: { - loaders: [ - { - test: /\.js?$/, - exclude: /node_modules/, - loader: 'babel-loader' - } - ], - postLoaders: [ - { - test: /\.js$/, - exclude: /(test|node_modules|bower_components)\//, - loader: 'istanbul-instrumenter' - } - ] - }, - watch: true - }, - webpackServer: { - noInfo: true - } - }); -}; diff --git a/client/test/polyfill.js b/client/test/polyfill.js deleted file mode 100644 index 40e036c7d..000000000 --- a/client/test/polyfill.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Function.prototype.bind polyfill used by PhantomJS - */ -if (typeof Function.prototype.bind != 'function') { - Function.prototype.bind = function bind(obj) { - var args = Array.prototype.slice.call(arguments, 1), - self = this, - nop = function() { - }, - bound = function() { - return self.apply( - this instanceof nop ? this : (obj || {}), args.concat( - Array.prototype.slice.call(arguments) - ) - ); - }; - nop.prototype = this.prototype || {}; - bound.prototype = new nop(); - return bound; - }; -} diff --git a/client/test/preprocessor.js b/client/test/preprocessor.js deleted file mode 100644 index 4c91ab16b..000000000 --- a/client/test/preprocessor.js +++ /dev/null @@ -1,7 +0,0 @@ -var ReactTools = require('react-tools'); - -module.exports = { - process: function(src) { - return ReactTools.transform(src); - } -}; diff --git a/client/test/tests.webpack.js b/client/test/tests.webpack.js deleted file mode 100644 index e0bf705c2..000000000 --- a/client/test/tests.webpack.js +++ /dev/null @@ -1,2 +0,0 @@ -var context = require.context('../app/scripts', true, /-test\.js$/); -context.keys().forEach(context);