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
The test case handles new session before old session finished saving in URLWrapper.spec.ts was failing due to incorrect async handling. The issue was caused by:
• Improper session sequencing: The test expected sessionId2, but received sessionId1.
• Lack of proper async handling: The test was not waiting for session updates correctly.
• Potential timeout issues: The test exceeded the default Jest timeout of 5000ms.
Steps to Reproduce:
1. Run yarn test.
2. Observe the failure in URLWrapper.spec.ts.
Proposed Fix:
• Use async/await for better handling of asynchronous session updates.
• Increase timeout using jest.setTimeout(10000).
• Modify sinon.stub to dynamically return session values while maintaining execution order.
• Ensure correct session sequencing with await new Promise(resolve => setTimeout(resolve, 100));.
• Restore stub after execution to prevent interference.
Acceptance Criteria:
• The test should correctly reflect session updates (sessionId2 should override sessionId1).
• yarn test should pass with no failures.
• Ensure that other dependent tests are not affected.
The text was updated successfully, but these errors were encountered:
Description:
The test case handles new session before old session finished saving in URLWrapper.spec.ts was failing due to incorrect async handling. The issue was caused by:
• Improper session sequencing: The test expected sessionId2, but received sessionId1.
• Lack of proper async handling: The test was not waiting for session updates correctly.
• Potential timeout issues: The test exceeded the default Jest timeout of 5000ms.
Steps to Reproduce:
1. Run yarn test.
2. Observe the failure in URLWrapper.spec.ts.
Proposed Fix:
• Use async/await for better handling of asynchronous session updates.
• Increase timeout using jest.setTimeout(10000).
• Modify sinon.stub to dynamically return session values while maintaining execution order.
• Ensure correct session sequencing with await new Promise(resolve => setTimeout(resolve, 100));.
• Restore stub after execution to prevent interference.
Acceptance Criteria:
• The test should correctly reflect session updates (sessionId2 should override sessionId1).
• yarn test should pass with no failures.
• Ensure that other dependent tests are not affected.
The text was updated successfully, but these errors were encountered: