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 * as sinon from 'sinon';
|
||||||
import { assert } from 'chai';
|
import { assert } from 'chai';
|
||||||
import * as fontFinder from 'font-finder';
|
import * as fontFinder from 'font-finder';
|
||||||
import * as fontLigatures from 'font-ligatures';
|
|
||||||
|
|
||||||
import * as ligatureSupport from '.';
|
import * as ligatureSupport from '.';
|
||||||
|
|
||||||
@@ -106,15 +105,6 @@ describe('LigaturesAddon', () => {
|
|||||||
await delay(500);
|
await delay(500);
|
||||||
assert.isTrue(onRefresh.notCalled);
|
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 {
|
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.
|
// Add `out` to the NODE_PATH so absolute paths can be resolved.
|
||||||
const env = { ...process.env };
|
const env = { ...process.env };
|
||||||
env.NODE_PATH = path.resolve(__dirname, '../out');
|
env.NODE_PATH = path.resolve(__dirname, '../out-esbuild');
|
||||||
|
|
||||||
let testFiles = [
|
let testFiles = [
|
||||||
'./out/**/*test.js',
|
'./out-esbuild/**/*test.js',
|
||||||
'./addons/**/out/*test.js',
|
'./addons/**/out-esbuild/*test.js',
|
||||||
];
|
];
|
||||||
|
|
||||||
let flagArgs = [];
|
let flagArgs = [];
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import { CellData } from 'common/buffer/CellData';
|
|||||||
import { MockUnicodeService } from 'common/TestUtils.test';
|
import { MockUnicodeService } from 'common/TestUtils.test';
|
||||||
import { IMarker, ScrollSource } from 'common/Types';
|
import { IMarker, ScrollSource } from 'common/Types';
|
||||||
import { ICoreService } from 'common/services/Services';
|
import { ICoreService } from 'common/services/Services';
|
||||||
|
import type { IBrowser } from 'browser/Types';
|
||||||
|
|
||||||
const INIT_COLS = 80;
|
const INIT_COLS = 80;
|
||||||
const INIT_ROWS = 24;
|
const INIT_ROWS = 24;
|
||||||
@@ -571,12 +572,9 @@ describe('Terminal', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('with macOptionIsMeta', () => {
|
describe('with macOptionIsMeta', () => {
|
||||||
let originalIsMac: boolean;
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
originalIsMac = term.browser.isMac;
|
|
||||||
term.options.macOptionIsMeta = true;
|
term.options.macOptionIsMeta = true;
|
||||||
});
|
});
|
||||||
afterEach(() => term.browser.isMac = originalIsMac);
|
|
||||||
|
|
||||||
it('should interfere with the alt key on keyDown', () => {
|
it('should interfere with the alt key on keyDown', () => {
|
||||||
evKeyDown.altKey = true;
|
evKeyDown.altKey = true;
|
||||||
@@ -589,12 +587,12 @@ describe('Terminal', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('On Mac OS', () => {
|
describe('On Mac OS', () => {
|
||||||
let originalIsMac: boolean;
|
let originalBrowser: IBrowser;
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
originalIsMac = term.browser.isMac;
|
originalBrowser = term.browser;
|
||||||
term.browser.isMac = true;
|
term.browser = { ...originalBrowser, isMac: true };
|
||||||
});
|
});
|
||||||
afterEach(() => term.browser.isMac = originalIsMac);
|
afterEach(() => term.browser = originalBrowser);
|
||||||
|
|
||||||
it('should not interfere with the alt key on keyDown', () => {
|
it('should not interfere with the alt key on keyDown', () => {
|
||||||
evKeyDown.altKey = true;
|
evKeyDown.altKey = true;
|
||||||
@@ -656,12 +654,12 @@ describe('Terminal', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('On MS Windows', () => {
|
describe('On MS Windows', () => {
|
||||||
let originalIsWindows: boolean;
|
let originalBrowser: IBrowser;
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
originalIsWindows = term.browser.isWindows;
|
originalBrowser = term.browser;
|
||||||
term.browser.isWindows = true;
|
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', () => {
|
it('should not interfere with the alt + ctrl key on keyDown', () => {
|
||||||
evKeyPress.altKey = true;
|
evKeyPress.altKey = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user