-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.test.js
22 lines (14 loc) · 874 Bytes
/
index.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
'use strict';
const fs = require('fs');
const convertSrtToFCP7xml = require('./index.js').convertSrtToFCP7xml;
var xmlSampleOutputFileName = './sampleOutputFCP7XMLs/sampleOutput.xml';
var srtSampleFileName = './sampleSrts/Kyle_captions.srt';
// convertSrtToFCP7xml(srtSampleFileName,xmlSampleOutputFileName);
var xmlOutputSampleContent = fs.readFileSync(xmlSampleOutputFileName).toString();
var srtSampleFileConent = fs.readFileSync(srtSampleFileName).toString();
test('testing main convertSrtToFCP7xml with srt file name, expectign string content of xml', () => {
expect(convertSrtToFCP7xml({srt: srtSampleFileName})).toEqual(xmlOutputSampleContent);
});
test('testing main convertSrtToFCP7xml with srt file content as string, expectign string content of xml', () => {
expect(convertSrtToFCP7xml({srt: srtSampleFileConent})).toEqual(xmlOutputSampleContent);
});