-
-
Notifications
You must be signed in to change notification settings - Fork 682
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(chore) : Changed test filing structure
Signed-off-by: Abhijay Jain <[email protected]>
- Loading branch information
1 parent
de83cd8
commit 49a6f89
Showing
33 changed files
with
96 additions
and
132 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,53 @@ | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>TESTS</title> | ||
<script src="../lib/p5.js"></script> | ||
<script src="../lib/p5.sound.js"></script> | ||
<link rel="stylesheet" href="../node_modules/mocha/mocha.css" /> | ||
<script src="../node_modules/mocha/mocha.js"></script> | ||
<script src="../node_modules/chai/chai.js"></script> | ||
<script src="../node_modules/sinon/pkg/sinon.js"></script> | ||
</head> | ||
<body> | ||
<div id="mocha"></div> | ||
<script src="./setup.js" type="module"></script> | ||
</body> | ||
</html> | ||
|
||
<head> | ||
<meta charset="utf-8" /> | ||
<title>TESTS</title> | ||
<link rel="stylesheet" href="../node_modules/mocha/mocha.css" /> | ||
<script src="../lib/p5.js"></script> | ||
<script src="../lib/p5.sound.js"></script> | ||
</head> | ||
|
||
<body> | ||
<div id="mocha"></div> | ||
<script src="../node_modules/mocha/mocha.js" type="text/javascript" charset="utf-8"></script> | ||
<script src="../node_modules/chai/chai.js"></script> | ||
<script src="../node_modules/sinon/pkg/sinon.js"></script> | ||
<script src="./setup.js"></script> | ||
|
||
<script src="./tests.js" type="text/javascript"></script> | ||
|
||
<script type="text/javascript"> | ||
const startTest = () => { | ||
let test_has_run = false; | ||
document.getElementById('mocha').innerHTML = 'click to begin tests'; | ||
|
||
// chromes autoplay policy requires a user interaction | ||
// before the audiocontext can activate | ||
const mousePressed = () => { | ||
if (!test_has_run) { | ||
document.getElementById('mocha').innerHTML = ''; | ||
p5._throwValidationErrors = true; | ||
p5.prototype.outputVolume(0); | ||
p5.prototype.userStartAudio(); | ||
mocha.run(); | ||
test_has_run = true; | ||
} | ||
}; | ||
document.addEventListener('click', mousePressed, false); | ||
}; | ||
|
||
//operating p5 in instance mode ( read more about it here - https://github.com/processing/p5.js/wiki/Global-and-instance-mode ) | ||
const s = (sketch) => { | ||
sketch.setup = () => { | ||
mocha.reporter('html'); | ||
mocha.setup('bdd'); | ||
const expect = chai.expect; | ||
startTest(); | ||
}; | ||
}; | ||
|
||
new p5(s); | ||
</script> | ||
</body> | ||
</html> |
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 |
---|---|---|
@@ -1,31 +1,8 @@ | ||
const startTest = () => { | ||
//dynamic importing the modules , this ensures that tests must run after audioWorklet processors have been loaded properly | ||
import('./tests.js'); | ||
mocha.setup('bdd'); | ||
|
||
let test_has_run = false; | ||
new p5(); | ||
p5._throwValidationErrors = true; | ||
p5.prototype.outputVolume(0); | ||
p5.prototype.userStartAudio(); | ||
|
||
document.getElementById('mocha').innerHTML = 'click to begin tests'; | ||
|
||
// chromes autoplay policy requires a user interaction | ||
// before the audiocontext can activate | ||
const mousePressed = () => { | ||
if (!test_has_run) { | ||
document.getElementById('mocha').innerHTML = ''; | ||
p5.prototype.outputVolume(0); | ||
p5.prototype.userStartAudio(); | ||
mocha.run(); | ||
test_has_run = true; | ||
} | ||
}; | ||
document.addEventListener('click', mousePressed, false); | ||
}; | ||
|
||
//operating p5 in instance mode ( read more about it here - https://github.com/processing/p5.js/wiki/Global-and-instance-mode ) | ||
const s = (sketch) => { | ||
sketch.setup = () => { | ||
mocha.setup('bdd'); | ||
startTest(); | ||
}; | ||
}; | ||
|
||
new p5(s); | ||
const expect = chai.expect; |
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 |
---|---|---|
@@ -1,31 +1,38 @@ | ||
import('./tests/main.js'); | ||
import('./tests/p5.Helpers.js'); | ||
import('./tests/p5.PeakDetect.js'); | ||
import('./tests/p5.OnsetDetect.js'); | ||
import('./tests/p5.Distortion.js'); | ||
import('./tests/p5.AudioContext.js'); | ||
import('./tests/p5.Looper.js'); | ||
import('./tests/p5.Metro.js'); | ||
import('./tests/p5.Effect.js'); | ||
import('./tests/p5.Filter.js'); | ||
import('./tests/p5.Gain.js'); | ||
import('./tests/p5.FFT.js'); | ||
import('./tests/p5.SoundLoop.js'); | ||
import('./tests/p5.Compressor.js'); | ||
import('./tests/p5.EQ.js'); | ||
import('./tests/p5.AudioIn.js'); | ||
import('./tests/p5.AudioVoice.js'); | ||
import('./tests/p5.MonoSynth.js'); | ||
import('./tests/p5.PolySynth.js'); | ||
import('./tests/p5.SoundRecorder.js'); | ||
import('./tests/p5.SoundFile.js'); | ||
import('./tests/p5.Amplitude.js'); | ||
import('./tests/p5.Oscillator.js'); | ||
import('./tests/p5.Envelope.js'); | ||
import('./tests/p5.Pulse.js'); | ||
import('./tests/p5.Noise.js'); | ||
import('./tests/p5.Panner.js'); | ||
import('./tests/p5.Panner3d.js'); | ||
import('./tests/p5.Delay.js'); | ||
import('./tests/p5.Reverb.js'); | ||
import('./tests/p5.Listener3d.js'); | ||
let spec = [ | ||
'./tests/main.js', | ||
'./tests/p5.Helpers.js', | ||
'./tests/p5.PeakDetect.js', | ||
'./tests/p5.OnsetDetect.js', | ||
'./tests/p5.Distortion.js', | ||
'./tests/p5.AudioContext.js', | ||
'./tests/p5.Looper.js', | ||
'./tests/p5.Metro.js', | ||
'./tests/p5.Effect.js', | ||
'./tests/p5.Filter.js', | ||
'./tests/p5.Gain.js', | ||
'./tests/p5.FFT.js', | ||
'./tests/p5.SoundLoop.js', | ||
'./tests/p5.Compressor.js', | ||
'./tests/p5.EQ.js', | ||
'./tests/p5.AudioIn.js', | ||
'./tests/p5.AudioVoice.js', | ||
'./tests/p5.MonoSynth.js', | ||
'./tests/p5.PolySynth.js', | ||
'./tests/p5.SoundRecorder.js', | ||
'./tests/p5.SoundFile.js', | ||
'./tests/p5.Amplitude.js', | ||
'./tests/p5.Oscillator.js', | ||
'./tests/p5.Envelope.js', | ||
'./tests/p5.Pulse.js', | ||
'./tests/p5.Noise.js', | ||
'./tests/p5.Panner.js', | ||
'./tests/p5.Panner3d.js', | ||
'./tests/p5.Delay.js', | ||
'./tests/p5.Reverb.js', | ||
'./tests/p5.Listener3d.js', | ||
]; | ||
|
||
spec.map((file) => { | ||
var string = ['<script src="./', file, '" type="text/javascript" ></script>']; | ||
document.write(string.join('')); | ||
}); |
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
const expect = chai.expect; | ||
|
||
describe('p5.Amplitude', function () { | ||
this.timeout(1000); | ||
|
||
|
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
const expect = chai.expect; | ||
|
||
describe('p5.AudioIn', function () { | ||
let mic; | ||
beforeEach(function () { | ||
|
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
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
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
const expect = chai.expect; | ||
let gain; | ||
|
||
describe('p5.Gain', function () { | ||
|
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
const expect = chai.expect; | ||
let metro; | ||
|
||
describe('p5.Metro', function () { | ||
|
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
const expect = chai.expect; | ||
|
||
describe('p5.Oscillator', function () { | ||
this.timeout(1000); | ||
|
||
|
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
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
const expect = chai.expect; | ||
|
||
describe('p5.SoundRecorder', function () { | ||
let inputSoundFile; | ||
let writeFileSub; | ||
|