From 0c5e13b30392df777bdb6ad688c8644d248323e4 Mon Sep 17 00:00:00 2001 From: Daniel Lugo Date: Thu, 23 Sep 2021 11:17:14 -0400 Subject: [PATCH] Expose process counter in a better way --- utils/GunSmith/GunSmith.js | 6 +++--- utils/GunSmith/GunSmith.spec.js | 4 ++-- utils/GunSmith/Smith.ts | 4 ---- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/utils/GunSmith/GunSmith.js b/utils/GunSmith/GunSmith.js index cd2e6dd7..beb9c6e5 100644 --- a/utils/GunSmith/GunSmith.js +++ b/utils/GunSmith/GunSmith.js @@ -628,9 +628,6 @@ function createReplica(path, afterMap = false) { } }) }) - }, - _getProcCounter() { - return procCounter } } } @@ -765,3 +762,6 @@ module.exports.kill = () => { module.exports._reforge = forge module.exports._isReady = isReady +module.exports._getProcCounter = () => { + return procCounter +} diff --git a/utils/GunSmith/GunSmith.spec.js b/utils/GunSmith/GunSmith.spec.js index 9a4c7110..160862fc 100644 --- a/utils/GunSmith/GunSmith.spec.js +++ b/utils/GunSmith/GunSmith.spec.js @@ -278,7 +278,7 @@ describe('gun smith', () => { await whenReady() jest.setTimeout(40000) - const initialProcCounter = instance._getProcCounter() + const initialProcCounter = Gun._getProcCounter() const node = instance.get(words()).get(words()) @@ -287,7 +287,7 @@ describe('gun smith', () => { node.specialOn( debounce(data => { if (data === secondValue) { - expect(instance._getProcCounter()).toEqual(initialProcCounter + 1) + expect(Gun._getProcCounter()).toEqual(initialProcCounter + 1) done() release() } diff --git a/utils/GunSmith/Smith.ts b/utils/GunSmith/Smith.ts index 46bec601..e8d0af0d 100644 --- a/utils/GunSmith/Smith.ts +++ b/utils/GunSmith/Smith.ts @@ -39,10 +39,6 @@ namespace Smith { * @throws */ pPut(data: GunT.ValidDataValue): Promise - /** - * @protected - */ - _getProcCounter(): number } export type UserSmithNode = GunSmithNode & GunT.UserGUNNode