diff --git a/.npmignore b/.npmignore index aa27d81b..f05b1f26 100644 --- a/.npmignore +++ b/.npmignore @@ -1,5 +1,2 @@ -bower_components node_modules - test -test_data diff --git a/karma.conf.cjs b/karma.conf.cjs index f067caa7..827ed9a4 100644 --- a/karma.conf.cjs +++ b/karma.conf.cjs @@ -26,7 +26,7 @@ module.exports = function(config) { // list of files / patterns to load in the browser files: [ - { pattern: 'test_data/*', included: false }, + { pattern: 'test/data/*', included: false }, { pattern: 'test/tests.js', type: 'module', included: true } ], diff --git a/package.json b/package.json index beb35113..fb374ae2 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "test": "karma start karma.conf.cjs", "test-watch": "npm test -- --auto-watch --no-single-run", "build-demo": "cd demo/custom-markers && rollup -c", - "copy-demo-files": "copyfiles --up 1 test_data/sample.mp3 test_data/07023003.mp3 test_data/07023003-2channel.dat demo", + "copy-demo-files": "copyfiles --up 1 test/data/sample.mp3 test/data/07023003.mp3 test/data/07023003-2channel.dat demo", "prestart": "npm run build && npm run build-demo && npm run copy-demo-files", "start": "serve --listen 8080 --no-clipboard --no-request-logging demo", "prepack": "npm run build" diff --git a/test/api-player-spec.js b/test/api-player-spec.js index 69e463eb..c7e1db85 100644 --- a/test/api-player-spec.js +++ b/test/api-player-spec.js @@ -31,7 +31,7 @@ describe('Player', function() { }, mediaElement: document.getElementById('media'), dataUri: { - json: 'base/test_data/sample.json' + json: 'base/test/data/sample.json' }, logger: logger, player: player @@ -213,7 +213,7 @@ describe('Player', function() { }, mediaElement: document.getElementById('media'), dataUri: { - json: 'base/test_data/sample.json' + json: 'base/test/data/sample.json' }, logger: logger }; @@ -373,7 +373,7 @@ describe('Player', function() { }, mediaElement: document.getElementById('media'), dataUri: { - json: 'base/test_data/sample.json' + json: 'base/test/data/sample.json' }, player: player }; diff --git a/test/api-points-spec.js b/test/api-points-spec.js index 29d3c167..c98e97be 100644 --- a/test/api-points-spec.js +++ b/test/api-points-spec.js @@ -14,7 +14,7 @@ describe('Peaks.points', function() { }, mediaElement: document.getElementById('media'), dataUri: { - arraybuffer: '/base/test_data/sample.dat' + arraybuffer: '/base/test/data/sample.dat' } }; diff --git a/test/api-segments-spec.js b/test/api-segments-spec.js index 18c06194..23d2cd3d 100644 --- a/test/api-segments-spec.js +++ b/test/api-segments-spec.js @@ -16,7 +16,7 @@ describe('Peaks.segments', function() { }, mediaElement: document.getElementById('media'), dataUri: { - arraybuffer: 'base/test_data/sample.dat' + arraybuffer: 'base/test/data/sample.dat' }, logger: logger }; diff --git a/test/api-spec.js b/test/api-spec.js index 45f82ffb..d84c522b 100644 --- a/test/api-spec.js +++ b/test/api-spec.js @@ -3,7 +3,7 @@ import Scrollbar from '../src/scrollbar'; import WaveformOverview from '../src/waveform-overview'; import WaveformZoomView from '../src/waveform-zoomview'; -import sampleJsonData from '../test_data/sample.json'; +import sampleJsonData from './data/sample.json'; import WaveformData from 'waveform-data'; import Konva from 'konva'; @@ -43,7 +43,7 @@ describe('Peaks', function() { container: document.getElementById('zoomview-container') }, mediaElement: document.getElementById('media'), - dataUri: { arraybuffer: '/base/test_data/sample.dat' } + dataUri: { arraybuffer: '/base/test/data/sample.dat' } }, function(err, instance) { expect(err).to.equal(null); @@ -62,7 +62,7 @@ describe('Peaks', function() { container: document.getElementById('zoomview-container') }, mediaElement: document.getElementById('media'), - dataUri: { arraybuffer: '/base/test_data/sample.dat' } + dataUri: { arraybuffer: '/base/test/data/sample.dat' } }, function(err, instance) { expect(err).to.equal(null); @@ -82,7 +82,7 @@ describe('Peaks', function() { container: document.getElementById('zoomview-container') }, mediaElement: document.getElementById('media'), - dataUri: { arraybuffer: '/base/test_data/sample.dat' } + dataUri: { arraybuffer: '/base/test/data/sample.dat' } }, function(err, instance) { expect(err).to.equal(null); @@ -105,7 +105,7 @@ describe('Peaks', function() { container: document.getElementById('zoomview-container') }, mediaElement: document.getElementById('media'), - dataUri: { arraybuffer: '/base/test_data/sample.dat' } + dataUri: { arraybuffer: '/base/test/data/sample.dat' } }, function(err, instance) { expect(err).to.equal(null); expect(instance).to.be.an.instanceof(Peaks); @@ -121,7 +121,7 @@ describe('Peaks', function() { container: document.getElementById('overview-container') }, mediaElement: document.getElementById('media'), - dataUri: { arraybuffer: '/base/test_data/sample.dat' } + dataUri: { arraybuffer: '/base/test/data/sample.dat' } }, function(err, instance) { expect(err).to.equal(null); expect(instance).to.be.an.instanceof(Peaks); @@ -137,7 +137,7 @@ describe('Peaks', function() { container: document.getElementById('zoomview-container') }, mediaElement: document.getElementById('media'), - dataUri: { arraybuffer: '/base/test_data/sample.dat' } + dataUri: { arraybuffer: '/base/test/data/sample.dat' } }, function(err, instance) { expect(err).to.equal(null); expect(instance).to.be.an.instanceof(Peaks); @@ -155,7 +155,7 @@ describe('Peaks', function() { overview: { }, mediaElement: document.getElementById('media'), - dataUri: { arraybuffer: '/base/test_data/sample.dat' } + dataUri: { arraybuffer: '/base/test/data/sample.dat' } }, function(err, instance) { expect(err).to.be.an.instanceOf(TypeError); expect(err.message).to.match(/must be valid HTML elements/); @@ -193,7 +193,7 @@ describe('Peaks', function() { axisGridlineColor: '#808080' }, mediaElement: document.getElementById('media'), - dataUri: { arraybuffer: '/base/test_data/sample.dat' } + dataUri: { arraybuffer: '/base/test/data/sample.dat' } }, function(err, instance) { expect(err).to.equal(null); expect(instance).to.be.an.instanceof(Peaks); @@ -231,7 +231,7 @@ describe('Peaks', function() { container: document.getElementById('zoomview-container') }, mediaElement: document.getElementById('media'), - dataUri: { arraybuffer: '/base/test_data/sample.dat' }, + dataUri: { arraybuffer: '/base/test/data/sample.dat' }, playheadColor: '#ff0000', playheadTextColor: '#00ff00', showPlayheadTime: true, @@ -277,7 +277,7 @@ describe('Peaks', function() { container: document.getElementById('zoomview-container') }, mediaElement: document.getElementById('media'), - dataUri: { arraybuffer: '/base/test_data/sample.dat' } + dataUri: { arraybuffer: '/base/test/data/sample.dat' } }, function(err, instance) { expect(err).to.equal(null); expect(instance).to.be.an.instanceof(Peaks); @@ -318,7 +318,7 @@ describe('Peaks', function() { container: document.getElementById('scrollbar-container') }, mediaElement: document.getElementById('media'), - dataUri: { arraybuffer: '/base/test_data/sample.dat' } + dataUri: { arraybuffer: '/base/test/data/sample.dat' } }, function(err, instance) { expect(err).to.equal(null); expect(instance).to.be.an.instanceof(Peaks); @@ -338,7 +338,7 @@ describe('Peaks', function() { container: document.getElementById('zoomview-container') }, mediaElement: document.getElementById('media'), - dataUri: { arraybuffer: '/base/test_data/07023003-2channel.dat' } + dataUri: { arraybuffer: '/base/test/data/07023003-2channel.dat' } }, function(err, instance) { expect(err).to.equal(null); expect(instance).to.be.an.instanceOf(Peaks); @@ -374,7 +374,7 @@ describe('Peaks', function() { context('with valid binary waveform data', function() { it('should initialise correctly', function(done) { - fetch('/base/test_data/sample.dat') + fetch('/base/test/data/sample.dat') .then(function(response) { return response.arrayBuffer(); }) @@ -429,7 +429,7 @@ describe('Peaks', function() { it('should initialise correctly', function(done) { const audioContext = new TestAudioContext(); - fetch('/base/test_data/sample.mp3') + fetch('/base/test/data/sample.mp3') .then(function(response) { return response.arrayBuffer(); }) @@ -490,7 +490,7 @@ describe('Peaks', function() { beforeEach(function() { mediaElement = document.createElement('audio'); mediaElement.id = 'adpcm'; - mediaElement.src = '/base/test_data/adpcm.wav'; + mediaElement.src = '/base/test/data/adpcm.wav'; mediaElement.muted = true; document.body.appendChild(mediaElement); }); @@ -508,7 +508,7 @@ describe('Peaks', function() { container: document.getElementById('zoomview-container') }, mediaElement: document.getElementById('adpcm'), - dataUri: { arraybuffer: '/base/test_data/sample.dat' } + dataUri: { arraybuffer: '/base/test/data/sample.dat' } }, function(err, instance) { expect(err).to.be.an.instanceOf(MediaError); expect(err.code).to.equal(MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED); @@ -537,7 +537,7 @@ describe('Peaks', function() { zoomview: { container: document.getElementById('zoomview-container') }, - dataUri: { arraybuffer: '/base/test_data/sample.dat' } + dataUri: { arraybuffer: '/base/test/data/sample.dat' } }, function(err, instance) { expect(err).to.be.an.instanceOf(Error); expect(err.message).to.match(/Missing mediaElement option/); @@ -555,7 +555,7 @@ describe('Peaks', function() { container: document.getElementById('zoomview-container') }, mediaElement: document.createElement('div'), - dataUri: { arraybuffer: '/base/test_data/sample.dat' } + dataUri: { arraybuffer: '/base/test/data/sample.dat' } }, function(err, instance) { expect(err).to.be.an.instanceOf(TypeError); expect(err.message).to.match(/HTMLMediaElement/); @@ -573,7 +573,7 @@ describe('Peaks', function() { container: document.getElementById('zoomview-container') }, mediaElement: document.getElementById('media'), - dataUri: { arraybuffer: '/base/test_data/sample.dat' }, + dataUri: { arraybuffer: '/base/test/data/sample.dat' }, webAudio: { audioContext: new TestAudioContext() } @@ -640,7 +640,7 @@ describe('Peaks', function() { }); it('should invoke callback with an error if provided binary waveform data is invalid', function(done) { - fetch('/base/test_data/unknown.dat') + fetch('/base/test/data/unknown.dat') .then(function(response) { return response.arrayBuffer(); }) @@ -667,7 +667,7 @@ describe('Peaks', function() { it('should invoke callback with an error if no zoomview or overview options are provided', function(done) { Peaks.init({ mediaElement: document.getElementById('media'), - dataUri: { arraybuffer: '/base/test_data/sample.dat' } + dataUri: { arraybuffer: '/base/test/data/sample.dat' } }, function(err, instance) { expect(err).to.be.an.instanceOf(Error); expect(err.message).to.match(/must be valid HTML elements/); @@ -686,7 +686,7 @@ describe('Peaks', function() { }, mediaElement: document.getElementById('media'), dataUri: { - arraybuffer: 'base/test_data/sample.dat' + arraybuffer: 'base/test/data/sample.dat' }, logger: 'foo' }, function(err, instance) { @@ -707,7 +707,7 @@ describe('Peaks', function() { }, mediaElement: document.getElementById('media'), dataUri: { - arraybuffer: 'base/test_data/sample.dat' + arraybuffer: 'base/test/data/sample.dat' }, zoomLevels: null }, function(err, instance) { @@ -728,7 +728,7 @@ describe('Peaks', function() { }, mediaElement: document.getElementById('media'), dataUri: { - arraybuffer: 'base/test_data/sample.dat' + arraybuffer: 'base/test/data/sample.dat' }, zoomLevels: [] }, function(err, instance) { @@ -749,7 +749,7 @@ describe('Peaks', function() { }, mediaElement: document.getElementById('media'), dataUri: { - arraybuffer: 'base/test_data/sample.dat' + arraybuffer: 'base/test/data/sample.dat' }, zoomLevels: [1024, 512] }, function(err, instance) { @@ -770,7 +770,7 @@ describe('Peaks', function() { }, mediaElement: document.getElementById('media'), dataUri: { - arraybuffer: 'base/test_data/sample.dat' + arraybuffer: 'base/test/data/sample.dat' } }; @@ -792,7 +792,7 @@ describe('Peaks', function() { }, mediaElement: document.getElementById('media'), dataUri: { - arraybuffer: 'base/test_data/sample.dat' + arraybuffer: 'base/test/data/sample.dat' } }; @@ -814,7 +814,7 @@ describe('Peaks', function() { }, mediaElement: document.getElementById('media'), dataUri: { - arraybuffer: 'base/test_data/sample.dat' + arraybuffer: 'base/test/data/sample.dat' } }; @@ -836,7 +836,7 @@ describe('Peaks', function() { }, mediaElement: document.getElementById('media'), dataUri: { - arraybuffer: 'base/test_data/sample.dat' + arraybuffer: 'base/test/data/sample.dat' } }; @@ -857,7 +857,7 @@ describe('Peaks', function() { }, mediaElement: document.getElementById('media'), dataUri: { - arraybuffer: 'base/test_data/sample.dat' + arraybuffer: 'base/test/data/sample.dat' } }; @@ -880,7 +880,7 @@ describe('Peaks', function() { }, mediaElement: document.getElementById('media'), dataUri: { - arraybuffer: 'base/test_data/sample.dat' + arraybuffer: 'base/test/data/sample.dat' } }; @@ -908,7 +908,7 @@ describe('Peaks', function() { container: document.getElementById('zoomview-container') }, mediaElement: document.getElementById('media'), - dataUri: { arraybuffer: '/base/test_data/sample.dat' }, + dataUri: { arraybuffer: '/base/test/data/sample.dat' }, zoomLevels: [512, 1024, 2048] }; @@ -928,9 +928,9 @@ describe('Peaks', function() { context('with invalid media url', function() { it('should return an error', function(done) { const options = { - mediaUrl: '/base/test_data/unknown.mp3', + mediaUrl: '/base/test/data/unknown.mp3', dataUri: { - arraybuffer: '/base/test_data/unknown.dat' + arraybuffer: '/base/test/data/unknown.dat' } }; @@ -942,9 +942,9 @@ describe('Peaks', function() { it('should preserve existing event handlers', function(done) { const options = { - mediaUrl: '/base/test_data/unknown.mp3', + mediaUrl: '/base/test/data/unknown.mp3', dataUri: { - arraybuffer: '/base/test_data/unknown.dat' + arraybuffer: '/base/test/data/unknown.dat' } }; @@ -965,7 +965,7 @@ describe('Peaks', function() { context('with invalid json waveform data', function() { it('should return an error', function(done) { const options = { - mediaUrl: '/base/test_data/sample.mp3', + mediaUrl: '/base/test/data/sample.mp3', waveformData: { json: { data: 'foo' } } @@ -981,7 +981,7 @@ describe('Peaks', function() { context('with valid json waveform data', function() { it('should update the waveform', function(done) { const options = { - mediaUrl: '/base/test_data/sample.mp3', + mediaUrl: '/base/test/data/sample.mp3', waveformData: { json: sampleJsonData } @@ -998,9 +998,9 @@ describe('Peaks', function() { context('with waveform data url', function() { it('should update the waveform', function(done) { const options = { - mediaUrl: '/base/test_data/sample.mp3', + mediaUrl: '/base/test/data/sample.mp3', dataUri: { - arraybuffer: '/base/test_data/sample.dat' + arraybuffer: '/base/test/data/sample.dat' } }; @@ -1015,7 +1015,7 @@ describe('Peaks', function() { context('with audioContext', function() { it('should update the waveform', function(done) { const options = { - mediaUrl: '/base/test_data/sample.mp3', + mediaUrl: '/base/test/data/sample.mp3', webAudio: { audioContext: new TestAudioContext() } @@ -1033,7 +1033,7 @@ describe('Peaks', function() { it('should update the waveform', function(done) { const audioContext = new TestAudioContext(); - fetch('/base/test_data/sample.mp3') + fetch('/base/test/data/sample.mp3') .then(function(response) { return response.arrayBuffer(); }) @@ -1042,7 +1042,7 @@ describe('Peaks', function() { }) .then(function(audioBuffer) { const options = { - mediaUrl: '/base/test_data/sample.mp3', + mediaUrl: '/base/test/data/sample.mp3', webAudio: { audioBuffer: audioBuffer, multiChannel: true @@ -1060,13 +1060,13 @@ describe('Peaks', function() { context('with binary waveform data', function() { it('should update the waveform', function(done) { - fetch('/base/test_data/sample.dat') + fetch('/base/test/data/sample.dat') .then(function(response) { return response.arrayBuffer(); }) .then(function(buffer) { const options = { - mediaUrl: '/base/test_data/sample.mp3', + mediaUrl: '/base/test/data/sample.mp3', waveformData: { arraybuffer: buffer } @@ -1083,13 +1083,13 @@ describe('Peaks', function() { context('with invalid binary waveform data', function() { it('should return an error', function(done) { - fetch('/base/test_data/unknown.dat') + fetch('/base/test/data/unknown.dat') .then(function(response) { return response.arrayBuffer(); }) .then(function(buffer) { const options = { - mediaUrl: '/base/test_data/sample.mp3', + mediaUrl: '/base/test/data/sample.mp3', waveformData: { arraybuffer: buffer } @@ -1106,7 +1106,7 @@ describe('Peaks', function() { context('with zoom levels', function() { it('should update the instance zoom levels', function(done) { const options = { - mediaUrl: '/base/test_data/sample.mp3', + mediaUrl: '/base/test/data/sample.mp3', webAudio: { audioContext: new TestAudioContext() }, @@ -1125,9 +1125,9 @@ describe('Peaks', function() { context('with stereo waveform', function() { it('should update the waveform', function(done) { const options = { - mediaUrl: '/base/test_data/07023003.mp3', + mediaUrl: '/base/test/data/07023003.mp3', dataUri: { - arraybuffer: '/base/test_data/07023003-2channel.dat' + arraybuffer: '/base/test/data/07023003-2channel.dat' }, zoomLevels: [128, 256] }; @@ -1209,7 +1209,7 @@ describe('Peaks', function() { container: document.getElementById('scrollbar-container') }, mediaElement: document.getElementById('media'), - dataUri: { arraybuffer: '/base/test_data/sample.dat' } + dataUri: { arraybuffer: '/base/test/data/sample.dat' } }, function(err, peaks) { expect(err).to.equal(null); diff --git a/test/api-view-spec.js b/test/api-view-spec.js index c7ca2aac..36d950fa 100644 --- a/test/api-view-spec.js +++ b/test/api-view-spec.js @@ -17,7 +17,7 @@ describe('WaveformView', function() { }, mediaElement: document.getElementById('media'), dataUri: { - arraybuffer: 'base/test_data/sample.dat' + arraybuffer: 'base/test/data/sample.dat' }, logger: logger }; diff --git a/test/api-views-spec.js b/test/api-views-spec.js index 29f2f02e..68a12f1f 100644 --- a/test/api-views-spec.js +++ b/test/api-views-spec.js @@ -20,7 +20,7 @@ describe('Peaks.views', function() { }, mediaElement: document.getElementById('media'), dataUri: { - json: 'base/test_data/sample.json' + json: 'base/test/data/sample.json' } }; @@ -50,7 +50,7 @@ describe('Peaks.views', function() { }, mediaElement: document.getElementById('media'), dataUri: { - json: 'base/test_data/sample.json' + json: 'base/test/data/sample.json' } }; @@ -84,7 +84,7 @@ describe('Peaks.views', function() { }, mediaElement: document.getElementById('media'), dataUri: { - json: 'base/test_data/sample.json' + json: 'base/test/data/sample.json' } }; @@ -114,7 +114,7 @@ describe('Peaks.views', function() { }, mediaElement: document.getElementById('media'), dataUri: { - json: 'base/test_data/sample.json' + json: 'base/test/data/sample.json' } }; @@ -151,7 +151,7 @@ describe('Peaks.views', function() { }, mediaElement: document.getElementById('media'), dataUri: { - json: 'base/test_data/sample.json' + json: 'base/test/data/sample.json' } }; @@ -191,7 +191,7 @@ describe('Peaks.views', function() { }, mediaElement: document.getElementById('media'), dataUri: { - json: 'base/test_data/sample.json' + json: 'base/test/data/sample.json' } }; @@ -231,7 +231,7 @@ describe('Peaks.views', function() { }, mediaElement: document.getElementById('media'), dataUri: { - json: 'base/test_data/sample.json' + json: 'base/test/data/sample.json' } }; @@ -276,7 +276,7 @@ describe('Peaks.views', function() { }, mediaElement: document.getElementById('media'), dataUri: { - json: 'base/test_data/sample.json' + json: 'base/test/data/sample.json' } }; @@ -306,7 +306,7 @@ describe('Peaks.views', function() { }, mediaElement: document.getElementById('media'), dataUri: { - json: 'base/test_data/sample.json' + json: 'base/test/data/sample.json' } }; @@ -332,7 +332,7 @@ describe('Peaks.views', function() { }, mediaElement: document.getElementById('media'), dataUri: { - json: 'base/test_data/sample.json' + json: 'base/test/data/sample.json' } }; @@ -363,7 +363,7 @@ describe('Peaks.views', function() { }, mediaElement: document.getElementById('media'), dataUri: { - json: 'base/test_data/sample.json' + json: 'base/test/data/sample.json' } }; @@ -393,7 +393,7 @@ describe('Peaks.views', function() { }, mediaElement: document.getElementById('media'), dataUri: { - json: 'base/test_data/sample.json' + json: 'base/test/data/sample.json' } }; @@ -419,7 +419,7 @@ describe('Peaks.views', function() { }, mediaElement: document.getElementById('media'), dataUri: { - json: 'base/test_data/sample.json' + json: 'base/test/data/sample.json' } }; diff --git a/test/api-zoom-spec.js b/test/api-zoom-spec.js index 122692de..6862c2ec 100644 --- a/test/api-zoom-spec.js +++ b/test/api-zoom-spec.js @@ -14,7 +14,7 @@ describe('Peaks.zoom', function() { }, mediaElement: document.getElementById('media'), dataUri: { - json: 'base/test_data/sample.json' + json: 'base/test/data/sample.json' }, zoomLevels: [512, 1024] }; @@ -106,7 +106,7 @@ describe('Peaks.zoom', function() { }, mediaElement: document.getElementById('media'), dataUri: { - json: 'base/test_data/sample.json' + json: 'base/test/data/sample.json' }, zoomLevels: [512, 1024] }; diff --git a/test/cue-emitter-spec.js b/test/cue-emitter-spec.js index 0bf34557..23c1bc6a 100644 --- a/test/cue-emitter-spec.js +++ b/test/cue-emitter-spec.js @@ -16,7 +16,7 @@ describe('CueEmitter', function() { }, mediaElement: document.getElementById('media'), dataUri: { - arraybuffer: 'base/test_data/sample.dat' + arraybuffer: 'base/test/data/sample.dat' }, emitCueEvents: false }; @@ -56,7 +56,7 @@ describe('CueEmitter', function() { }, mediaElement: document.getElementById('media'), dataUri: { - arraybuffer: 'base/test_data/sample.dat' + arraybuffer: 'base/test/data/sample.dat' }, emitCueEvents: true, points: [{ time: 1.0 }], @@ -82,7 +82,7 @@ describe('CueEmitter', function() { }, mediaElement: document.getElementById('media'), dataUri: { - arraybuffer: 'base/test_data/sample.dat' + arraybuffer: 'base/test/data/sample.dat' }, emitCueEvents: true }; @@ -340,7 +340,7 @@ describe('CueEmitter', function() { container: document.getElementById('zoomview-container') }, dataUri: { - arraybuffer: 'base/test_data/sample.dat' + arraybuffer: 'base/test/data/sample.dat' }, player: player, emitCueEvents: true diff --git a/test_data/07023003-2channel.dat b/test/data/07023003-2channel.dat similarity index 100% rename from test_data/07023003-2channel.dat rename to test/data/07023003-2channel.dat diff --git a/test_data/07023003.mp3 b/test/data/07023003.mp3 similarity index 100% rename from test_data/07023003.mp3 rename to test/data/07023003.mp3 diff --git a/test_data/STAT3S3.dat b/test/data/STAT3S3.dat similarity index 100% rename from test_data/STAT3S3.dat rename to test/data/STAT3S3.dat diff --git a/test_data/STAT3S3.mp3 b/test/data/STAT3S3.mp3 similarity index 100% rename from test_data/STAT3S3.mp3 rename to test/data/STAT3S3.mp3 diff --git a/test_data/adpcm.wav b/test/data/adpcm.wav similarity index 100% rename from test_data/adpcm.wav rename to test/data/adpcm.wav diff --git a/test_data/sample.dat b/test/data/sample.dat similarity index 100% rename from test_data/sample.dat rename to test/data/sample.dat diff --git a/test_data/sample.json b/test/data/sample.json similarity index 100% rename from test_data/sample.json rename to test/data/sample.json diff --git a/test_data/sample.mp3 b/test/data/sample.mp3 similarity index 100% rename from test_data/sample.mp3 rename to test/data/sample.mp3 diff --git a/test_data/sample.ogg b/test/data/sample.ogg similarity index 100% rename from test_data/sample.ogg rename to test/data/sample.ogg diff --git a/test_data/sample_16bit.dat b/test/data/sample_16bit.dat similarity index 100% rename from test_data/sample_16bit.dat rename to test/data/sample_16bit.dat diff --git a/test/keyboard-handler-spec.js b/test/keyboard-handler-spec.js index 854adfe9..640479b6 100644 --- a/test/keyboard-handler-spec.js +++ b/test/keyboard-handler-spec.js @@ -17,7 +17,7 @@ describe('KeyboardHandler', function() { }, mediaElement: document.getElementById('media'), dataUri: { - arraybuffer: 'base/test_data/sample.dat' + arraybuffer: 'base/test/data/sample.dat' }, keyboard: true }; diff --git a/test/point-spec.js b/test/point-spec.js index a736e87e..33f66f26 100644 --- a/test/point-spec.js +++ b/test/point-spec.js @@ -14,7 +14,7 @@ describe('Point', function() { container: document.getElementById('zoomview-container') }, mediaElement: document.getElementById('media'), - dataUri: { arraybuffer: 'base/test_data/sample.dat' } + dataUri: { arraybuffer: 'base/test/data/sample.dat' } }; Peaks.init(options, function(err, instance) { diff --git a/test/points-layer-spec.js b/test/points-layer-spec.js index bd005519..b59ac66f 100644 --- a/test/points-layer-spec.js +++ b/test/points-layer-spec.js @@ -13,7 +13,7 @@ describe('PointsLayer', function() { }, mediaElement: document.getElementById('media'), dataUri: { - json: 'base/test_data/sample.json' + json: 'base/test/data/sample.json' } }; diff --git a/test/scrollbar-spec.js b/test/scrollbar-spec.js index 21a00254..9fa0ca5b 100644 --- a/test/scrollbar-spec.js +++ b/test/scrollbar-spec.js @@ -18,7 +18,7 @@ describe('Scrollbar', function() { }, mediaElement: document.getElementById('media'), dataUri: { - arraybuffer: 'base/test_data/sample.dat' + arraybuffer: 'base/test/data/sample.dat' } }; @@ -121,7 +121,7 @@ describe('Scrollbar', function() { }, mediaElement: document.getElementById('media'), dataUri: { - arraybuffer: 'base/test_data/sample.dat' + arraybuffer: 'base/test/data/sample.dat' } }; diff --git a/test/segment-shape-spec.js b/test/segment-shape-spec.js index cc96c13e..4309003d 100644 --- a/test/segment-shape-spec.js +++ b/test/segment-shape-spec.js @@ -18,7 +18,7 @@ describe('SegmentShape', function() { }, mediaElement: document.getElementById('media'), dataUri: { - json: 'base/test_data/sample.json' + json: 'base/test/data/sample.json' }, segmentOptions: {} }; diff --git a/test/segment-spec.js b/test/segment-spec.js index ad3e8caf..da0dd5c1 100644 --- a/test/segment-spec.js +++ b/test/segment-spec.js @@ -14,7 +14,7 @@ describe('Segment', function() { container: document.getElementById('zoomview-container') }, mediaElement: document.getElementById('media'), - dataUri: { arraybuffer: 'base/test_data/sample.dat' } + dataUri: { arraybuffer: 'base/test/data/sample.dat' } }; Peaks.init(options, function(err, instance) { diff --git a/test/segments-layer-spec.js b/test/segments-layer-spec.js index 6e4dc6a4..b2b48090 100644 --- a/test/segments-layer-spec.js +++ b/test/segments-layer-spec.js @@ -13,7 +13,7 @@ describe('SegmentsLayer', function() { }, mediaElement: document.getElementById('media'), dataUri: { - json: 'base/test_data/sample.json' + json: 'base/test/data/sample.json' } }; diff --git a/test/setup.js b/test/setup.js index 9d81d648..fee93178 100644 --- a/test/setup.js +++ b/test/setup.js @@ -19,7 +19,7 @@ beforeEach(function(done) { const mediaElement = document.createElement('audio'); mediaElement.id = 'media'; - mediaElement.src = '/base/test_data/sample.mp3'; + mediaElement.src = '/base/test/data/sample.mp3'; mediaElement.muted = true; document.body.appendChild(mediaElement); diff --git a/test/waveform-builder-spec.js b/test/waveform-builder-spec.js index 8676de4c..2573de75 100644 --- a/test/waveform-builder-spec.js +++ b/test/waveform-builder-spec.js @@ -1,5 +1,5 @@ import WaveformBuilder from '../src/waveform-builder'; -import sampleJsonData from '../test_data/sample.json'; +import sampleJsonData from './data/sample.json'; import WaveformData from 'waveform-data'; @@ -11,7 +11,7 @@ describe('WaveformBuilder', function() { const peaks = { options: { mediaElement: document.getElementById('media'), - dataUri: 'base/test_data/sample.json' + dataUri: 'base/test/data/sample.json' } }; @@ -29,7 +29,7 @@ describe('WaveformBuilder', function() { options: { mediaElement: document.getElementById('media'), dataUri: { - json: 'base/test_data/404-file.json' + json: 'base/test/data/404-file.json' } } }; @@ -70,7 +70,7 @@ describe('WaveformBuilder', function() { options: { mediaElement: document.getElementById('media'), dataUri: { - json: 'base/test_data/sample.json' + json: 'base/test/data/sample.json' } } }; @@ -96,7 +96,7 @@ describe('WaveformBuilder', function() { options: { mediaElement: document.getElementById('media'), dataUri: { - arraybuffer: 'base/test_data/sample.dat' + arraybuffer: 'base/test/data/sample.dat' } } }; @@ -122,7 +122,7 @@ describe('WaveformBuilder', function() { options: { mediaElement: document.getElementById('media'), dataUri: { - json: 'base/test_data/sample.json' + json: 'base/test/data/sample.json' } } }; @@ -149,7 +149,7 @@ describe('WaveformBuilder', function() { mediaElement: document.getElementById('media'), withCredentials: true, dataUri: { - json: 'base/test_data/sample.json' + json: 'base/test/data/sample.json' } } }; @@ -175,7 +175,7 @@ describe('WaveformBuilder', function() { options: { mediaElement: document.getElementById('media'), dataUri: { - arraybuffer: 'base/test_data/sample.dat' + arraybuffer: 'base/test/data/sample.dat' } } }; @@ -201,7 +201,7 @@ describe('WaveformBuilder', function() { options: { mediaElement: document.getElementById('media'), dataUri: { - arraybuffer: 'base/test_data/sample.dat' + arraybuffer: 'base/test/data/sample.dat' } } }; @@ -279,8 +279,8 @@ describe('WaveformBuilder', function() { options: { mediaElement: document.getElementById('media'), dataUri: { - arraybuffer: 'base/test_data/sample.dat', - json: 'base/test_data/sample.json' + arraybuffer: 'base/test/data/sample.dat', + json: 'base/test/data/sample.json' } } }; @@ -307,7 +307,7 @@ describe('WaveformBuilder', function() { options: { mediaElement: document.getElementById('media'), dataUri: { - arraybuffer: 'base/test_data/sample_16bit.dat' + arraybuffer: 'base/test/data/sample_16bit.dat' } } }; @@ -351,7 +351,7 @@ describe('WaveformBuilder', function() { options: { mediaElement: document.getElementById('media'), dataUri: { - json: 'base/test_data/sample.json' + json: 'base/test/data/sample.json' } } }; @@ -397,7 +397,7 @@ describe('WaveformBuilder', function() { options: { mediaElement: document.getElementById('media'), dataUri: { - json: 'base/test_data/sample.json' + json: 'base/test/data/sample.json' } } }; @@ -418,7 +418,7 @@ describe('WaveformBuilder', function() { options: { mediaElement: document.getElementById('media'), dataUri: { - json: 'base/test_data/sample.json' + json: 'base/test/data/sample.json' } } }; diff --git a/test/waveform-overview-spec.js b/test/waveform-overview-spec.js index 7db5fddd..028a8a7c 100644 --- a/test/waveform-overview-spec.js +++ b/test/waveform-overview-spec.js @@ -13,7 +13,7 @@ describe('WaveformOverview', function() { container: container }, mediaElement: document.getElementById('media'), - dataUri: { arraybuffer: '/base/test_data/sample.dat' } + dataUri: { arraybuffer: '/base/test/data/sample.dat' } }; Peaks.init(options, function(err, instance) { @@ -41,7 +41,7 @@ describe('WaveformOverview', function() { container: document.getElementById('overview-container') }, mediaElement: document.getElementById('media'), - dataUri: { arraybuffer: '/base/test_data/STAT3S3.dat' } + dataUri: { arraybuffer: '/base/test/data/STAT3S3.dat' } }; Peaks.init(options, function(err, instance) { @@ -69,7 +69,7 @@ describe('WaveformOverview', function() { container: document.getElementById('overview-container') }, mediaElement: document.getElementById('media'), - dataUri: { arraybuffer: '/base/test_data/sample.dat' } + dataUri: { arraybuffer: '/base/test/data/sample.dat' } }; Peaks.init(options, function(err, instance) { diff --git a/test/waveform-view-spec.js b/test/waveform-view-spec.js index 6dd631cf..6e29b95a 100644 --- a/test/waveform-view-spec.js +++ b/test/waveform-view-spec.js @@ -11,7 +11,7 @@ function initOptions(view, viewOptions) { const options = { mediaElement: document.getElementById('media'), dataUri: { - arraybuffer: 'base/test_data/sample.dat' + arraybuffer: 'base/test/data/sample.dat' } }; diff --git a/test/waveform-zoomview-spec.js b/test/waveform-zoomview-spec.js index 991baf66..c907503c 100644 --- a/test/waveform-zoomview-spec.js +++ b/test/waveform-zoomview-spec.js @@ -20,7 +20,7 @@ describe('WaveformZoomView', function() { }, mediaElement: document.getElementById('media'), dataUri: { - arraybuffer: 'base/test_data/sample.dat' + arraybuffer: 'base/test/data/sample.dat' } }; @@ -94,7 +94,7 @@ describe('WaveformZoomView', function() { }, mediaElement: document.getElementById('media'), dataUri: { - json: 'base/test_data/sample.json' + json: 'base/test/data/sample.json' }, segments: [ { id: 'segment1', startTime: 1.0, endTime: 2.0, editable: true }, @@ -321,7 +321,7 @@ describe('WaveformZoomView', function() { }, mediaElement: document.getElementById('media'), dataUri: { - json: 'base/test_data/sample.json' + json: 'base/test/data/sample.json' }, segmentOptions: { markers: test.markers, @@ -1019,7 +1019,7 @@ describe('WaveformZoomView', function() { }, mediaElement: document.getElementById('media'), dataUri: { - json: 'base/test_data/sample.json' + json: 'base/test/data/sample.json' }, points: [ { id: 'point1', time: 7.0, editable: true } @@ -1198,7 +1198,7 @@ describe('WaveformZoomView', function() { container: document.getElementById('zoomview-container') }, mediaElement: document.getElementById('media'), - dataUri: { arraybuffer: '/base/test_data/sample.dat' }, + dataUri: { arraybuffer: '/base/test/data/sample.dat' }, segments: [ { id: 'segment1', startTime: 1.0, endTime: 2.0, editable: true }, { id: 'segment2', startTime: 3.0, endTime: 4.0, editable: false } @@ -1353,7 +1353,7 @@ describe('WaveformZoomView', function() { }, mediaElement: document.getElementById('media'), dataUri: { - json: 'base/test_data/sample.json' + json: 'base/test/data/sample.json' }, points: [ { id: 'point1', time: 7.0, editable: true }