Skip to content

Commit

Permalink
fix lint + unit tests for new API #637
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Feb 3, 2021
1 parent e8b59ab commit 71011c0
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 17 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ https://terminal.jcubic.pl

[![npm](https://img.shields.io/badge/npm-DEV-blue.svg)](https://www.npmjs.com/package/jquery.terminal)
![bower](https://img.shields.io/badge/bower-DEV-yellow.svg)
[![travis](https://travis-ci.org/jcubic/jquery.terminal.svg?branch=devel&8a8437a9fee25cdade9be0a97dda7f6e15f4bf4e)](https://travis-ci.org/jcubic/jquery.terminal)
[![Coverage Status](https://coveralls.io/repos/github/jcubic/jquery.terminal/badge.svg?branch=devel&829978fd999563a22db4e88d604c0e15)](https://coveralls.io/github/jcubic/jquery.terminal?branch=devel)
[![travis](https://travis-ci.org/jcubic/jquery.terminal.svg?branch=devel&e8b59ab0777ee3319751b83e75f27dac491ba698)](https://travis-ci.org/jcubic/jquery.terminal)
[![Coverage Status](https://coveralls.io/repos/github/jcubic/jquery.terminal/badge.svg?branch=devel&634dd6bdb563cac4da5f3e6ae04ce222)](https://coveralls.io/github/jcubic/jquery.terminal?branch=devel)
![downloads](https://img.shields.io/npm/dm/jquery.terminal.svg?style=flat)
[![](https://data.jsdelivr.com/v1/package/npm/jquery.terminal/badge?style=rounded)](https://www.jsdelivr.com/package/npm/jquery.terminal)
[![LICENSE MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/jcubic/jquery.terminal/blob/master/LICENSE)
Expand Down
15 changes: 15 additions & 0 deletions __tests__/__snapshots__/terminal.spec.js.snap
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[` 1`] = `
Object {
"char": Object {
"height": 0,
"width": 0,
},
"cols": 100,
"rows": 25,
"terminal": Object {
"height": 0,
"width": 0,
},
}
`;

exports[`Terminal plugin cmd plugin should move cursor 1`] = `
Array [
5,
Expand Down
11 changes: 11 additions & 0 deletions __tests__/terminal.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2964,6 +2964,17 @@ describe('Terminal plugin', function() {
expect(term.history().data()).toEqual([]);
});
});
describe('geometry', function() {
var term = $('<div/>').css({
width: 800,
height: 600
}).appendTo('body').terminal($.noop, {
numChars: 100,
numRows: 25
});
expect(term.geometry()).toMatchSnapshot();
term.remove();
});
describe('exit', function() {
it('should add exit command', function() {
var term = $('<div/>').terminal($.noop, {
Expand Down
8 changes: 4 additions & 4 deletions js/jquery.terminal-2.20.2.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
*
* broken image by Sophia Bai from the Noun Project (CC-BY)
*
* Date: Wed, 03 Feb 2021 15:24:28 +0000
* Date: Wed, 03 Feb 2021 21:07:55 +0000
*/
/* global define, Map */
/* eslint-disable */
Expand Down Expand Up @@ -4486,7 +4486,7 @@
// -------------------------------------------------------------------------
$.terminal = {
version: 'DEV',
date: 'Wed, 03 Feb 2021 15:24:28 +0000',
date: 'Wed, 03 Feb 2021 21:07:55 +0000',
// colors from https://www.w3.org/wiki/CSS/Properties/color/keywords
color_names: [
'transparent', 'currentcolor', 'black', 'silver', 'gray', 'white',
Expand Down Expand Up @@ -5747,8 +5747,8 @@
return '';
}
var quote = string[0];
var re = new RegExp("(^|(?:\\\\\\\\(?:\\\\\\\\)*))" + quote, "g");
string = string.replace(re, '$1').replace(new RegExp(quote + '$'), '');
var re = new RegExp("(\\\\\\\\(?:\\\\\\\\)*)" + quote, "g");
string = string.replace(re, '$1').replace(/^['"]|['"]$/g, '');
if (quote === "'") {
string = string.replace(/"/g, '\\"');
}
Expand Down
4 changes: 2 additions & 2 deletions js/jquery.terminal-2.20.2.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/jquery.terminal-src.js
Original file line number Diff line number Diff line change
Expand Up @@ -5747,8 +5747,8 @@
return '';
}
var quote = string[0];
var re = new RegExp("(^|(?:\\\\\\\\(?:\\\\\\\\)*))" + quote, "g");
string = string.replace(re, '$1').replace(new RegExp(quote + '$'), '');
var re = new RegExp("(\\\\\\\\(?:\\\\\\\\)*)" + quote, "g");
string = string.replace(re, '$1').replace(/^['"]|['"]$/g, '');
if (quote === "'") {
string = string.replace(/"/g, '\\"');
}
Expand Down
8 changes: 4 additions & 4 deletions js/jquery.terminal.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
*
* broken image by Sophia Bai from the Noun Project (CC-BY)
*
* Date: Wed, 03 Feb 2021 15:24:28 +0000
* Date: Wed, 03 Feb 2021 21:07:55 +0000
*/
/* global define, Map */
/* eslint-disable */
Expand Down Expand Up @@ -4486,7 +4486,7 @@
// -------------------------------------------------------------------------
$.terminal = {
version: 'DEV',
date: 'Wed, 03 Feb 2021 15:24:28 +0000',
date: 'Wed, 03 Feb 2021 21:07:55 +0000',
// colors from https://www.w3.org/wiki/CSS/Properties/color/keywords
color_names: [
'transparent', 'currentcolor', 'black', 'silver', 'gray', 'white',
Expand Down Expand Up @@ -5747,8 +5747,8 @@
return '';
}
var quote = string[0];
var re = new RegExp("(^|(?:\\\\\\\\(?:\\\\\\\\)*))" + quote, "g");
string = string.replace(re, '$1').replace(new RegExp(quote + '$'), '');
var re = new RegExp("(\\\\\\\\(?:\\\\\\\\)*)" + quote, "g");
string = string.replace(re, '$1').replace(/^['"]|['"]$/g, '');
if (quote === "'") {
string = string.replace(/"/g, '\\"');
}
Expand Down
4 changes: 2 additions & 2 deletions js/jquery.terminal.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/jquery.terminal.min.js.map

Large diffs are not rendered by default.

0 comments on commit 71011c0

Please sign in to comment.