diff options
author | Tulio Casagrande <tcasagra@thoughtworks.com> | 2016-06-29 18:55:48 -0300 |
---|---|---|
committer | Tulio Casagrande <tcasagra@thoughtworks.com> | 2016-06-29 19:11:49 -0300 |
commit | 55b5d8f515d66c7aad2977666bb2191748786cf8 (patch) | |
tree | 71e388ddce7f0abf5f1793c73a2439df7f241411 /web-ui/test | |
parent | 98c8b8da628ca69132eeae2a3fb62d388135f6d6 (diff) |
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.
Diffstat (limited to 'web-ui/test')
-rw-r--r-- | web-ui/test/test-main.js | 10 |
1 files changed, 10 insertions, 0 deletions
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', |