mirror of
https://github.com/videojs/m3u8-parser.git
synced 2026-06-06 08:22:33 +00:00
chore: switch to rollup-plugin-data-files (#130)
This commit is contained in:
parent
e86dcae09d
commit
8f69b457cb
61 changed files with 96 additions and 166 deletions
28
package-lock.json
generated
28
package-lock.json
generated
|
|
@ -7476,6 +7476,34 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"rollup-plugin-data-files": {
|
||||
"version": "0.1.0",
|
||||
"resolved": "https://registry.npmjs.org/rollup-plugin-data-files/-/rollup-plugin-data-files-0.1.0.tgz",
|
||||
"integrity": "sha512-4RpKeF8gjbmrqaMsemVn5rh/+Fmlg9zpai5GgnX6QE5SAWonOjAgf4vwUMt0AtvowpFkcghXMpAhw3hCFX4vWA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@rollup/pluginutils": "^4.1.0",
|
||||
"matched": "^5.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@rollup/pluginutils": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.1.0.tgz",
|
||||
"integrity": "sha512-TrBhfJkFxA+ER+ew2U2/fHbebhLT/l/2pRk0hfj9KusXUuRXd2v0R58AfaZK9VXDQ4TogOSEmICVrQAA3zFnHQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"estree-walker": "^2.0.1",
|
||||
"picomatch": "^2.2.2"
|
||||
}
|
||||
},
|
||||
"estree-walker": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz",
|
||||
"integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"rollup-plugin-istanbul": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/rollup-plugin-istanbul/-/rollup-plugin-istanbul-2.0.1.tgz",
|
||||
|
|
|
|||
|
|
@ -25,8 +25,7 @@
|
|||
"scripts": {
|
||||
"build-test": "cross-env-shell TEST_BUNDLE_ONLY=1 'npm run build'",
|
||||
"build-prod": "cross-env-shell NO_TEST_BUNDLE=1 'npm run build'",
|
||||
"build-test-data": "node scripts/m3u8.js",
|
||||
"build": "npm-run-all -s clean build-test-data -p build:*",
|
||||
"build": "npm-run-all -s clean -p build:*",
|
||||
"build:js": "rollup -c scripts/rollup.config.js",
|
||||
"clean": "shx rm -rf ./dist ./test/dist && shx mkdir -p ./dist ./test/dist",
|
||||
"lint": "vjsstandard",
|
||||
|
|
@ -76,6 +75,7 @@
|
|||
"@videojs/generator-helpers": "~2.0.1",
|
||||
"karma": "^5.2.3",
|
||||
"rollup": "^2.36.1",
|
||||
"rollup-plugin-data-files": "^0.1.0",
|
||||
"sinon": "^9.2.3",
|
||||
"videojs-generate-karma-config": "~7.0.0",
|
||||
"videojs-generate-rollup-config": "~6.1.0",
|
||||
|
|
|
|||
|
|
@ -1,83 +0,0 @@
|
|||
'use strict';
|
||||
/* eslint no-console: 0 */
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const basePath = path.resolve(__dirname, '..');
|
||||
const testDataDir = path.join(basePath, 'test');
|
||||
const manifestDir = path.join(basePath, 'test', 'fixtures', 'integration');
|
||||
const manifestFilepath = path.join(testDataDir, 'dist', 'test-manifests.js');
|
||||
const expectedFilepath = path.join(testDataDir, 'dist', 'test-expected.js');
|
||||
|
||||
const build = function() {
|
||||
let manifests = 'export default {\n';
|
||||
let expected = 'export default {\n';
|
||||
|
||||
const files = fs.readdirSync(manifestDir);
|
||||
|
||||
while (files.length > 0) {
|
||||
const file = path.resolve(manifestDir, files.shift());
|
||||
const extname = path.extname(file);
|
||||
|
||||
if (extname === '.m3u8') {
|
||||
// translate this manifest
|
||||
manifests += ' \'' + path.basename(file, '.m3u8') + '\': ';
|
||||
manifests += fs.readFileSync(file, 'utf8')
|
||||
.split(/\r\n|\n/)
|
||||
// quote and concatenate
|
||||
.map(function(line) {
|
||||
return ' \'' + line + '\\n\' +\n';
|
||||
}).join('')
|
||||
// strip leading spaces and the trailing '+'
|
||||
.slice(4, -3);
|
||||
manifests += ',\n';
|
||||
} else if (extname === '.js') {
|
||||
// append the expected parse
|
||||
expected += ' "' + path.basename(file, '.js') + '": ';
|
||||
expected += fs.readFileSync(file, 'utf8');
|
||||
expected += ',\n';
|
||||
} else {
|
||||
console.log('Unknown file ' + file + ' found in manifest dir ' + manifestDir);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// clean up and close the objects
|
||||
manifests = manifests.slice(0, -2);
|
||||
manifests += '\n};\n';
|
||||
expected = expected.slice(0, -2);
|
||||
expected += '\n};\n';
|
||||
|
||||
fs.writeFileSync(manifestFilepath, manifests);
|
||||
fs.writeFileSync(expectedFilepath, expected);
|
||||
console.log('Wrote test data file ' + manifestFilepath);
|
||||
console.log('Wrote test data file ' + expectedFilepath);
|
||||
};
|
||||
|
||||
const watch = function() {
|
||||
build();
|
||||
fs.watch(manifestDir, function(event, filename) {
|
||||
console.log('files in manifest dir were changed rebuilding manifest data');
|
||||
build();
|
||||
});
|
||||
};
|
||||
|
||||
const clean = function() {
|
||||
try {
|
||||
fs.unlinkSync(manifestFilepath);
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
try {
|
||||
fs.unlinkSync(expectedFilepath);
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
build,
|
||||
watch,
|
||||
clean
|
||||
};
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
'use strict';
|
||||
const m3u8 = require('./export-m3u8s.js');
|
||||
|
||||
const args = require('minimist')(process.argv.slice(2), {
|
||||
boolean: ['watch', 'clean', 'build'],
|
||||
default: {
|
||||
build: true
|
||||
},
|
||||
alias: {
|
||||
b: 'build',
|
||||
c: 'clean',
|
||||
w: 'watch'
|
||||
}
|
||||
});
|
||||
|
||||
if (args.w) {
|
||||
m3u8.watch();
|
||||
} else if (args.c) {
|
||||
m3u8.clean();
|
||||
} else if (args.b) {
|
||||
m3u8.build();
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
const generate = require('videojs-generate-rollup-config');
|
||||
const replace = require('@rollup/plugin-replace');
|
||||
const dataFiles = require('rollup-plugin-data-files');
|
||||
|
||||
// see https://github.com/videojs/videojs-generate-rollup-config
|
||||
// for options
|
||||
|
|
@ -20,10 +21,16 @@ const options = {
|
|||
'require("@videojs/vhs-utils/es': 'require("@videojs/vhs-utils/cjs'
|
||||
});
|
||||
|
||||
defaults.dataFiles = dataFiles({
|
||||
expecteds: {include: 'test/fixtures/integration/*.js', transform: 'js', extensions: false},
|
||||
manifests: {include: 'test/fixtures/integration/*.m3u8', transform: 'string', extensions: false}
|
||||
});
|
||||
|
||||
return defaults;
|
||||
},
|
||||
plugins(defaults) {
|
||||
defaults.module.unshift('replace');
|
||||
defaults.test.unshift('dataFiles');
|
||||
|
||||
return defaults;
|
||||
}
|
||||
|
|
|
|||
2
test/fixtures/integration/absoluteUris.js
vendored
2
test/fixtures/integration/absoluteUris.js
vendored
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"mediaSequence": 0,
|
||||
"playlistType": "VOD",
|
||||
|
|
|
|||
2
test/fixtures/integration/allowCache.js
vendored
2
test/fixtures/integration/allowCache.js
vendored
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"mediaSequence": 0,
|
||||
"playlistType": "VOD",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"mediaSequence": 0,
|
||||
"playlistType": "VOD",
|
||||
|
|
|
|||
2
test/fixtures/integration/alternateAudio.js
vendored
2
test/fixtures/integration/alternateAudio.js
vendored
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
allowCache: true,
|
||||
discontinuityStarts: [],
|
||||
mediaGroups: {
|
||||
|
|
|
|||
2
test/fixtures/integration/alternateVideo.js
vendored
2
test/fixtures/integration/alternateVideo.js
vendored
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
allowCache: true,
|
||||
discontinuityStarts: [],
|
||||
mediaGroups: {
|
||||
|
|
|
|||
2
test/fixtures/integration/brightcove.js
vendored
2
test/fixtures/integration/brightcove.js
vendored
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"playlists": [
|
||||
{
|
||||
|
|
|
|||
2
test/fixtures/integration/byteRange.js
vendored
2
test/fixtures/integration/byteRange.js
vendored
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"mediaSequence": 0,
|
||||
"playlistType": "VOD",
|
||||
|
|
|
|||
2
test/fixtures/integration/dateTime.js
vendored
2
test/fixtures/integration/dateTime.js
vendored
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": false,
|
||||
"mediaSequence": 0,
|
||||
"playlistType": "VOD",
|
||||
|
|
|
|||
2
test/fixtures/integration/disallowCache.js
vendored
2
test/fixtures/integration/disallowCache.js
vendored
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": false,
|
||||
"mediaSequence": 0,
|
||||
"playlistType": "VOD",
|
||||
|
|
|
|||
2
test/fixtures/integration/disc-sequence.js
vendored
2
test/fixtures/integration/disc-sequence.js
vendored
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"mediaSequence": 0,
|
||||
"discontinuitySequence": 3,
|
||||
|
|
|
|||
2
test/fixtures/integration/discontinuity.js
vendored
2
test/fixtures/integration/discontinuity.js
vendored
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"mediaSequence": 0,
|
||||
"discontinuitySequence": 0,
|
||||
|
|
|
|||
2
test/fixtures/integration/domainUris.js
vendored
2
test/fixtures/integration/domainUris.js
vendored
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"mediaSequence": 0,
|
||||
"playlistType": "VOD",
|
||||
|
|
|
|||
2
test/fixtures/integration/empty.js
vendored
2
test/fixtures/integration/empty.js
vendored
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"discontinuityStarts": [],
|
||||
"segments": []
|
||||
|
|
|
|||
2
test/fixtures/integration/emptyAllowCache.js
vendored
2
test/fixtures/integration/emptyAllowCache.js
vendored
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"mediaSequence": 0,
|
||||
"playlistType": "VOD",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"mediaSequence": 0,
|
||||
"playlistType": "VOD",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"mediaSequence": 0,
|
||||
"segments": [
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"playlists": [
|
||||
{
|
||||
|
|
|
|||
2
test/fixtures/integration/encrypted.js
vendored
2
test/fixtures/integration/encrypted.js
vendored
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"mediaSequence": 7794,
|
||||
"discontinuitySequence": 0,
|
||||
|
|
|
|||
2
test/fixtures/integration/event.js
vendored
2
test/fixtures/integration/event.js
vendored
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"mediaSequence": 0,
|
||||
"playlistType": "EVENT",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"mediaSequence": 1,
|
||||
"segments": [
|
||||
|
|
|
|||
2
test/fixtures/integration/extinf.js
vendored
2
test/fixtures/integration/extinf.js
vendored
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"mediaSequence": 0,
|
||||
"playlistType": "VOD",
|
||||
|
|
|
|||
2
test/fixtures/integration/fmp4.js
vendored
2
test/fixtures/integration/fmp4.js
vendored
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"mediaSequence": 1,
|
||||
"playlistType": "VOD",
|
||||
|
|
|
|||
2
test/fixtures/integration/headerOnly.js
vendored
2
test/fixtures/integration/headerOnly.js
vendored
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"discontinuityStarts": [],
|
||||
"segments": []
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"mediaSequence": 0,
|
||||
"playlistType": "VOD",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"mediaSequence": 0,
|
||||
"playlistType": "VOD",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"mediaSequence": 0,
|
||||
"segments": [
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"mediaSequence": 0,
|
||||
"playlistType": "VOD",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"mediaSequence": 0,
|
||||
"playlistType": "VOD",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"mediaSequence": 0,
|
||||
"segments": [
|
||||
|
|
|
|||
2
test/fixtures/integration/llhls.js
vendored
2
test/fixtures/integration/llhls.js
vendored
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"dateTimeObject": new Date("2019-02-14T02:13:36.106Z"),
|
||||
"dateTimeString": "2019-02-14T02:13:36.106Z",
|
||||
|
|
|
|||
2
test/fixtures/integration/llhlsDelta.js
vendored
2
test/fixtures/integration/llhlsDelta.js
vendored
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"dateTimeObject": new Date("2019-02-14T02:14:00.106Z"),
|
||||
"dateTimeString": "2019-02-14T02:14:00.106Z",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"mediaSequence": 0,
|
||||
"segments": [
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"mediaSequence": 0,
|
||||
"segments": [
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"mediaSequence": 0,
|
||||
"segments": [
|
||||
|
|
|
|||
2
test/fixtures/integration/master-fmp4.js
vendored
2
test/fixtures/integration/master-fmp4.js
vendored
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
allowCache: true,
|
||||
discontinuityStarts: [],
|
||||
mediaGroups: {
|
||||
|
|
|
|||
2
test/fixtures/integration/master.js
vendored
2
test/fixtures/integration/master.js
vendored
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"playlists": [
|
||||
{
|
||||
|
|
|
|||
2
test/fixtures/integration/media.js
vendored
2
test/fixtures/integration/media.js
vendored
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"mediaSequence": 0,
|
||||
"playlistType": "VOD",
|
||||
|
|
|
|||
2
test/fixtures/integration/mediaSequence.js
vendored
2
test/fixtures/integration/mediaSequence.js
vendored
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"mediaSequence": 0,
|
||||
"playlistType": "VOD",
|
||||
|
|
|
|||
2
test/fixtures/integration/missingEndlist.js
vendored
2
test/fixtures/integration/missingEndlist.js
vendored
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"mediaSequence": 0,
|
||||
"segments": [
|
||||
|
|
|
|||
2
test/fixtures/integration/missingExtinf.js
vendored
2
test/fixtures/integration/missingExtinf.js
vendored
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"mediaSequence": 0,
|
||||
"playlistType": "VOD",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"mediaSequence": 0,
|
||||
"playlistType": "VOD",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"mediaSequence": 0,
|
||||
"playlistType": "VOD",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
allowCache: true,
|
||||
discontinuityStarts: [],
|
||||
mediaGroups: {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
allowCache: true,
|
||||
discontinuityStarts: [],
|
||||
mediaGroups: {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"mediaSequence": 0,
|
||||
"targetDuration": 10,
|
||||
|
|
|
|||
2
test/fixtures/integration/multipleVideo.js
vendored
2
test/fixtures/integration/multipleVideo.js
vendored
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
allowCache: true,
|
||||
discontinuityStarts: [],
|
||||
mediaGroups: {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"mediaSequence": -11,
|
||||
"playlistType": "VOD",
|
||||
|
|
|
|||
2
test/fixtures/integration/playlist.js
vendored
2
test/fixtures/integration/playlist.js
vendored
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"mediaSequence": 0,
|
||||
"playlistType": "VOD",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"mediaSequence": 17,
|
||||
"playlistType": "VOD",
|
||||
|
|
|
|||
2
test/fixtures/integration/start.js
vendored
2
test/fixtures/integration/start.js
vendored
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"mediaSequence": 0,
|
||||
"playlistType": "VOD",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"playlists": [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"mediaSequence": 11,
|
||||
"playlistType": "VOD",
|
||||
|
|
|
|||
2
test/fixtures/integration/versionInvalid.js
vendored
2
test/fixtures/integration/versionInvalid.js
vendored
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"mediaSequence": 0,
|
||||
"playlistType": "VOD",
|
||||
|
|
|
|||
2
test/fixtures/integration/whiteSpace.js
vendored
2
test/fixtures/integration/whiteSpace.js
vendored
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"mediaSequence": 0,
|
||||
"playlistType": "VOD",
|
||||
|
|
|
|||
2
test/fixtures/integration/zeroDuration.js
vendored
2
test/fixtures/integration/zeroDuration.js
vendored
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
module.exports = {
|
||||
"allowCache": true,
|
||||
"mediaSequence": 0,
|
||||
"playlistType": "VOD",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import QUnit from 'qunit';
|
||||
import testDataExpected from './dist/test-expected.js';
|
||||
import testDataManifests from './dist/test-manifests.js';
|
||||
import testDataExpected from 'data-files!expecteds';
|
||||
import testDataManifests from 'data-files!manifests';
|
||||
import {Parser} from '../src';
|
||||
|
||||
QUnit.module('m3u8s', function(hooks) {
|
||||
|
|
@ -421,12 +421,12 @@ QUnit.module('m3u8s', function(hooks) {
|
|||
throw new Error(`${key}.m3u8 does not have an equivelent expected js file to test against`);
|
||||
}
|
||||
QUnit.test(`parses ${key}.m3u8 as expected in ${key}.js`, function(assert) {
|
||||
this.parser.push(testDataManifests[key]);
|
||||
this.parser.push(testDataManifests[key]());
|
||||
this.parser.end();
|
||||
|
||||
assert.deepEqual(
|
||||
this.parser.manifest,
|
||||
testDataExpected[key],
|
||||
testDataExpected[key](),
|
||||
key + '.m3u8 was parsed correctly'
|
||||
);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue