mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Move unit tests onto esbuild sources
This commit is contained in:
@@ -7,7 +7,6 @@ import * as path from 'path';
|
||||
import * as sinon from 'sinon';
|
||||
import { assert } from 'chai';
|
||||
import * as fontFinder from 'font-finder';
|
||||
import * as fontLigatures from 'font-ligatures';
|
||||
|
||||
import * as ligatureSupport from '.';
|
||||
|
||||
@@ -106,15 +105,6 @@ describe('LigaturesAddon', () => {
|
||||
await delay(500);
|
||||
assert.isTrue(onRefresh.notCalled);
|
||||
});
|
||||
|
||||
it('ensures no empty errors are thrown', async () => {
|
||||
sinon.stub(fontLigatures, 'loadFile').callsFake(async () => { throw undefined; });
|
||||
term.options.fontFamily = 'Iosevka';
|
||||
assert.deepEqual(term.joiner!(input), []);
|
||||
await delay(500);
|
||||
assert.isTrue(onRefresh.notCalled);
|
||||
(fontLigatures.loadFile as sinon.SinonStub).restore();
|
||||
});
|
||||
});
|
||||
|
||||
class MockTerminal {
|
||||
|
||||
+3
-3
@@ -10,11 +10,11 @@ const COVERAGE_LINES_THRESHOLD = 40;
|
||||
|
||||
// Add `out` to the NODE_PATH so absolute paths can be resolved.
|
||||
const env = { ...process.env };
|
||||
env.NODE_PATH = path.resolve(__dirname, '../out');
|
||||
env.NODE_PATH = path.resolve(__dirname, '../out-esbuild');
|
||||
|
||||
let testFiles = [
|
||||
'./out/**/*test.js',
|
||||
'./addons/**/out/*test.js',
|
||||
'./out-esbuild/**/*test.js',
|
||||
'./addons/**/out-esbuild/*test.js',
|
||||
];
|
||||
|
||||
let flagArgs = [];
|
||||
|
||||
@@ -10,6 +10,7 @@ import { CellData } from 'common/buffer/CellData';
|
||||
import { MockUnicodeService } from 'common/TestUtils.test';
|
||||
import { IMarker, ScrollSource } from 'common/Types';
|
||||
import { ICoreService } from 'common/services/Services';
|
||||
import type { IBrowser } from 'browser/Types';
|
||||
|
||||
const INIT_COLS = 80;
|
||||
const INIT_ROWS = 24;
|
||||
@@ -571,12 +572,9 @@ describe('Terminal', () => {
|
||||
});
|
||||
|
||||
describe('with macOptionIsMeta', () => {
|
||||
let originalIsMac: boolean;
|
||||
beforeEach(() => {
|
||||
originalIsMac = term.browser.isMac;
|
||||
term.options.macOptionIsMeta = true;
|
||||
});
|
||||
afterEach(() => term.browser.isMac = originalIsMac);
|
||||
|
||||
it('should interfere with the alt key on keyDown', () => {
|
||||
evKeyDown.altKey = true;
|
||||
@@ -589,12 +587,12 @@ describe('Terminal', () => {
|
||||
});
|
||||
|
||||
describe('On Mac OS', () => {
|
||||
let originalIsMac: boolean;
|
||||
let originalBrowser: IBrowser;
|
||||
beforeEach(() => {
|
||||
originalIsMac = term.browser.isMac;
|
||||
term.browser.isMac = true;
|
||||
originalBrowser = term.browser;
|
||||
term.browser = { ...originalBrowser, isMac: true };
|
||||
});
|
||||
afterEach(() => term.browser.isMac = originalIsMac);
|
||||
afterEach(() => term.browser = originalBrowser);
|
||||
|
||||
it('should not interfere with the alt key on keyDown', () => {
|
||||
evKeyDown.altKey = true;
|
||||
@@ -656,12 +654,12 @@ describe('Terminal', () => {
|
||||
});
|
||||
|
||||
describe('On MS Windows', () => {
|
||||
let originalIsWindows: boolean;
|
||||
let originalBrowser: IBrowser;
|
||||
beforeEach(() => {
|
||||
originalIsWindows = term.browser.isWindows;
|
||||
term.browser.isWindows = true;
|
||||
originalBrowser = term.browser;
|
||||
term.browser = { ...originalBrowser, isWindows: true };
|
||||
});
|
||||
afterEach(() => term.browser.isWindows = originalIsWindows);
|
||||
afterEach(() => term.browser = originalBrowser);
|
||||
|
||||
it('should not interfere with the alt + ctrl key on keyDown', () => {
|
||||
evKeyPress.altKey = true;
|
||||
|
||||
Reference in New Issue
Block a user