mirror of
https://github.com/Tonejs/Tone.js
synced 2024-12-29 04:53:10 +00:00
51 lines
No EOL
1.1 KiB
JavaScript
51 lines
No EOL
1.1 KiB
JavaScript
define(["helper/Offline", "helper/Basic", "Tone/signal/NOT", "Tone/signal/Signal"],
|
|
function (Offline, Basic, NOT, Signal) {
|
|
|
|
describe("NOT", function(){
|
|
|
|
Basic(NOT);
|
|
|
|
describe("Logic", function(){
|
|
|
|
it("outputs 0 when the input is 1", function(done){
|
|
var signal, not;
|
|
var offline = new Offline();
|
|
offline.before(function(dest){
|
|
signal = new Signal(1);
|
|
not = new NOT();
|
|
signal.connect(not);
|
|
not.connect(dest);
|
|
});
|
|
offline.test(function(sample){
|
|
expect(sample).to.equal(0);
|
|
});
|
|
offline.after(function(){
|
|
signal.dispose();
|
|
not.dispose();
|
|
done();
|
|
});
|
|
offline.run();
|
|
});
|
|
|
|
it("outputs 1 when the input is 0", function(done){
|
|
var signal, not;
|
|
var offline = new Offline();
|
|
offline.before(function(dest){
|
|
signal = new Signal(0);
|
|
not = new NOT();
|
|
signal.connect(not);
|
|
not.connect(dest);
|
|
});
|
|
offline.test(function(sample){
|
|
expect(sample).to.equal(1);
|
|
});
|
|
offline.after(function(){
|
|
signal.dispose();
|
|
not.dispose();
|
|
done();
|
|
});
|
|
offline.run();
|
|
});
|
|
});
|
|
});
|
|
}); |