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:
+14
-4
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user