Add first headless test

This commit is contained in:
Daniel Imms
2021-07-22 16:23:04 -07:00
parent 40992a7f76
commit a6e6c07a3c
2 changed files with 28 additions and 1 deletions
+27
View File
@@ -0,0 +1,27 @@
/**
* Copyright (c) 2016 The xterm.js authors. All rights reserved.
* @license MIT
*/
import { deepStrictEqual, throws } from 'assert';
import { Terminal } from 'headless/public/Terminal';
const INIT_COLS = 80;
const INIT_ROWS = 24;
describe('Headless Terminal', () => {
let term: Terminal;
const termOptions = {
cols: INIT_COLS,
rows: INIT_ROWS
};
beforeEach(() => {
term = new Terminal(termOptions);
});
it('should throw when trying to change cols or rows', () => {
throws(() => term.setOption('cols', 1000));
throws(() => term.setOption('rows', 1000));
});
});