I don't like including this, but I haven't thought of a way to avoid it. Each test inside a block comment must reference the block comment in which it is defined, so that the rewritten chunk may be inserted in the correct position.

    /*                                          }
     * > identity(42)           } test 1        }
     * 42                       }               } comment
     *                                          } chunk 1
     * > identity([1, 2, 3])    } test 2        }
     * [1, 2, 3]                }               }
     */                                         }
    function identity(x) {
      return x;
    }

    /*                                          }
     * > noop()                 } test 3        } comment
     * undefined                }               } chunk 2
     */                                         }
    function noop() {}