From d8ee6074fa553a76831a019d7b16af5d98355dd0 Mon Sep 17 00:00:00 2001 From: Timo Hocker Date: Mon, 29 Jun 2020 11:30:16 +0200 Subject: [PATCH] safer test on copy_object --- package.json | 7 +++++-- test/index.js | 6 +++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index b77ae3c..fdbc6fc 100644 --- a/package.json +++ b/package.json @@ -33,5 +33,8 @@ "LICENSE", "index.js", "index.d.ts" - ] -} \ No newline at end of file + ], + "engines": { + "node": ">=10" + } +} diff --git a/test/index.js b/test/index.js index 78c2cab..d6e3b3d 100644 --- a/test/index.js +++ b/test/index.js @@ -34,11 +34,15 @@ test ('try_parse_json should fail', (t) => { }); test ('copy object', (t) => { - const obj = { foo: 'bar' }; + const obj = { foo: 'bar', bar: { foo: 'baz' } }; const copy = util.copy_object (obj); + t.deepEqual (obj, copy); copy.foo = 'baz'; + copy.bar.foo = 'bar'; t.is (copy.foo, 'baz'); + t.is (copy.bar.foo, 'bar'); t.is (obj.foo, 'bar'); + t.is (obj.bar.foo, 'baz'); }); test ('run regex', (t) => {