const streamView = new StreamView(options); StreamView.prototype.log.restore(); sandbox.stub(streamView.node, "log"); streamView.log("something\nmultiline\n"); expect(streamView.node.log).to.have.been.calledOnce .and.calledWithExactly("something\nmultiline"); }); StreamView.prototype.log.restore(); sandbox.stub(streamView.node, "log"); streamView.log("THIS should be included\nbut not THIS one\nor that one\n"); expect(streamView.node.log).to.have.been.calledOnce .and.calledWithExactly("THIS should be included"); streamView.log("THIS should be included\nbut not THIS one\nor that one\n"); expect(streamView.node.log).to.have.been.calledOnce .and.calledWithExactly(" should be included"); }); StreamView.prototype.log.restore(); streamView.log("THIS should be included\nbut not THIS one\nor that one\n"); expect(streamView.node.log).to.have.been.calledOnce .and.calledWithExactly("but not THIS one\nor that one"); });
addLog(log) { this._uiLogBox.log(log); return this; }
var log = function (str) { slackTUI.view.contentBox.log(str); }