diff --git a/package.json b/package.json index f9dc7ef3..71b80599 100644 --- a/package.json +++ b/package.json @@ -92,7 +92,6 @@ "eslint-plugin-jsdoc": "^46.9.1", "express": "^4.19.2", "express-ws": "^5.0.2", - "glob": "^13.0.0", "jsdom": "^18.0.1", "mocha": "^10.1.0", "mustache": "^4.2.0", diff --git a/src/browser/Terminal2.test.ts b/src/browser/Terminal2.test.ts index 8401ba78..a12c7966 100644 --- a/src/browser/Terminal2.test.ts +++ b/src/browser/Terminal2.test.ts @@ -3,7 +3,6 @@ * @license MIT */ -import * as glob from 'glob'; import * as path from 'path'; import * as os from 'os'; import * as fs from 'fs'; @@ -15,7 +14,10 @@ import { IDisposable } from '@xterm/xterm'; const COLS = 80; const ROWS = 25; -const TESTFILES = glob.sync('**/escape_sequence_files/*.in', { cwd: path.join(__dirname, '../..')}); +const escapeSequenceFilesDir = path.join(__dirname, '../../fixtures/escape_sequence_files'); +const TESTFILES = fs.readdirSync(escapeSequenceFilesDir) + .filter(f => f.endsWith('.in')) + .map(f => path.join(escapeSequenceFilesDir, f)); const SKIP_FILES = [ 't0055-EL.in', // EL/ED handle cursor at cols differently (see #3362) 't0084-CBT.in', @@ -33,9 +35,9 @@ if (os.platform() === 'darwin') { ); } // filter skipFilenames -const FILES = TESTFILES.filter(value => !SKIP_FILES.includes(value.split('/').slice(-1)[0])); +const FILES = TESTFILES.filter(value => !SKIP_FILES.includes(path.basename(value))); -describe('Escape Sequence Files', function(): void { +describe.only('Escape Sequence Files', function(): void { this.timeout(1000); let ptyTerm: any; @@ -62,7 +64,7 @@ describe('Escape Sequence Files', function(): void { }); for (const filename of FILES) { - (process.platform === 'win32' ? it.skip : it)(filename.split('/').slice(-1)[0], async () => { + (process.platform === 'win32' ? it.skip : it)(path.basename(filename), async () => { // reset terminal and handler if (customHandler) { customHandler.dispose(); @@ -88,7 +90,7 @@ describe('Escape Sequence Files', function(): void { }); // compare with expected output (right trimmed) - const expected = fs.readFileSync(filename.split('.')[0] + '.text', 'utf8'); + const expected = fs.readFileSync(filename.replace(/\.in$/, '.text'), 'utf8'); const expectedRightTrimmed = expected.split('\n').map(l => l.replace(/\s+$/, '')).join('\n'); if (content !== expectedRightTrimmed) { throw new Error(formatError(fs.readFileSync(filename, 'utf8'), content, expected));