@@ -2129,50 +2129,50 @@ test('#active: false', function (t) {
2129
2129
test ( 'patches' , function ( t ) {
2130
2130
t . test ( '#clearPatches(name)' , function ( t ) {
2131
2131
const agent = new Agent ( ) . start ( ) ;
2132
- t . ok ( agent . _instrumentation . _patcherReg . has ( 'express ' ) ) ;
2133
- t . doesNotThrow ( ( ) => agent . clearPatches ( 'express ' ) ) ;
2134
- t . notOk ( agent . _instrumentation . _patcherReg . has ( 'express ' ) ) ;
2132
+ t . ok ( agent . _instrumentation . _patcherReg . has ( 'generic-pool ' ) ) ;
2133
+ t . doesNotThrow ( ( ) => agent . clearPatches ( 'generic-pool ' ) ) ;
2134
+ t . notOk ( agent . _instrumentation . _patcherReg . has ( 'generic-pool ' ) ) ;
2135
2135
t . doesNotThrow ( ( ) => agent . clearPatches ( 'does-not-exists' ) ) ;
2136
2136
agent . destroy ( ) ;
2137
2137
t . end ( ) ;
2138
2138
} ) ;
2139
2139
2140
2140
t . test ( '#addPatch(name, moduleName)' , function ( t ) {
2141
2141
const agent = new Agent ( ) ;
2142
- agent . clearPatches ( 'express ' ) ;
2142
+ agent . clearPatches ( 'generic-pool ' ) ;
2143
2143
agent . start ( agentOptsNoopTransport ) ;
2144
2144
2145
- agent . addPatch ( 'express ' , './test/_patch.js' ) ;
2145
+ agent . addPatch ( 'generic-pool ' , './test/_patch.js' ) ;
2146
2146
2147
- const before = require ( 'express ' ) ;
2147
+ const before = require ( 'generic-pool ' ) ;
2148
2148
const patch = require ( './_patch' ) ;
2149
2149
2150
- delete require . cache [ require . resolve ( 'express ' ) ] ;
2151
- t . deepEqual ( require ( 'express ' ) , patch ( before ) ) ;
2150
+ delete require . cache [ require . resolve ( 'generic-pool ' ) ] ;
2151
+ t . deepEqual ( require ( 'generic-pool ' ) , patch ( before ) ) ;
2152
2152
2153
2153
agent . destroy ( ) ;
2154
2154
t . end ( ) ;
2155
2155
} ) ;
2156
2156
2157
2157
t . test ( '#addPatch(name, function) - does not exist' , function ( t ) {
2158
2158
const agent = new Agent ( ) ;
2159
- agent . clearPatches ( 'express ' ) ;
2159
+ agent . clearPatches ( 'generic-pool ' ) ;
2160
2160
agent . start ( agentOptsNoopTransport ) ;
2161
2161
2162
2162
var replacement = {
2163
2163
foo : 'bar' ,
2164
2164
} ;
2165
2165
2166
- agent . addPatch ( 'express ' , ( exports , agent , { version, enabled } ) => {
2166
+ agent . addPatch ( 'generic-pool ' , ( exports , agent , { version, enabled } ) => {
2167
2167
t . ok ( exports ) ;
2168
2168
t . ok ( agent ) ;
2169
2169
t . ok ( version ) ;
2170
2170
t . ok ( enabled ) ;
2171
2171
return replacement ;
2172
2172
} ) ;
2173
2173
2174
- delete require . cache [ require . resolve ( 'express ' ) ] ;
2175
- t . deepEqual ( require ( 'express ' ) , replacement ) ;
2174
+ delete require . cache [ require . resolve ( 'generic-pool ' ) ] ;
2175
+ t . deepEqual ( require ( 'generic-pool ' ) , replacement ) ;
2176
2176
2177
2177
agent . destroy ( ) ;
2178
2178
t . end ( ) ;
0 commit comments