vest 5.2.10 → 5.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1623,18 +1623,15 @@ class IsolateTestReconciler extends IsolateReconciler {
1623
1623
  return VestTest.is(currentNode) && VestTest.is(historyNode);
1624
1624
  }
1625
1625
  static reconcile(currentNode, historyNode) {
1626
- const reconcilerOutput = usePickNode(historyNode, currentNode);
1627
- cancelOverriddenPendingTestOnTestReRun(reconcilerOutput, currentNode, historyNode);
1628
- return reconcilerOutput;
1626
+ const reconcilerOutput = usePickNode(currentNode, historyNode);
1627
+ const nextNode = useVerifyTestRun(currentNode, reconcilerOutput);
1628
+ cancelOverriddenPendingTestOnTestReRun(nextNode, currentNode, historyNode);
1629
+ return nextNode;
1629
1630
  }
1630
1631
  }
1631
- function usePickNode(historyNode, currentNode) {
1632
- const collisionResult = handleCollision(currentNode, historyNode);
1633
- return useVerifyTestRun(currentNode, collisionResult);
1634
- }
1635
- function handleCollision(newNode, prevNode) {
1632
+ function usePickNode(newNode, prevNode) {
1636
1633
  if (vestjsRuntime.IsolateInspector.usesKey(newNode)) {
1637
- return VestTest.cast(vestjsRuntime.Reconciler.handleIsolateNodeWithKey(newNode, VestTest.isNonActionable));
1634
+ return useHandleTestWithKey(newNode);
1638
1635
  }
1639
1636
  if (vestjsRuntime.Reconciler.dropNextNodesOnReorder(nodeReorderDetected, newNode, prevNode)) {
1640
1637
  throwTestOrderError(newNode, prevNode);
@@ -1657,6 +1654,18 @@ function handleCollision(newNode, prevNode) {
1657
1654
  }
1658
1655
  return prevNode;
1659
1656
  }
1657
+ function useHandleTestWithKey(newNode) {
1658
+ return VestTest.cast(vestjsRuntime.Reconciler.handleIsolateNodeWithKey(newNode, (prevNode) => {
1659
+ // This is the revoke callback. it determines whether we should revoke the previous node and use the new one.
1660
+ if (VestTest.isNonActionable(prevNode)) {
1661
+ return true;
1662
+ }
1663
+ if (useIsExcluded(newNode)) {
1664
+ return false;
1665
+ }
1666
+ return true;
1667
+ }));
1668
+ }
1660
1669
  function cancelOverriddenPendingTestOnTestReRun(nextNode, currentNode, prevTestObject) {
1661
1670
  if (nextNode === currentNode && VestTest.is(currentNode)) {
1662
1671
  cancelOverriddenPendingTest(prevTestObject, currentNode);