mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Create test ts project in ligatures addon
This commit is contained in:
+9
-5
@@ -5,9 +5,13 @@
|
||||
|
||||
import * as path from 'path';
|
||||
import { assert } from 'chai';
|
||||
import * as fontFinder from 'font-finder';
|
||||
|
||||
import * as ligatureSupport from '.';
|
||||
// Use require to get a mutable module object (ESM imports create read-only bindings)
|
||||
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
||||
const fontFinder = require('font-finder');
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
||||
const ligatureSupport = require('../out-esbuild/index');
|
||||
|
||||
const originalList = fontFinder.list;
|
||||
|
||||
@@ -18,7 +22,7 @@ describe('LigaturesAddon', () => {
|
||||
const input = 'a -> b www c';
|
||||
|
||||
before(() => {
|
||||
(fontFinder as any).list = () => Promise.resolve({
|
||||
fontFinder.list = () => Promise.resolve({
|
||||
'Fira Code': [{
|
||||
path: path.join(__dirname, '../fonts/firaCode.otf'),
|
||||
style: fontFinder.Style.Regular,
|
||||
@@ -37,11 +41,11 @@ describe('LigaturesAddon', () => {
|
||||
type: fontFinder.Type.Monospace,
|
||||
weight: 400
|
||||
}]
|
||||
} as fontFinder.FontList);
|
||||
});
|
||||
});
|
||||
|
||||
after(() => {
|
||||
(fontFinder as any).list = originalList;
|
||||
fontFinder.list = originalList;
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
+2
-1
@@ -5,7 +5,8 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import parse from './parse';
|
||||
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
||||
const parse = require('../out-esbuild/parse').default;
|
||||
|
||||
// TODO: integrate tests from http://test.csswg.org/suites/css-fonts-4_dev/nightly-unstable/
|
||||
describe('parse', () => {
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "ESNext",
|
||||
"lib": [
|
||||
"es2021"
|
||||
],
|
||||
"rootDir": ".",
|
||||
"outDir": "../out-esbuild-test",
|
||||
"sourceMap": true,
|
||||
"removeComments": true,
|
||||
"baseUrl": ".",
|
||||
"strict": true,
|
||||
"types": [
|
||||
"../../../node_modules/@types/mocha",
|
||||
"../../../node_modules/@types/node"
|
||||
]
|
||||
},
|
||||
"include": [
|
||||
"./**/*",
|
||||
"../../../typings/xterm.d.ts"
|
||||
]
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
"files": [],
|
||||
"include": [],
|
||||
"references": [
|
||||
{ "path": "./src" }
|
||||
{ "path": "./src" },
|
||||
{ "path": "./test" }
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user