@@ -19,13 +19,12 @@ const {
1919async function testPromiseContext ( { t, factory } ) {
2020 await t . test ( 'context switch' , async function ( t ) {
2121 const { agent, Promise } = t . nr
22- factory = factory . bind ( null , Promise )
2322 const plan = tspl ( t , { plan : 2 } )
2423
2524 const ctxA = helper . runInTransaction ( agent , function ( tx ) {
2625 return {
2726 transaction : tx ,
28- promise : factory ( '[tx a] ' )
27+ promise : factory ( Promise , '[tx a] ' )
2928 }
3029 } )
3130
@@ -50,7 +49,6 @@ async function testPromiseContext({ t, factory }) {
5049 await t . test ( 'context loss' , async function ( t ) {
5150 const plan = tspl ( t , { plan : 2 } )
5251 const { agent, Promise } = t . nr
53- factory = factory . bind ( null , Promise )
5452
5553 const ctxA = helper . runInTransaction ( agent , function ( tx ) {
5654 t . after ( function ( ) {
@@ -59,7 +57,7 @@ async function testPromiseContext({ t, factory }) {
5957
6058 return {
6159 transaction : tx ,
62- promise : factory ( '[tx a] ' )
60+ promise : factory ( Promise , '[tx a] ' )
6361 }
6462 } )
6563
@@ -77,9 +75,8 @@ async function testPromiseContext({ t, factory }) {
7775 await t . test ( 'context gain' , async function ( t ) {
7876 const plan = tspl ( t , { plan : 2 } )
7977 const { agent, Promise } = t . nr
80- factory = factory . bind ( null , Promise )
8178
82- const promise = factory ( '[no tx] ' )
79+ const promise = factory ( Promise , '[no tx] ' )
8380
8481 plan . ok ( ! agent . tracer . getTransaction ( ) , 'should not be in transaction' )
8582 helper . runInTransaction ( agent , function ( tx ) {
@@ -97,12 +94,11 @@ async function testPromiseContext({ t, factory }) {
9794 await t . test ( 'context expiration' , async function ( t ) {
9895 const plan = tspl ( t , { plan : 2 } )
9996 const { agent, Promise } = t . nr
100- factory = factory . bind ( null , Promise )
10197
10298 const ctxA = helper . runInTransaction ( agent , function ( tx ) {
10399 return {
104100 transaction : tx ,
105- promise : factory ( '[tx a] ' )
101+ promise : factory ( Promise , '[tx a] ' )
106102 }
107103 } )
108104
0 commit comments