{"size": 866, "ext": "js", "max_stars_repo_path": "site_integrations/disney-plus/tests/parser.test.js", "max_stars_repo_name": "tamama9527/dual-captions", "max_stars_repo_stars_event_min_datetime": "2017-07-05T19:36:37.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-30T01:25:30.000Z", "max_issues_repo_path": "site_integrations/disney-plus/tests/parser.test.js", "max_issues_repo_name": "tamama9527/dual-captions", "max_issues_repo_issues_event_min_datetime": "2018-01-23T01:28:27.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-08T22:57:44.000Z", "max_forks_repo_path": "site_integrations/disney-plus/tests/parser.test.js", "max_forks_repo_name": "tamama9527/dual-captions", "max_forks_repo_forks_event_min_datetime": "2018-01-22T16:16:36.000Z", "max_forks_repo_forks_event_max_datetime": "2022-02-14T22:20:53.000Z"}
{"max_stars_count": 207, "max_issues_count": 123, "max_forks_count": 34, "avg_line_length": 23.4054054054, "max_line_length": 89, "alphanum_fraction": 0.6177829099}
const { expect } = require('chai');
const DisneyPlusParser = require('../parser');

const EXAMPLE_FILE = `

WEBVTT

STYLE
::cue() {
  font-family: Arial;
}

00:15:13.360 --> 00:15:15.920 line:90%,end
<i>Hey!</i>
I'm Mike

00:15:23.560 --> 00:15:25.120 line:90%,end
How are you?

`;

const parser = DisneyPlusParser;

describe('Disney+ parser', () => {
  it('should correctly parse', done => {
    parser(EXAMPLE_FILE)
      .then(result => {
        expect(result[0].startTime, 'should get correct startTime').to.equal(913.36);
        expect(result[0].endTime, 'should get correct endTime').to.equal(915.92);
        expect(result[0].text, 'should get correct text').to.equal("Hey!\nI'm Mike");
        expect(result.length, 'should parse out correct number of captions').to.equal(2);
        done();
      })
      .catch(err => { console.error(err) });
  });
});
