Move unit tests to right folder, push font fixtures

This commit is contained in:
Daniel Imms
2026-01-03 09:16:58 -08:00
parent 363fc84fd2
commit 21b8f77afb
10 changed files with 11 additions and 15 deletions
-1
View File
@@ -3,7 +3,6 @@ node_modules/
coverage/
lib/
fonts/
.env
.vscode/
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -6,9 +6,7 @@
import * as path from 'path';
import * as fs from 'fs';
import { assert } from 'chai';
const fontLigatures = require('../out-esbuild/fontLigatures/index');
const loadBuffer: (buffer: ArrayBuffer, options?: { cacheSize?: number }) => Font = fontLigatures.loadBuffer;
import { loadBuffer } from './index';
interface Font {
findLigatures(text: string): { outputGlyphs: number[]; contextRanges: [number, number][] };
@@ -263,10 +261,10 @@ const ubuntuCases: TestCase[] = [
];
const fontPaths: Record<string, string> = {
'Fira Code': path.join(__dirname, '../fonts/FiraCode-Regular.otf'),
'Iosevka': path.join(__dirname, '../fonts/iosevka-regular.ttf'),
'Monoid': path.join(__dirname, '../fonts/Monoid-Regular.ttf'),
'Ubuntu Mono': path.join(__dirname, '../fonts/UbuntuMono-Regular.ttf')
'Fira Code': path.join(__dirname, '../../fonts/FiraCode-Regular.otf'),
'Iosevka': path.join(__dirname, '../../fonts/iosevka-regular.ttf'),
'Monoid': path.join(__dirname, '../../fonts/Monoid-Regular.ttf'),
'Ubuntu Mono': path.join(__dirname, '../../fonts/UbuntuMono-Regular.ttf')
};
const fontCache: Map<string, Font> = new Map();
@@ -4,8 +4,7 @@
*/
import { assert } from 'chai';
const mergeTrees = require('../out-esbuild/fontLigatures/merge').default;
import mergeTrees from './merge';
interface LookupResult {
contextRange: [number, number];
@@ -4,8 +4,7 @@
*/
import { assert } from 'chai';
const mergeRange = require('../out-esbuild/fontLigatures/mergeRange').default;
import mergeRange from './mergeRange';
describe('addon-ligatures - mergeRange', () => {
it('inserts a new range before the existing ones', () => {
@@ -4,8 +4,7 @@
*/
import { assert } from 'chai';
const parse = require('../out-esbuild/parse').default;
import parse from './parse';
// TODO: integrate tests from http://test.csswg.org/suites/css-fonts-4_dev/nightly-unstable/
describe('addon-ligatures - parse', () => {
+3 -1
View File
@@ -9,7 +9,9 @@
"noUnusedLocals": true,
"preserveWatchOutput": true,
"types": [
"../../../node_modules/@types/mocha"
"../../../node_modules/@types/mocha",
// HACK: src shouldn't use node types but it's needed for index.test.ts
"../../../node_modules/@types/node"
],
"paths": {
"@xterm/addon-ligatures" : [