diff options
author | Stas Vilchik <stas.vilchik@sonarsource.com> | 2017-10-19 16:32:33 +0200 |
---|---|---|
committer | Stas Vilchik <stas.vilchik@sonarsource.com> | 2017-10-20 14:52:01 +0200 |
commit | 97df5136aa8b05ed3e56c47e457a5e53288697e9 (patch) | |
tree | 89243890bbe3cfd5394585b63ca4aa8d62e0e1aa /server/sonar-web/src/main/js/api/tests.ts | |
parent | 2c1b9cae54f36b9d62a65de6ef631f091bea99b6 (diff) | |
download | sonarqube-97df5136aa8b05ed3e56c47e457a5e53288697e9.tar.gz sonarqube-97df5136aa8b05ed3e56c47e457a5e53288697e9.zip |
stop using jquery for ajax calls
Diffstat (limited to 'server/sonar-web/src/main/js/api/tests.ts')
-rw-r--r-- | server/sonar-web/src/main/js/api/tests.ts | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/server/sonar-web/src/main/js/api/tests.ts b/server/sonar-web/src/main/js/api/tests.ts new file mode 100644 index 00000000000..132f4d49ba6 --- /dev/null +++ b/server/sonar-web/src/main/js/api/tests.ts @@ -0,0 +1,38 @@ +/* +* SonarQube +* Copyright (C) 2009-2016 SonarSource SA +* mailto:contact 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 throwGlobalError from '../app/utils/throwGlobalError'; +import { getJSON } from '../helpers/request'; + +export interface GetTestsParameters { + branch?: string; + testFileKey: string; +} + +export function getTests(parameters: GetTestsParameters) { + return getJSON('/api/tests/list', parameters).catch(throwGlobalError); +} + +export interface GetCoveredFilesParameters { + testId: string; +} + +export function getCoveredFiles(parameters: GetCoveredFilesParameters) { + return getJSON('/api/tests/covered_files', parameters).catch(throwGlobalError); +} |