forked from katspaugh/wavesurfer.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add param error tests * add test-helpers module * update dev dependencies * more plugin tests
- Loading branch information
1 parent
5452cc3
commit dcdf3aa
Showing
6 changed files
with
173 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import WaveSurfer from '../src/wavesurfer.js'; | ||
|
||
const TestHelpers = { | ||
/** Example audio clip */ | ||
EXAMPLE_FILE_PATH: '/base/spec/support/demo.wav', | ||
|
||
/** Length of example audio clip */ | ||
EXAMPLE_FILE_DURATION: 21, | ||
|
||
createElement(id, type) { | ||
if (id == undefined) { | ||
id = 'waveform'; | ||
} | ||
if (type == undefined) { | ||
type = 'div'; | ||
} | ||
var element = document.createElement(type); | ||
element.id = id; | ||
document.getElementsByTagName('body')[0].appendChild(element); | ||
|
||
return element; | ||
}, | ||
|
||
removeElement(element) { | ||
document.getElementsByTagName('body')[0].removeChild(element); | ||
}, | ||
|
||
/** | ||
* Handle creating wavesurfer ui requirements | ||
* | ||
* @param {Object} options | ||
*/ | ||
createWaveform(options) { | ||
this.createElement('waveform'); | ||
|
||
options = options || { | ||
container: '#waveform', | ||
waveColor: '#90F09B', | ||
progressColor: 'purple', | ||
cursorColor: 'white' | ||
}; | ||
return WaveSurfer.create(options); | ||
} | ||
}; | ||
|
||
export default TestHelpers; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters