Js test fixes for cms and cms-squire.

This commit is contained in:
muzaffaryousaf
2016-04-06 21:25:07 +05:00
committed by Usman Khalid
parent d28f487235
commit c0fef0b0e0
55 changed files with 1219 additions and 1039 deletions

View File

@@ -10,7 +10,13 @@
(function(root, factory) {
/* jshint strict: false */
factory(root, root.jQuery);
if (typeof define === 'function' && define.amd) {
require(['jquery'], function ($) {
factory(root, $);
});
} else {
factory(root, root.jQuery);
}
}((function() {
/* jshint strict: false */
return this;
@@ -20,7 +26,9 @@
// Add custom Jasmine matchers.
beforeEach(function() {
jasmine.addMatchers(window.imagediff.jasmine);
if (window.imagediff) {
jasmine.addMatchers(window.imagediff.jasmine);
}
jasmine.addMatchers({
toHaveAttrs: function() {
@@ -60,6 +68,16 @@
};
}
};
},
toBeInstanceOf: function() {
// Assert the type of the value being tested matches the provided type
return {
compare: function (actual, expected) {
return {
pass: actual instanceof expected
};
}
};
}
});
});