aboutsummaryrefslogtreecommitdiff
path: root/test/test-json-schema.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-05-22 15:19:52 -0400
committerGitHub <noreply@github.com>2021-05-22 15:19:52 -0400
commitcb0e8ef2359ef8682060c65cecdd42b4dad35316 (patch)
tree5a906c025e3c157d0c1a883bc48bb085f13e1214 /test/test-json-schema.js
parentc95827ae6803a38c9b2d8e32f88aabc5dd5de927 (diff)
Remove log, clone test value before use (#1695)
Diffstat (limited to 'test/test-json-schema.js')
-rw-r--r--test/test-json-schema.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/test-json-schema.js b/test/test-json-schema.js
index d8e351be..d082a53f 100644
--- a/test/test-json-schema.js
+++ b/test/test-json-schema.js
@@ -40,6 +40,10 @@ function createProxy(schema, value) {
return new JsonSchemaValidator().createProxy(value, schema);
}
+function clone(value) {
+ return JSON.parse(JSON.stringify(value));
+}
+
function testValidate1() {
const schema = {
@@ -799,8 +803,8 @@ function testProxy1() {
for (const {schema, tests} of data) {
for (let {error, value, action} of tests) {
if (typeof value === 'undefined') { value = getValidValueOrDefault(schema, void 0); }
+ value = clone(value);
assert.ok(schemaValidate(schema, value));
- console.log(error, value, schema);
const valueProxy = createProxy(schema, value);
if (error) {
assert.throws(() => action(valueProxy));