Log error instead of throwing. Move test to service.

This commit is contained in:
IllusionMH
2020-09-01 22:20:37 +03:00
parent 8d9eda5d0a
commit e73bf11849
3 changed files with 28 additions and 8 deletions
@@ -0,0 +1,22 @@
/**
* Copyright (c) 2020 The xterm.js authors. All rights reserved.
* @license MIT
*/
import { assert } from 'chai';
import { OptionsService, DEFAULT_OPTIONS } from 'common/services/OptionsService';
describe('OptionsService', () => {
describe('constructor', () => {
const originalError = console.error;
beforeEach(() => {
console.error = () => {};
});
afterEach(() => {
console.error = originalError;
});
it('uses default value if invalid constructor option value passed', () => {
assert.equal(new OptionsService({tabStopWidth: 0}).getOption('tabStopWidth'), DEFAULT_OPTIONS.tabStopWidth);
});
});
});