Commit fc1ab025 authored by Boris Kocherov's avatar Boris Kocherov

jslint fix

parent 78fce380
......@@ -14,6 +14,7 @@
todo_tests;
QUnit.config.autostart = false;
QUnit.dump.maxDepth = 10;
function replaceAll(str, searchStr, replaceStr) {
searchStr = searchStr.replace(/[\-\/\\\^$*+?.()|\[\]{}]/g, '\\$&');
......@@ -113,8 +114,10 @@
return gadget.getContent();
})
.push(function (json_document) {
assert.deepEqual(schema, schema_orig, "schema not change (side effect absent)");
assert.deepEqual(JSON.parse(json_document[key]), value, "returned value equal");
assert.deepEqual(schema, schema_orig,
"schema not change (side effect absent)");
assert.deepEqual(JSON.parse(json_document[key]), value,
"returned value equal");
})
.push(undefined, function (error) {
assert.notOk(error, "issue in gadget");
......@@ -144,7 +147,8 @@
// XXX base URI change based on $id property not realised
todo_tests.push("base URI change: base URI change ref valid");
todo_tests.push("base URI change - change folder: number is valid");
todo_tests.push("base URI change - change folder in subschema: number is valid");
todo_tests.push("base URI change - change folder in subschema:" +
" number is valid");
function create_callback(schema, schema_url, value, valid) {
return function (assert) {
......@@ -161,7 +165,7 @@
if (settings.invert_valid) {
valid = !valid;
}
create_gadget(function (method_name, argument_list) {
create_gadget(function (method_name) {
if (method_name === "notifyValid") {
assert.ok(valid, "form correctly filled");
} else if (method_name === "notifyInvalid") {
......@@ -196,13 +200,16 @@
// if schema used check side error
// if schema_url used we can not check schema_side_error
// because gadget himself download schema
assert.ok(json_document.hasOwnProperty(key), "getContent does not content property");
assert.deepEqual(schema, schema_orig, "schema changed (side effect on schema)");
assert.ok(json_document.hasOwnProperty(key),
"getContent does not content property");
assert.deepEqual(schema, schema_orig,
"schema changed (side effect on schema)");
}
try {
returned_value = JSON.parse(json_document[key]);
} catch (error) {
assert.notOk("value not parsable:'" + returned_value + "'\n" + error);
assert.notOk("value not parsable:'" +
returned_value + "'\n" + error);
}
if (!changed) {
assert.deepEqual(returned_value, value,
......@@ -254,11 +261,14 @@
m = list[i][k];
skip_module = skip_modules.indexOf(m.description) >= 0;
module(m.description);
schema = JSON.parse(replaceAll(JSON.stringify(m.schema), "http://localhost:1234/",
"http://localhost:9000/node_modules/json-schema-test-suite/remotes/"));
schema = JSON.parse(replaceAll(JSON.stringify(m.schema),
"http://localhost:1234/",
"http://localhost:9000/node_modules/" +
"json-schema-test-suite/remotes/"));
for (z = 0; z < m.tests.length; z += 1) {
t = m.tests[z];
if (todo_tests.indexOf(m.description + ': ' + t.description) >= 0) {
if (todo_tests.indexOf(m.description + ': ' +
t.description) >= 0) {
create_test = QUnit.todo;
} else if (skip_module || skip_file) {
create_test = QUnit.skip;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment