Socket
Socket
Sign inDemoInstall

@newrelic/test-utilities

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@newrelic/test-utilities - npm Package Compare versions

Comparing version 7.2.1 to 7.3.0

31

lib/agent.js

@@ -92,3 +92,3 @@ /*

/**
* Factory method for constructing an agent helper and bootstrapping agent
* Factory method for constructing an agent helper and bootstrapping core agent
* instrumentation.

@@ -100,8 +100,9 @@ *

* @param {?boolean} [setState=true] - Initialize agent with 'started' state.
* @param {?boolean} [instrumentFull=false] - Flag to register 3rd party instrumentation
*
* @return {TestAgent} The newly created `TestAgent` instance.
*/
TestAgent.makeInstrumented = function makeInstrumented(conf, setState) {
TestAgent.makeInstrumented = function makeInstrumented(conf, setState, instrumentFull) {
const helper = new TestAgent(conf, setState)
helper.instrument()
helper.instrument(instrumentFull)
return helper

@@ -111,2 +112,17 @@ }

/**
* Factory method for constructing an agent helper and bootstrapping core and
* 3rd party agent instrumentation.
*
* - `TestAgent.makeFullyInstrumented([conf [, setState]])`
*
* @param {?object} [conf] - A newrelic agent configuration.
* @param {?boolean} [setState=true] - Initialize agent with 'started' state.
*
* @return {TestAgent} The newly created `TestAgent` instance.
*/
TestAgent.makeFullyInstrumented = function makeInstrumented(conf, setState) {
return TestAgent.makeInstrumented(conf, setState, true)
}
/**
* Enables instrumentation from the shimmer.

@@ -120,8 +136,13 @@ *

*
* @param {boolean} [instrumentFull=false] - Flag to register 3rd party instrumentation
* @return {TestAgent} This `TestAgent` is returned.
*/
TestAgent.prototype.instrument = function instrument() {
TestAgent.prototype.instrument = function instrument(instrumentFull = false) {
shimmer.debug = true
shimmer.patchModule(this.agent)
shimmer.bootstrapInstrumentation(this.agent)
if (instrumentFull) {
shimmer.bootstrapInstrumentation(this.agent)
} else {
shimmer.registerCoreInstrumentation(this.agent)
}

@@ -128,0 +149,0 @@ return this

4

package.json
{
"name": "@newrelic/test-utilities",
"version": "7.2.1",
"version": "7.3.0",
"description": "Test library for New Relic instrumentation modules.",

@@ -44,3 +44,3 @@ "main": "index.js",

"husky": "^6.0.0",
"jsdoc": "^3.5.5",
"jsdoc": "^4.0.2",
"lint-staged": "^11.0.0",

@@ -47,0 +47,0 @@ "lockfile-lint": "^4.9.6",

@@ -1,3 +0,2 @@

[![Community Project header](https://github.com/newrelic/opensource-website/raw/main/src/images/categories/Community_Project.png)](https://opensource.newrelic.com/oss-category/#community-project)
<a href="https://opensource.newrelic.com/oss-category/#community-project"><picture><source media="(prefers-color-scheme: dark)" srcset="https://github.com/newrelic/opensource-website/raw/main/src/images/categories/dark/Community_Project.png"><source media="(prefers-color-scheme: light)" srcset="https://github.com/newrelic/opensource-website/raw/main/src/images/categories/Community_Project.png"><img alt="New Relic Open Source community project banner." src="https://github.com/newrelic/opensource-website/raw/main/src/images/categories/Community_Project.png"></picture></a>
# New Relic Test Utilities

@@ -248,2 +247,2 @@

[5]: https://codecov.io/gh/newrelic/node-test-utilities/branch/main/graph/badge.svg
[6]: https://codecov.io/gh/newrelic/node-test-utilities
[6]: https://codecov.io/gh/newrelic/node-test-utilities
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc