How to use the power-assert.doesNotThrow function in power-assert

To help you get started, we’ve selected a few power-assert examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mohayonao / midi-device / test / NodeMIDIDevice.js View on Github external
it("works", () => {
      let midiDevice = new NodeMIDIDevice("DX7IIFD");

      assert.doesNotThrow(() => {
        midiDevice.send([ 0xb0, 0x16, 0x01 ]);
      });
    });
  });
github CureApp / ordinance-format-jp / test / spec / bin / oridinaneFormatJp.js View on Github external
it('should be ok with known options', function() {
      const options = { standalone: true, elementId:'your id' }
      assert.doesNotThrow(x => { this.oF.toHtml(options) })
    })
github cyclejs-community / xstream-boilerplate / test / util / index.js View on Github external
it('should not throw if something is defined', () => {
      assert.doesNotThrow(() => {
        assert.doesNotThrow(() => {
          requireSources('Something', {a: 1}, 'a')
        })
      })
    })
github mohayonao / web-audio-test-api / test / decorators / props / typed.js View on Github external
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);
  });
});
github mohayonao / web-audio-test-api / test / decorators / props / enums.js View on Github external
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); });
});
github mohayonao / mml-emitter / test / MMLEmitter.js View on Github external
it("works", () => {
      let emitter = new MMLEmitter("", { timerAPI: tickable });

      assert.doesNotThrow(() => {
        emitter.start();
      });
    });
  });
github mohayonao / midi-device / test / WebMIDIDevice.js View on Github external
it("works", () => {
      let midiDevice = new WebMIDIDevice("DX7IIFD");

      assert.doesNotThrow(() => {
        midiDevice.send([ 0xb0, 0x16, 0x01 ]);
      });
    });
  });
github CureApp / ordinance-format-jp / test / spec / bin / document-structure.js View on Github external
it('should be ok with existing labalName ', function() {
      const docStr = new DocumentStructure(this.document)
      assert.doesNotThrow(x => { docStr.getElementNameByLabel('ラベル名') })
    })
github mohayonao / web-audio-engine / test / helpers / apiTester.js View on Github external
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`);
}
github mohayonao / web-audio-engine / test / helpers / apiTester.js View on Github external
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`);
}