Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it("works", () => {
let midiDevice = new NodeMIDIDevice("DX7IIFD");
assert.doesNotThrow(() => {
midiDevice.send([ 0xb0, 0x16, 0x01 ]);
});
});
});
it('should be ok with known options', function() {
const options = { standalone: true, elementId:'your id' }
assert.doesNotThrow(x => { this.oF.toHtml(options) })
})
it('should not throw if something is defined', () => {
assert.doesNotThrow(() => {
assert.doesNotThrow(() => {
requireSources('Something', {a: 1}, 'a')
})
})
})
it("defines a callback property", () => {
const isNumber = { typeName: "number", test: value => typeof value === "number" };
class Foo {
constructor() {
this._ = {};
}
@props.typed(isNumber, 0)
bar() {}
}
const foo = new Foo();
assert(foo.bar === 0);
assert.doesNotThrow(() => { foo.bar = 10; });
assert(foo.bar === 10);
assert.throws(() => { foo.bar = "not a number"; }, TypeError);
});
});
it("defines an enum property", () => {
class Foo {
constructor() {
this._ = {};
}
@props.enums([ "a", "b", "c" ])
bar() {}
}
const foo = new Foo();
assert(foo.bar === "a");
assert.doesNotThrow(() => { foo.bar = "c"; });
assert(foo.bar === "c");
assert.throws(() => { foo.bar = "d"; }, TypeError); });
});
it("works", () => {
let emitter = new MMLEmitter("", { timerAPI: tickable });
assert.doesNotThrow(() => {
emitter.start();
});
});
});
it("works", () => {
let midiDevice = new WebMIDIDevice("DX7IIFD");
assert.doesNotThrow(() => {
midiDevice.send([ 0xb0, 0x16, 0x01 ]);
});
});
});
it('should be ok with existing labalName ', function() {
const docStr = new DocumentStructure(this.document)
assert.doesNotThrow(x => { docStr.getElementNameByLabel('ラベル名') })
})
function method(target, name) {
const methodName = name;
assert(typeof target._impl[methodName] === "function", `_impl.${ methodName }() not exists`);
const spy = target._impl[methodName] = sinon.spy();
const args = new Array(target[name].length).fill(0);
assert.doesNotThrow(() => {
return target[name].apply(target, args);
}, `_impl.${ methodName }() throws`);
assert(spy.callCount === 1, `_impl.${ methodName }() not called`);
assert(spy.args[0].length === args.length, `_impl.${ methodName }() not provided arguments`);
}
function getter(target, name) {
const methodName = toGetMethodName(name);
assert(typeof target._impl[methodName] === "function", `_impl.${ methodName }() not exists`);
const spy = target._impl[methodName] = sinon.spy(() => 0);
let retVal;
assert.doesNotThrow(() => {
retVal = target[name];
}, `_impl.${ methodName }() throws`);
assert(spy.callCount === 1, `_impl.${ methodName }() not called`);
assert(retVal === 0, `_impl.${ methodName }() returned no value`);
}