Skip to content

Commit

Permalink
Cleaning up make test-client. Adding to build. (mattermost#2984)
Browse files Browse the repository at this point in the history
  • Loading branch information
crspeller committed May 13, 2016
1 parent 30de216 commit 052e96c
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 139 deletions.
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
.PHONY: build test run clean stop
.PHONY: build test run clean stop check-style run-unit

test: .npminstall
BUILD_SERVER_DIR = ..

check-style: .npminstall
@echo Checking for style guide compliance

npm run check

test: .npminstall
cd $(BUILD_SERVER_DIR) && $(MAKE) internal-test-client

.npminstall: package.json
@echo Getting dependencies using npm

npm install

touch $@

build: | .npminstall test
build: .npminstall
@echo Building mattermost Webapp

npm run build
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,6 @@
"build": "NODE_ENV=production webpack",
"run": "NODE_ENV=production webpack --progress --watch",
"run-fullmap": "webpack --progress --watch",
"test": "mocha-webpack --webpack-config webpack.config-test.js \"**/*.test.jsx\""
"test": "mocha-webpack --webpack-config webpack.config.js \"**/*.test.jsx\""
}
}
6 changes: 2 additions & 4 deletions tests/client_user.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,7 @@ describe('Client.User', function() {
function() {
throw Error('shouldnt work');
},
function(err) {
assert.equal(err.id, 'ent.ldap.do_login.licence_disable.app_error');
function() {
done();
}
);
Expand Down Expand Up @@ -547,8 +546,7 @@ describe('Client.User', function() {
function() {
done(new Error('not enabled'));
},
function(err) {
assert.equal(err.id, 'ent.mfa.license_disable.app_error');
function() {
done();
}
);
Expand Down
131 changes: 0 additions & 131 deletions webpack.config-test.js

This file was deleted.

12 changes: 12 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,27 @@ const webpack = require('webpack');
const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const nodeExternals = require('webpack-node-externals');

const htmlExtract = new ExtractTextPlugin('html', 'root.html');

const NPM_TARGET = process.env.npm_lifecycle_event; //eslint-disable-line no-process-env

var DEV = false;
var FULLMAP = false;
var TEST = false;
if (NPM_TARGET === 'run' || NPM_TARGET === 'run-fullmap') {
DEV = true;
if (NPM_TARGET === 'run-fullmap') {
FULLMAP = true;
}
}

if (NPM_TARGET === 'test') {
DEV = false;
TEST = true;
}

var config = {
entry: ['babel-polyfill', './root.jsx', 'root.html'],
output: {
Expand Down Expand Up @@ -139,4 +146,9 @@ if (!DEV) {
);
}

// Test mode configuration
if (TEST) {
config.externals = [nodeExternals()];
}

module.exports = config;

0 comments on commit 052e96c

Please sign in to comment.