Ejemplo n.º 1
0
    it('does not call callback and returns false if err provided', () => {
      const cb = sinon.stub();
      const actual = notate(cb, null);

      expect(actual).to.equal(false);
      expect(cb).to.have.property('callCount', 0);
    });
Ejemplo n.º 2
0
    it('calls callback and returns true if err provided', () => {
      const cb = sinon.stub();
      const actual = notate(cb, new Error());

      expect(actual).to.equal(true);
      expect(cb).to.have.property('callCount', 1);
    });
Ejemplo n.º 3
0
 expect(() => {
   notate(cb, null);
 }).to.throw(Error)