From 31c9437946239e16c361ab4bc06925d1d5e87372 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Feje=C5=A1?= Date: Mon, 15 Jan 2018 21:03:32 +0100 Subject: [PATCH] add test for cleanObj --- test/cleanObj/cleanObj.test.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/cleanObj/cleanObj.test.js b/test/cleanObj/cleanObj.test.js index 47e035791..8869354da 100644 --- a/test/cleanObj/cleanObj.test.js +++ b/test/cleanObj/cleanObj.test.js @@ -5,6 +5,8 @@ test('Testing cleanObj', (t) => { //For more information on all the methods supported by tape //Please go to https://github.com/substack/tape t.true(typeof cleanObj === 'function', 'cleanObj is a Function'); + const testObj = { a: 1, b: 2, children: { a: 1, b: 2 } }; + t.deepEqual(cleanObj(testObj, ['a'], 'children'), { a: 1, children : { a: 1}}, "Removes any properties except the ones specified from a JSON object"); //t.deepEqual(cleanObj(args..), 'Expected'); //t.equal(cleanObj(args..), 'Expected'); //t.false(cleanObj(args..), 'Expected');