diff --git a/documentation/function-wrapping.md b/documentation/function-wrapping.md index cc7511a9df..f88d3af9ab 100644 --- a/documentation/function-wrapping.md +++ b/documentation/function-wrapping.md @@ -14,12 +14,11 @@ Normally, in order to use a shim helper you need to configure and setup an [inst //File: test.js const newrelic = require('newrelic'); -const symbols = require('newrelic/lib/symbols'); // grab the agent instance from cache and manually // require the shim library -- normally the agent // will handle this for you -const agent = require.cache[symbols.cache].agent; +const agent = require.cache.__NR_cache.agent; const Shim = require('newrelic/lib/shim/shim'); // do the same fnApply/apply shenangins as the shim library diff --git a/test/smoke/index/index-bad-version.tap.js b/test/smoke/index/index-bad-version.tap.js index dea87adec7..3571ef6041 100644 --- a/test/smoke/index/index-bad-version.tap.js +++ b/test/smoke/index/index-bad-version.tap.js @@ -8,7 +8,6 @@ const tap = require('tap') const { getTestSecret } = require('../../helpers/secrets') const StubApi = require('../../../stub_api') -const symbols = require('../../../lib/symbols') const license = getTestSecret('TEST_LICENSE') const VERSIONS = ['garbage', '4.0.0'] @@ -20,7 +19,7 @@ tap.test('load agent with bad versions should load stub agent', (t) => { t.afterEach(() => { // must delete both of these to force a reload // of the index.js file - delete require.cache[symbols.cache] + delete require.cache.__NR_cache delete require.cache[require.resolve('../../../index.js')] })