From 55b5d8f515d66c7aad2977666bb2191748786cf8 Mon Sep 17 00:00:00 2001 From: Tulio Casagrande Date: Wed, 29 Jun 2016 18:55:48 -0300 Subject: Add jasmine-ajax to mock ajax calls on tests We had some tests trying to hit the backend. Considering these are unit tests, we decided to mock all ajax calls. This removes the warnings we had when running js tests. --- web-ui/test/test-main.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'web-ui/test') diff --git a/web-ui/test/test-main.js b/web-ui/test/test-main.js index cc7daaee..4396993f 100644 --- a/web-ui/test/test-main.js +++ b/web-ui/test/test-main.js @@ -4,6 +4,16 @@ var tests = Object.keys(window.__karma__.files).filter(function (file) { return (/\.spec\.js$/.test(file)); }); +beforeEach(function() { + 'use strict'; + jasmine.Ajax.install(); +}); + +afterEach(function() { + 'use strict'; + jasmine.Ajax.uninstall(); +}); + requirejs.config({ baseUrl: '/base', -- cgit v1.2.3