I know that there are many other similar questions, but the answers do not provide an opportunity to get around this problem.
I have a JavaScript file that is used on my website that uses HTML 5 Web Audio and wants to unit test it.
I looked at using QUnit with PhantomJS and before you say anything I know Phantom does not support it ( http://phantomjs.org/supported-web-standards.html ), however I want to know if way to get around this?
Testing with QUnit in the browser works as you expected, but I do not want to test it with the browser every time, I want it to be automated on the server.
An example of one of the failed tests:
QUnit.test("isPlaying", function(assert){ // true case My.Sound.play("background"); assert.ok(My.Sound.isPlaying("background"), "The background audio is playing"); // false case My.Sound.pause("background"); assert.ok(!My.Sound.isPlaying("background"), "The background audio is not playing"); });
javascript unit-testing qunit phantomjs headless
Tom
source share