GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: verify tracePromise does not do runStores · nodejs/node@4b4336c

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/parallel
    • test-diagnostics-channel-tracing-channel-promise-run-stores.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/parallel/test-diagnostics-channel-tracing-channel-promise-run-stores.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-diagnostics-channel-tracing-channel-promise-run-stores.js
+11-4Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,23 @@ const assert = require('assert');
99
const channel = dc.tracingChannel('test');
1010
const store = new AsyncLocalStorage();
1111

12-
const context = { foo: 'bar' };
12+
const firstContext = { foo: 'bar' };
13+
const secondContext = { baz: 'buz' };
1314

1415
channel.start.bindStore(store, common.mustCall(() => {
15-
return context;
16+
return firstContext;
17+
}));
18+
19+
channel.asyncStart.bindStore(store, common.mustNotCall(() => {
20+
return secondContext;
1621
}));
1722

1823
assert.strictEqual(store.getStore(), undefined);
1924
channel.tracePromise(common.mustCall(async () => {
20-
assert.deepStrictEqual(store.getStore(), context);
25+
assert.deepStrictEqual(store.getStore(), firstContext);
2126
await setTimeout(1);
22-
assert.deepStrictEqual(store.getStore(), context);
27+
// Should _not_ switch to second context as promises don't have an "after"
28+
// point at which to do a runStores.
29+
assert.deepStrictEqual(store.getStore(), firstContext);
2330
}));
2431
assert.strictEqual(store.getStore(), undefined);

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.