aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStas Vilchik <stas-vilchik@users.noreply.github.com>2017-03-13 15:55:46 +0100
committerGitHub <noreply@github.com>2017-03-13 15:55:46 +0100
commitfbff4f5366bd8fb2348eb5ceab1cb3c1a929dc80 (patch)
tree396fd65c01b304b188225c160d95b40aa61e07b2
parent15da428681e063c70717cbf3521bcab1c621a1fb (diff)
downloadsonarqube-fbff4f5366bd8fb2348eb5ceab1cb3c1a929dc80.tar.gz
sonarqube-fbff4f5366bd8fb2348eb5ceab1cb3c1a929dc80.zip
run eslint, flow and jest tests on travis (#1779)
-rw-r--r--server/sonar-web/package.json2
-rw-r--r--server/sonar-web/src/main/js/apps/projects/filters/SearchFilter.js4
-rw-r--r--server/sonar-web/src/main/js/helpers/handlebars/codeWithIssueLocations.js24
-rwxr-xr-xtravis.sh2
4 files changed, 4 insertions, 28 deletions
diff --git a/server/sonar-web/package.json b/server/sonar-web/package.json
index b600d154dd8..42ed81fb706 100644
--- a/server/sonar-web/package.json
+++ b/server/sonar-web/package.json
@@ -104,7 +104,7 @@
"coverage": "npm test -- --coverage",
"lint": "eslint src/main/js",
"typecheck": "flow src/main/js",
- "validate": "eslint src/main/js && flow check src/main/js && CI=1 node scripts/test.js"
+ "validate": "eslint src/main/js && flow check src/main/js && NODE_ENV=test jest --runInBand"
},
"engines": {
"node": ">=6"
diff --git a/server/sonar-web/src/main/js/apps/projects/filters/SearchFilter.js b/server/sonar-web/src/main/js/apps/projects/filters/SearchFilter.js
index ea5a493b33f..9f414926c4d 100644
--- a/server/sonar-web/src/main/js/apps/projects/filters/SearchFilter.js
+++ b/server/sonar-web/src/main/js/apps/projects/filters/SearchFilter.js
@@ -24,7 +24,7 @@ import { translate, translateWithParameters } from '../../../helpers/l10n';
type Props = {
handleSearch: (userString?: string) => void,
- query: {}
+ query: { search?: string }
};
type State = {
@@ -50,7 +50,7 @@ export default class SearchFilter extends React.PureComponent {
}
}
- handleQueryChange = ({ target }) => {
+ handleQueryChange = ({ target }: { target: HTMLInputElement }) => {
this.setState({ userQuery: target.value });
if (!target.value || target.value.length >= 2) {
this.props.handleSearch(target.value);
diff --git a/server/sonar-web/src/main/js/helpers/handlebars/codeWithIssueLocations.js b/server/sonar-web/src/main/js/helpers/handlebars/codeWithIssueLocations.js
deleted file mode 100644
index 27e05bfcc81..00000000000
--- a/server/sonar-web/src/main/js/helpers/handlebars/codeWithIssueLocations.js
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-import doTheStuff from '../../components/source-viewer/helpers/code-with-issue-locations-helper';
-
-module.exports = function (code, issueLocations) {
- return doTheStuff(code, issueLocations);
-};
diff --git a/travis.sh b/travis.sh
index e12de64028e..d2bb0abb6bb 100755
--- a/travis.sh
+++ b/travis.sh
@@ -185,7 +185,7 @@ WEB_TESTS)
source ~/.nvm/nvm.sh && nvm install 6
curl -o- -L https://yarnpkg.com/install.sh | bash
export PATH=$HOME/.yarn/bin:$PATH
- cd server/sonar-web && yarn && yarn test -- --runInBand
+ cd server/sonar-web && yarn && yarn validate
;;
*)