static registerCoverage()

in x-test.js [606:623]


  static registerCoverage(context, data) {
    if (!context.state.ended) {
      // New "coverage" goal. Queue it up.
      const stepId = context.uuid();
      const coverageId = data.coverageId;
      const index = context.state.stepIds.findLastIndex(candidateId => {
        const candidate = context.state.steps[candidateId];
        if (candidate.type === 'exit') {
          return true;
        }
      });
      context.state.stepIds.splice(index, 0, stepId);
      context.state.steps[stepId] = { stepId, type: 'coverage', coverageId: coverageId, status: 'waiting' };
      context.state.coverages[coverageId] = data;
      const childrenIndex = context.state.children.length;
      context.state.children.splice(childrenIndex, 0, { type: 'coverage', coverageId });
    }
  }