Переглянути джерело

HUE-9484 [frontend] Warn if jest tests are trying to make actual ajax requests using Axios

Johan Ahlen 5 роки тому
батько
коміт
30f31dc6c9
1 змінених файлів з 7 додано та 0 видалено
  1. 7 0
      desktop/core/src/desktop/js/jest/jest.init.js

+ 7 - 0
desktop/core/src/desktop/js/jest/jest.init.js

@@ -23,6 +23,7 @@ import './jquery.setup';
 import './sqlTestUtils';
 
 import 'ext/bootstrap.2.3.2.min';
+import axios from 'axios';
 import $ from 'jquery';
 import * as ko from 'knockout';
 import komapping from 'knockout.mapping';
@@ -109,3 +110,9 @@ $.ajaxSetup({
     console.trace();
   }
 });
+
+axios.interceptors.request.use(config => {
+  console.warn('Actual axios ajax request made to url: ' + config.url);
+  console.trace();
+  return config;
+});