Tone.js/test/instrument/Instrument.js

28 lines
582 B
JavaScript
Raw Normal View History

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