Speed up all remaining unit tests below threshold (40ms?)

This commit is contained in:
Daniel Imms
2026-01-31 15:50:51 -08:00
parent 1c42957461
commit 34e68b1ad4
5 changed files with 56 additions and 43 deletions
+3 -3
View File
@@ -2521,7 +2521,7 @@ describe('InputHandler', () => {
const cpr: number[][] = [];
inputHandler.registerCsiHandler({ final: 'H' }, async params => {
cup.push(params.toArray() as number[]);
await new Promise(res => setTimeout(res, 50));
await Promise.resolve();
// late call of real repositioning
return inputHandler.cursorPosition(params);
});
@@ -2536,7 +2536,7 @@ describe('InputHandler', () => {
});
it('async OSC between', async () => {
inputHandler.registerOscHandler(1000, async data => {
await new Promise(res => setTimeout(res, 50));
await Promise.resolve();
assert.deepEqual(getLines(bufferService, 2), ['hello world!', '']);
assert.equal(data, 'some data');
return true;
@@ -2546,7 +2546,7 @@ describe('InputHandler', () => {
});
it('async DCS between', async () => {
inputHandler.registerDcsHandler({ final: 'a' }, async (data, params) => {
await new Promise(res => setTimeout(res, 50));
await Promise.resolve();
assert.deepEqual(getLines(bufferService, 2), ['hello world!', '']);
assert.equal(data, 'some data');
assert.deepEqual(params.toArray(), [1, 2]);
+1 -1
View File
@@ -88,7 +88,7 @@ describe('WriteBuffer', () => {
it('writeSync called from action does not overflow callstack - issue #3265', () => {
wb = new WriteBuffer(data => {
const num = parseInt(data as string);
if (num < 1000000) {
if (num < 10000) {
wb.writeSync('' + (num + 1));
}
});
+1 -1
View File
@@ -278,7 +278,7 @@ class TestHandlerAsync implements IDcsHandler {
}
public async unhook(success: boolean): Promise<boolean> {
// simple sleep to check in tests whether ordering gets messed up
await new Promise(res => setTimeout(res, 20));
await Promise.resolve();
this.output.push([this.msg, 'UNHOOK', success]);
if (this.returnFalse) {
return false;
+1 -1
View File
@@ -275,7 +275,7 @@ class TestHandlerAsync implements IOscHandler {
this.output.push([this.msg, this.id, 'PUT', utf32ToString(data, start, end)]);
}
public async end(success: boolean): Promise<boolean> {
await new Promise(res => setTimeout(res, 20));
await Promise.resolve();
this.output.push([this.msg, this.id, 'END', success]);
if (this.returnFalse) {
return false;