From f0926e78211eecd4bf287cbdc91c7f3d100abe0c Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Thu, 4 Aug 2022 10:11:11 -0700 Subject: [PATCH] Remove tests that rely on node We can test this primarily with api tests instead --- .../xterm-addon-ligatures/src/index.test.ts | 70 ------------------- 1 file changed, 70 deletions(-) diff --git a/addons/xterm-addon-ligatures/src/index.test.ts b/addons/xterm-addon-ligatures/src/index.test.ts index 0cfe2462..c7bf09ce 100644 --- a/addons/xterm-addon-ligatures/src/index.test.ts +++ b/addons/xterm-addon-ligatures/src/index.test.ts @@ -69,76 +69,6 @@ describe('xterm-addon-ligatures', () => { assert.deepEqual(term.joiner!(input), []); }); - it('returns the correct set of ranges once the font has loaded', done => { - assert.deepEqual(term.joiner!(input), []); - onRefresh.callsFake(() => { - assert.deepEqual(term.joiner!(input), [[2, 4], [7, 10]]); - done(); - }); - }); - - it('handles quoted font names', done => { - term.options.fontFamily = '"Fira Code", monospace'; - assert.deepEqual(term.joiner!(input), []); - onRefresh.callsFake(() => { - assert.deepEqual(term.joiner!(input), [[2, 4], [7, 10]]); - done(); - }); - }); - - it('falls back to later fonts if earlier ones are not present', done => { - term.options.fontFamily = 'notinstalled, Fira Code, monospace'; - assert.deepEqual(term.joiner!(input), []); - onRefresh.callsFake(() => { - assert.deepEqual(term.joiner!(input), [[2, 4], [7, 10]]); - done(); - }); - }); - - it('uses the current font value', done => { - // The first three calls are all synchronous so that we don't allow time for - // any fonts to load while we're switching things around - term.options.fontFamily = 'Fira Code'; - assert.deepEqual(term.joiner!(input), []); - term.options.fontFamily = 'notinstalled'; - assert.deepEqual(term.joiner!(input), []); - term.options.fontFamily = 'Iosevka'; - assert.deepEqual(term.joiner!(input), []); - onRefresh.callsFake(() => { - assert.deepEqual(term.joiner!(input), [[2, 4]]); - - // And switch it back to Fira Code for good measure - term.options.fontFamily = 'Fira Code'; - - // At this point, we haven't loaded the new font, so the result reverts - // back to empty until that happens - assert.deepEqual(term.joiner!(input), []); - - onRefresh.callsFake(() => { - assert.deepEqual(term.joiner!(input), [[2, 4], [7, 10]]); - done(); - }); - }); - }); - - it('allows multiple terminal instances that use different fonts', done => { - const onRefresh2 = sinon.stub(); - const term2 = new MockTerminal(onRefresh2); - term2.options.fontFamily = 'Iosevka'; - ligatureSupport.enableLigatures(term2 as any); - - assert.deepEqual(term.joiner!(input), []); - onRefresh.callsFake(() => { - assert.deepEqual(term.joiner!(input), [[2, 4], [7, 10]]); - assert.deepEqual(term2.joiner!(input), []); - onRefresh2.callsFake(() => { - assert.deepEqual(term2.joiner!(input), [[2, 4]]); - assert.deepEqual(term.joiner!(input), [[2, 4], [7, 10]]); - done(); - }); - }); - }); - it('fails if it finds but cannot load the font', async () => { term.options.fontFamily = 'Nonexistant Font, monospace'; assert.deepEqual(term.joiner!(input), []);