From 2747f36858da7859b0d25fa87616d4dc75d170c1 Mon Sep 17 00:00:00 2001 From: Thomas Hunter II Date: Thu, 19 Oct 2023 13:36:21 +0200 Subject: [PATCH] test: removing a final TODO --- patch-tracing-channel.js | 4 ++-- test/test-diagnostics-channel-bind-store.spec.js | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/patch-tracing-channel.js b/patch-tracing-channel.js index 40550fb..d3f957f 100644 --- a/patch-tracing-channel.js +++ b/patch-tracing-channel.js @@ -98,7 +98,7 @@ module.exports = function (unpatched) { context.error = err; error.publish(context); asyncStart.publish(context); - // TODO: Is there a way to have asyncEnd _after_ the continuation? + asyncEnd.publish(context); return PromiseReject(err); } @@ -106,7 +106,7 @@ module.exports = function (unpatched) { function resolve(result) { context.result = result; asyncStart.publish(context); - // TODO: Is there a way to have asyncEnd _after_ the continuation? + asyncEnd.publish(context); return result; } diff --git a/test/test-diagnostics-channel-bind-store.spec.js b/test/test-diagnostics-channel-bind-store.spec.js index 6a02259..2055ee1 100644 --- a/test/test-diagnostics-channel-bind-store.spec.js +++ b/test/test-diagnostics-channel-bind-store.spec.js @@ -54,17 +54,18 @@ test('test-diagnostics-channel-bind-store', t => { // Should support nested contexts n++; - channel.runStores(inputs[n], common.mustCall(function() { + const fn = common.mustCall(()=>{}); + channel.runStores(inputs[n], function() { + fn(); // Verify this and argument forwarding - // TODO: For some reason `this` === `global`. Seems like a bug in common.mustCall? - // t.strictEqual(this, undefined); + t.strictEqual(this, undefined); // Verify store 1 state matches input t.strictEqual(store1.getStore(), inputs[n]); // Verify store 2 state has expected transformation t.deepEqual(store2.getStore(), { data: inputs[n] }); - })); + }); n--; // Verify store 1 state matches input