mkws.debug_function(text)
}
-
-var jasmine_config = {};
+ // Define empty mkws_config for simple applications that don't define it.
+if (jasmine_config == null || typeof jasmine_config != 'object') {
+ var jasmine_config = {};
+}
/* check config for jasmine test
*
* object: jasmine_config = {};
*
*/
-beforeEach(function () {
+function init_jasmine_config() {
var jasmine_config_default = {
search_query: "freebsd",
if (!jasmine_config.hasOwnProperty(key)) {
jasmine_config[key] = jasmine_config_default[key];
}
+ debug("jasmine config: " + key + " => " + jasmine_config[key]);
}
-});
+}
var get_hit_counter = function () {
// not yet here
return hits;
}
+describe("Init jasmine config", function () {
+ it("jasmine was successfully initialized", function () {
+ init_jasmine_config();
+
+ expect(jasmine_config.search_query).toMatch(/\w/);
+ expect(jasmine_config.second).toBeGreaterThan(100);
+ expect(jasmine_config.max_time).toBeGreaterThan(1);
+ expect(jasmine_config.expected_hits).toBeGreaterThan(1);
+ });
+});
+
describe("Check pazpar2 search", function () {
it("pazpar2 was successfully initialize", function () {
expect(mkws_config.error).toBe(undefined);
debug("extracted URL from record: " + url);
expect(url).not.toBe(null);
- expect(url).toMatch(/^http:\/\/[a-z0-9]+\.[0-9a-z].*\//i);
+ expect(url).toMatch(/^https?:\/\/[a-z0-9]+\.[0-9a-z].*\//i);
});
});