Tone.js/test/instrument/Instrument.js

29 lines
561 B
JavaScript
Raw Normal View History

import Instrument from "Tone/instrument/Instrument";
import Basic from "helper/Basic";
2015-08-31 15:37:10 +00:00
describe("Instrument", function(){
2015-08-31 15:37:10 +00:00
Basic(Instrument);
2015-08-31 15:37:10 +00:00
context("API", function(){
2015-08-31 15:37:10 +00:00
it("can be constructed with an options object", function(){
var instr = new Instrument({
"volume" : -12
2015-08-31 15:37:10 +00:00
});
expect(instr.volume.value).to.be.closeTo(-12, 0.1);
instr.dispose();
});
2015-08-31 15:37:10 +00:00
it("can get/set attributes", function(){
var instr = new Instrument();
instr.set({
"volume" : 2
2015-08-31 15:37:10 +00:00
});
expect(instr.get().volume).to.be.closeTo(2, 0.1);
2015-08-31 15:37:10 +00:00
});
2015-08-31 15:37:10 +00:00
});
2017-12-30 16:26:29 +00:00
});