GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: skip some console tests on dumb terminal · nodejs/node@302408e

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test
    • common
      • README.md
      • index.js
      • index.mjs
    • parallel
      • test-console-clear.js
      • test-readline-interface.js
      • test-readline-position.js
      • test-readline-tab-complete.js
      • test-readline-undefined-columns.js
      • test-readline.js
      • test-repl-editor.js
      • test-repl-history-navigation.js
      • test-repl-load-multiline.js
      • test-repl-persistent-history.js
      • test-repl-preview.js
      • test-repl-programmatic-history.js
      • test-repl-reverse-search.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/common/README.md‎

Copy file name to clipboardExpand all lines: test/common/README.md
+8Lines changed: 8 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,10 @@ Platform check for Advanced Interactive eXecutive (AIX).
223223

224224
Attempts to 'kill' `pid`
225225

226+
### `isDumbTerminal`
227+
228+
* [<boolean>][]
229+
226230
### `isFreeBSD`
227231

228232
* [<boolean>][]
@@ -385,6 +389,10 @@ will not be run.
385389

386390
Logs '1..0 # Skipped: ' + `msg` and exits with exit code `0`.
387391

392+
### `skipIfDumbTerminal()`
393+
394+
Skip the rest of the tests if the current terminal is a dumb terminal
395+
388396
### `skipIfEslintMissing()`
389397

390398
Skip the rest of the tests in the current file when `ESLint` is not available
Collapse file

‎test/common/index.js‎

Copy file name to clipboardExpand all lines: test/common/index.js
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ const isOpenBSD = process.platform === 'openbsd';
112112
const isLinux = process.platform === 'linux';
113113
const isOSX = process.platform === 'darwin';
114114

115+
const isDumbTerminal = process.env.TERM === 'dumb';
116+
115117
const rootDir = isWindows ? 'c:\\' : '/';
116118

117119
const buildType = process.config.target_defaults ?
@@ -653,6 +655,12 @@ function invalidArgTypeHelper(input) {
653655
return ` Received type ${typeof input} (${inspected})`;
654656
}
655657

658+
function skipIfDumbTerminal() {
659+
if (isDumbTerminal) {
660+
skip('skipping - dumb terminal');
661+
}
662+
}
663+
656664
const common = {
657665
allowGlobals,
658666
buildType,
@@ -672,6 +680,7 @@ const common = {
672680
invalidArgTypeHelper,
673681
isAIX,
674682
isAlive,
683+
isDumbTerminal,
675684
isFreeBSD,
676685
isLinux,
677686
isMainThread,
@@ -692,6 +701,7 @@ const common = {
692701
runWithInvalidFD,
693702
skip,
694703
skipIf32Bits,
704+
skipIfDumbTerminal,
695705
skipIfEslintMissing,
696706
skipIfInspectorDisabled,
697707
skipIfWorker,
Collapse file

‎test/common/index.mjs‎

Copy file name to clipboardExpand all lines: test/common/index.mjs
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const {
1212
isIBMi,
1313
isLinuxPPCBE,
1414
isSunOS,
15+
isDumbTerminal,
1516
isFreeBSD,
1617
isOpenBSD,
1718
isLinux,
@@ -31,6 +32,7 @@ const {
3132
mustCall,
3233
mustCallAtLeast,
3334
hasMultiLocalhost,
35+
skipIfDumbTerminal,
3436
skipIfEslintMissing,
3537
canCreateSymLink,
3638
getCallSite,
@@ -57,6 +59,7 @@ export {
5759
isIBMi,
5860
isLinuxPPCBE,
5961
isSunOS,
62+
isDumbTerminal,
6063
isFreeBSD,
6164
isOpenBSD,
6265
isLinux,
@@ -76,6 +79,7 @@ export {
7679
mustCall,
7780
mustCallAtLeast,
7881
hasMultiLocalhost,
82+
skipIfDumbTerminal,
7983
skipIfEslintMissing,
8084
canCreateSymLink,
8185
getCallSite,
Collapse file

‎test/parallel/test-console-clear.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-console-clear.js
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
require('../common');
3+
const common = require('../common');
44
const assert = require('assert');
55

66
const stdoutWrite = process.stdout.write;
@@ -18,5 +18,7 @@ function doTest(isTTY, check) {
1818
}
1919

2020
// Fake TTY
21-
doTest(true, check);
21+
if (!common.isDumbTerminal) {
22+
doTest(true, check);
23+
}
2224
doTest(false, '');
Collapse file

‎test/parallel/test-readline-interface.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-readline-interface.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
// Flags: --expose-internals
2323
'use strict';
2424
const common = require('../common');
25+
common.skipIfDumbTerminal();
2526

2627
const assert = require('assert');
2728
const readline = require('readline');
Collapse file

‎test/parallel/test-readline-position.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-readline-position.js
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
// Flags: --expose-internals
22
'use strict';
3-
require('../common');
3+
const common = require('../common');
44
const { internalBinding } = require('internal/test/binding');
55
const { PassThrough } = require('stream');
66
const readline = require('readline');
77
const assert = require('assert');
88

99
const ctrlU = { ctrl: true, name: 'u' };
1010

11+
common.skipIfDumbTerminal();
12+
1113
{
1214
const input = new PassThrough();
1315
const rl = readline.createInterface({
Collapse file

‎test/parallel/test-readline-tab-complete.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-readline-tab-complete.js
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ const assert = require('assert');
88
const EventEmitter = require('events').EventEmitter;
99
const { getStringWidth } = require('internal/util/inspect');
1010

11+
common.skipIfDumbTerminal();
12+
1113
// This test verifies that the tab completion supports unicode and the writes
1214
// are limited to the minimum.
1315
[
Collapse file

‎test/parallel/test-readline-undefined-columns.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-readline-undefined-columns.js
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ const assert = require('assert');
55
const PassThrough = require('stream').PassThrough;
66
const readline = require('readline');
77

8+
common.skipIfDumbTerminal();
9+
810
// Checks that tab completion still works
911
// when output column size is undefined
1012

Collapse file

‎test/parallel/test-readline.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-readline.js
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ const { PassThrough } = require('stream');
44
const readline = require('readline');
55
const assert = require('assert');
66

7+
common.skipIfDumbTerminal();
8+
79
{
810
const input = new PassThrough();
911
const rl = readline.createInterface({
Collapse file

‎test/parallel/test-repl-editor.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-repl-editor.js
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
'use strict';
22

3-
require('../common');
3+
const common = require('../common');
44
const assert = require('assert');
55
const repl = require('repl');
66
const ArrayStream = require('../common/arraystream');
77

8+
common.skipIfDumbTerminal();
9+
810
// \u001b[nG - Moves the cursor to n st column
911
// \u001b[0J - Clear screen
1012
// \u001b[0K - Clear to line end

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.