You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When importing (only!) the package, and trying to set context based on asyncHooks.executionAsyncId();
in BeforeEach
the returned executionId is X, and in the upcoming test (right after the beforeEach), the returned asyncHooks.executionAsyncId();
is X+1.
this is the resolution for the issue why getExecutionContext() returns undefined, although setExecutionContext({test:1}) was called in beforeEach, meaning before the test.
🐛 Bug Report
When importing (only!) the package, and trying to set context based on
asyncHooks.executionAsyncId();
in BeforeEach
the returned executionId is X, and in the upcoming test (right after the beforeEach), the returned
asyncHooks.executionAsyncId();
is X+1.
this is the resolution for the issue why getExecutionContext() returns undefined, although setExecutionContext({test:1}) was called in beforeEach, meaning before the test.
To Reproduce
uncomment the line:
const contextProvider = require('@mondaydotcomorg/node-execution-context');
`const asyncHooks = require('async_hooks');
const contextProvider = require('@mondaydotcomorg/node-execution-context');
let asyncIdBefore: number;
describe('AsyncHook test', () => {
});
`
Expected behavior
jest BeforeEach and the test should share the same context create with setExecutionContext in beforeEach.
envinfo
Node version: v10.15.3
"@mondaydotcomorg/node-execution-context": "^1.0.4",
The text was updated successfully, but these errors were encountered: