Skip to content

Commit ddcde6a

Browse files
committed
change method name #1000
1 parent 97e28da commit ddcde6a

File tree

6 files changed

+34
-13
lines changed

6 files changed

+34
-13
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
[![npm](https://img.shields.io/badge/npm-DEV-blue.svg)](https://www.npmjs.com/package/jquery.terminal)
99
![bower](https://img.shields.io/badge/bower-DEV-yellow.svg)
1010
[![Build and test](https://github.com/jcubic/jquery.terminal/actions/workflows/build.yaml/badge.svg?branch=devel&event=push)](https://github.com/jcubic/jquery.terminal/actions/workflows/build.yaml)
11-
[![Coverage Status](https://coveralls.io/repos/github/jcubic/jquery.terminal/badge.svg?branch=devel&01c4c1ced7480107e0acd1f20fd8c4c3)](https://coveralls.io/github/jcubic/jquery.terminal?branch=devel)
11+
[![Coverage Status](https://coveralls.io/repos/github/jcubic/jquery.terminal/badge.svg?branch=devel&1e8bbe7e144977411c2c22df5eaa33ac)](https://coveralls.io/github/jcubic/jquery.terminal?branch=devel)
1212
![NPM Downloads](https://img.shields.io/npm/dm/jquery.terminal.svg?style=flat)
1313
[![jsDelivr Downloads](https://data.jsdelivr.com/v1/package/npm/jquery.terminal/badge?style=rounded&n=1)](https://www.jsdelivr.com/package/npm/jquery.terminal)
1414
[![Paid Support](https://img.shields.io/badge/paid-support-354465.svg)](https://support.jcubic.pl/)

__tests__/terminal.spec.js

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5255,18 +5255,18 @@ describe('Terminal plugin', function() {
52555255
term.clear();
52565256
term.echo(async () => {
52575257
await term.delay(100);
5258-
return 'helo';
5258+
return 'hello';
52595259
});
52605260
term.echo(async () => {
52615261
await term.delay(50);
52625262
return 'world';
52635263
});
5264-
term.view_ready().then(() => {
5264+
term.output_ready().then(() => {
52655265
const view = term.export_view();
52665266
term.clear();
52675267
term.import_view(view);
52685268
setTimeout(() => {
5269-
expect(term.get_output()).toEqual('world\nhelo');
5269+
expect(term.get_output()).toEqual('world\nhello');
52705270
done();
52715271
}, 200);
52725272
});
@@ -6441,6 +6441,27 @@ describe('Terminal plugin', function() {
64416441
expect(term.find('[data-index="1"]').length).toEqual(1);
64426442
expect(term.find('[data-index="1"]').children().last().text()).toEqual(nbsp('ccc> !!!'));
64436443
});
6444+
it('should flush async echo', () => {
6445+
const term = $('<div/>').terminal($.noop, {
6446+
greetings: false
6447+
});
6448+
term.echo(async () => {
6449+
await term.delay(100);
6450+
return 'hello';
6451+
}, {
6452+
flush: false
6453+
});
6454+
term.echo(async () => {
6455+
await term.delay(50);
6456+
return 'world';
6457+
}, {
6458+
flush: false
6459+
});
6460+
return term.output_ready().then(() => {
6461+
term.flush();
6462+
expect(term.get_output()).toEqual('hello\nworld');
6463+
});
6464+
});
64446465
});
64456466
describe('output_buffer', function() {
64466467
var term = $('<div/>').terminal($.noop, {greetings: false});

js/jquery.terminal-src.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9822,10 +9822,10 @@
98229822
},
98239823
// -------------------------------------------------------------
98249824
// :: Return a promise that is resolved when it's safe to
9825-
// :: call export_view, it wait for all async function echo
9825+
// :: call export_view or flush, it wait for all async echo
98269826
// :: to finish
98279827
// -------------------------------------------------------------
9828-
view_ready: function() {
9828+
output_ready: function() {
98299829
return event_hub.wait_for('async_echo_ready');
98309830
},
98319831
// -------------------------------------------------------------

js/jquery.terminal.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
*
4242
* broken image by Sophia Bai from the Noun Project (CC-BY)
4343
*
44-
* Date: Sun, 05 Jan 2025 17:04:29 +0000
44+
* Date: Tue, 14 Jan 2025 21:24:13 +0000
4545
*/
4646
/* global define, Map, BigInt */
4747
/* eslint-disable */
@@ -5407,7 +5407,7 @@
54075407
// -------------------------------------------------------------------------
54085408
$.terminal = {
54095409
version: 'DEV',
5410-
date: 'Sun, 05 Jan 2025 17:04:29 +0000',
5410+
date: 'Tue, 14 Jan 2025 21:24:13 +0000',
54115411
// colors from https://www.w3.org/wiki/CSS/Properties/color/keywords
54125412
color_names: [
54135413
'transparent', 'currentcolor', 'black', 'silver', 'gray', 'white',
@@ -9822,10 +9822,10 @@
98229822
},
98239823
// -------------------------------------------------------------
98249824
// :: Return a promise that is resolved when it's safe to
9825-
// :: call export_view, it wait for all async function echo
9825+
// :: call export_view or flush, it wait for all async echo
98269826
// :: to finish
98279827
// -------------------------------------------------------------
9828-
view_ready: function() {
9828+
output_ready: function() {
98299829
return event_hub.wait_for('async_echo_ready');
98309830
},
98319831
// -------------------------------------------------------------

js/jquery.terminal.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/jquery.terminal.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)