-
-
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.
fetching latest p5.js code from npm (#501)
* fetching latest p5.js code from npm
- Loading branch information
1 parent
d32113c
commit d30c43d
Showing
7 changed files
with
41 additions
and
38 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,37 +1,34 @@ | ||
'use strict' | ||
'use strict'; | ||
|
||
define(['chai'], function(chai){ | ||
const expect = chai.expect; | ||
describe('P5.master',function(){ | ||
define(['chai'], function (chai) { | ||
const expect = chai.expect; | ||
describe('P5.master', function () { | ||
it('can set and return master volume', function (done) { | ||
p5.prototype.masterVolume(0.6); | ||
|
||
it('can set and return master volume',function(done){ | ||
p5.prototype.masterVolume(.6); | ||
setTimeout(function () { | ||
expect(p5.prototype.getMasterVolume()).to.be.closeTo(0.6, 0.05); | ||
done(); | ||
}, 100); | ||
}); | ||
it('can set master volume after t seconds in future', function (done) { | ||
let t = 1; | ||
p5.prototype.masterVolume(0.9, 0, t); | ||
|
||
setTimeout(function() { | ||
expect(p5.prototype.getMasterVolume()).to.be.closeTo(0.6,0.05); | ||
done(); | ||
}, 100); | ||
}); | ||
it('can set master volume after t seconds in future',function(done){ | ||
let t = 1; | ||
p5.prototype.masterVolume(0.9,0,t ); | ||
|
||
setTimeout(function() { | ||
expect(p5.prototype.getMasterVolume()).to.be.closeTo(0.9,0.05); | ||
done(); | ||
}, 1100); | ||
}); | ||
setTimeout(function () { | ||
expect(p5.prototype.getMasterVolume()).to.be.closeTo(0.9, 0.05); | ||
done(); | ||
}, 1100); | ||
}); | ||
|
||
it('can create a linear fade effect in master volume ',function(done){ | ||
it('can create a linear fade effect in master volume ', function (done) { | ||
let t = 1; | ||
p5.prototype.masterVolume(1, t, 0); | ||
|
||
let t = 1; | ||
p5.prototype.masterVolume(1,t,0 ); | ||
|
||
setTimeout(function() { | ||
expect(p5.prototype.getMasterVolume()).to.be.closeTo(.50, 0.5); | ||
done(); | ||
}, 500); | ||
|
||
}); | ||
setTimeout(function () { | ||
expect(p5.prototype.getMasterVolume()).to.be.closeTo(0.5, 0.5); | ||
done(); | ||
}, 500); | ||
}); | ||
}); | ||
}); | ||
}); |