"use strict";

var _mockFs = _interopRequireDefault(require("mock-fs"));

var _fs = _interopRequireDefault(require("fs"));

var _path = _interopRequireDefault(require("path"));

var _findVideoLocalSubtitles = _interopRequireDefault(require("./findVideoLocalSubtitles"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

describe('Find Video Local Subtitles', () => {
  const PATH_DIR = './fakeDir';
  beforeEach(() => {
    (0, _mockFs.default)({
      './fakeDir': {
        'video.mp4': '',
        'video.en.vtt': '',
        'video.zh-cn.vtt': '',
        'video.bt.vtt': '',
        'video.en-us.srt': '',
        'video.vtt': ''
      }
    });
  });
  afterEach(() => {
    _mockFs.default.restore();
  });
  test('should return subtitles', async () => {
    const subtitles = (0, _findVideoLocalSubtitles.default)('video', PATH_DIR);
    expect(subtitles.length).toBe(5);
  });
});