Merge branch '842_resize_buffers_bug' into 335_xterm_to_ts

setOption('scrollback', 0) no longer returns false, it just warns.
This commit is contained in:
Daniel Imms
2017-08-05 20:48:42 -07:00
12 changed files with 2739 additions and 125 deletions
+14 -4
View File
@@ -44,6 +44,16 @@ describe('xterm.js', function() {
});
describe('setOption', function() {
let originalWarn;
let warnCallCount;
beforeEach(() => {
originalWarn = console.warn;
warnCallCount = 0;
console.warn = () => warnCallCount++;
});
afterEach(() => {
console.warn = originalWarn;
});
it('should set the option correctly', function() {
xterm.setOption('cursorBlink', true);
assert.equal(xterm.cursorBlink, true);
@@ -55,10 +65,10 @@ describe('xterm.js', function() {
it('should throw when setting a non-existant option', function() {
assert.throws(xterm.setOption.bind(xterm, 'fake', true));
});
it('should not allow scrollback less than number of rows', function() {
let setOptionCall = xterm.setOption.bind(xterm, 'scrollback', xterm.rows - 1);
assert.equal(setOptionCall(), false);
it('should warn and do nothing when scrollback is less than number of rows', function() {
xterm.setOption('scrollback', xterm.rows - 1);
assert.equal(xterm.getOption('scrollback'), 1000);
assert.equal(warnCallCount, 1);
});
});