From 18d60a6ea8ca55fe6c99bde3ecf34da1736f9fd1 Mon Sep 17 00:00:00 2001 From: Daniel Lugo Date: Wed, 15 Sep 2021 11:08:23 -0400 Subject: [PATCH] Use util from ./misc --- utils/GunSmith/GunSmith.spec.js | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/utils/GunSmith/GunSmith.spec.js b/utils/GunSmith/GunSmith.spec.js index b5d814d2..16ae6d63 100644 --- a/utils/GunSmith/GunSmith.spec.js +++ b/utils/GunSmith/GunSmith.spec.js @@ -8,6 +8,8 @@ const Gun = require('./GunSmith') const words = require('random-words') const fs = require('fs') +const { removeBuiltInGunProps } = require('./misc') + if (!fs.existsSync('./test-radata')) { fs.mkdirSync('./test-radata') } @@ -18,20 +20,7 @@ if (!fs.existsSync('./test-radata')) { // eslint-disable-next-line init-declarations let instance -/** - * @param {any} o - * @returns {any} - */ -const removeBuiltInGunProps = (o) => { - if (typeof o === 'object' && o !== null) { - delete o._ - delete o['#'] - return o - } - console.log(o) - throw new TypeError('Non object passed to removeBuiltInGunProps: ' + JSON.stringify(o)) -} describe('constructor', () => { // eslint-disable-next-line jest/no-hooks