Add typings test setup
This commit is contained in:
@@ -14,6 +14,7 @@ npm-debug.log
|
|||||||
build/
|
build/
|
||||||
.vscode/
|
.vscode/
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
fixtures/typings-test/*.js
|
||||||
|
|
||||||
# Directories needed for code coverage
|
# Directories needed for code coverage
|
||||||
/coverage/
|
/coverage/
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"files": [
|
||||||
|
"typing-tests.ts"
|
||||||
|
],
|
||||||
|
"compilerOptions": {
|
||||||
|
"module": "commonjs",
|
||||||
|
"target": "es5"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
/// <reference path="../../typings/xterm.d.ts" />
|
||||||
|
|
||||||
|
import { Terminal } from 'xterm';
|
||||||
|
|
||||||
|
namespace constructor_tests {
|
||||||
|
{
|
||||||
|
new Terminal();
|
||||||
|
new Terminal({});
|
||||||
|
new Terminal({
|
||||||
|
cols: 1,
|
||||||
|
rows: 1
|
||||||
|
});
|
||||||
|
new Terminal({
|
||||||
|
'cols': 1,
|
||||||
|
'cursorBlink': true,
|
||||||
|
'cursorStyle': 'block',
|
||||||
|
'disableStdin': false,
|
||||||
|
'rows': 1,
|
||||||
|
'scrollback': 10,
|
||||||
|
'tabStopWidth': 2,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,11 +4,13 @@
|
|||||||
* This file contains integration tests for xterm.js.
|
* This file contains integration tests for xterm.js.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import * as cp from 'child_process';
|
||||||
import * as glob from 'glob';
|
import * as glob from 'glob';
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as os from 'os';
|
import * as os from 'os';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as pty from 'node-pty';
|
import * as pty from 'node-pty';
|
||||||
|
import { assert } from 'chai';
|
||||||
import { Terminal } from './Terminal';
|
import { Terminal } from './Terminal';
|
||||||
import { CHAR_DATA_CHAR_INDEX } from './Buffer';
|
import { CHAR_DATA_CHAR_INDEX } from './Buffer';
|
||||||
|
|
||||||
@@ -143,3 +145,12 @@ if (os.platform() !== 'win32') {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
describe('typings', () => {
|
||||||
|
it('should throw no compile errors', () => {
|
||||||
|
let result = cp.spawnSync(path.join(__dirname, '..', 'node_modules', '.bin', 'tsc'), {
|
||||||
|
cwd: path.join(__dirname, '..', 'fixtures', 'typings-test')
|
||||||
|
});
|
||||||
|
assert.equal(result.status, 0, `build did not succeed:\nstdout: ${result.stdout.toString()}\nstderr: ${result.stderr.toString()}\n`);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|||||||
Vendored
+12
-12
@@ -181,19 +181,19 @@ declare module 'xterm' {
|
|||||||
* propogation and/or prevent the default action. The function returns
|
* propogation and/or prevent the default action. The function returns
|
||||||
* whether the event should be processed by xterm.js.
|
* whether the event should be processed by xterm.js.
|
||||||
*/
|
*/
|
||||||
attachCustomKeyEventHandler(customKeyEventHandler: (event: KeyboardEvent) => boolean);
|
attachCustomKeyEventHandler(customKeyEventHandler: (event: KeyboardEvent) => boolean): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (EXPERIMENTAL) Registers a link matcher, allowing custom link patterns to
|
* (EXPERIMENTAL) Registers a link matcher, allowing custom link patterns to
|
||||||
* be matched and handled.
|
* be matched and handled.
|
||||||
* @param regex The regular expression to search for, specifically this
|
* @param regex The regular expression to search for, specifically this
|
||||||
* searches the textContent of the rows. You will want to use \s to match a
|
* searches the textContent of the rows. You will want to use \s to match a
|
||||||
* space ' ' character for example.
|
* space ' ' character for example.
|
||||||
* @param handler The callback when the link is called.
|
* @param handler The callback when the link is called.
|
||||||
* @param options Options for the link matcher.
|
* @param options Options for the link matcher.
|
||||||
* @return The ID of the new matcher, this can be used to deregister.
|
* @return The ID of the new matcher, this can be used to deregister.
|
||||||
*/
|
*/
|
||||||
registerLinkMatcher(regex: RegExp, handler: (event: MouseEvent, uri: string) => boolean | void , options?: any);
|
registerLinkMatcher(regex: RegExp, handler: (event: MouseEvent, uri: string) => boolean | void , options?: any): number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (EXPERIMENTAL) Deregisters a link matcher if it has been registered.
|
* (EXPERIMENTAL) Deregisters a link matcher if it has been registered.
|
||||||
|
|||||||
Reference in New Issue
Block a user