Skip to content

Commit

Permalink
Merge pull request newrelic#1568 from bizob2828/fix-cache-2
Browse files Browse the repository at this point in the history
updated docs and smoke tests that were still referencing symbols.cache
  • Loading branch information
bizob2828 authored Mar 24, 2023
2 parents 2a044e4 + 673285a commit 5a5dbe2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions documentation/function-wrapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions test/smoke/index/index-bad-version.tap.js
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand All @@ -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')]
})

Expand Down

0 comments on commit 5a5dbe2

Please sign in to comment.