function verifyHelper(cues, text, time, hls = false, sequenceMode = false) {
    const data =
        shaka.util.BufferUtils.toUint8(shaka.util.StringUtils.toUTF8(text));

    const parser = new shaka.text.VttTextParser();
    if (hls) {
      parser.setManifestType(shaka.media.ManifestParser.HLS);
    }
    parser.setSequenceMode(sequenceMode);

    const result = parser.parseMedia(data, time);

    const checkCue = (cue) => {
      if (cue.nestedCues) {
        cue.nestedCues = cue.nestedCues.map((nestedCue) => checkCue(nestedCue));
      }
      return jasmine.objectContaining(cue);
    };

    const expected = cues.map(checkCue);
    expect(result).toEqual(expected);
  }
@param {!Array} cues
@param {string} text
@param {shaka.extern.TextParser.TimeContext} time
@param {boolean=} hls
@param {boolean=} sequenceMode