From cb0e8ef2359ef8682060c65cecdd42b4dad35316 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sat, 22 May 2021 15:19:52 -0400 Subject: [PATCH] Remove log, clone test value before use (#1695) --- test/test-json-schema.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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));