Răsfoiți Sursa

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

Johan Ahlen 5 ani în urmă
părinte
comite
30f31dc6c9
1 a modificat fișierele cu 7 adăugiri și 0 ștergeri
  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;
+});