| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 6bca487 commit 302408e
16 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -223,6 +223,10 @@ Platform check for Advanced Interactive eXecutive (AIX). | |||
| 223 | 223 | ||
| 224 | 224 | Attempts to 'kill' `pid` | |
| 225 | 225 | ||
| 226 | + ### `isDumbTerminal` | ||
| 227 | + | ||
| 228 | + * [<boolean>][] | ||
| 229 | + | ||
| 226 | 230 | ### `isFreeBSD` | |
| 227 | 231 | ||
| 228 | 232 | * [<boolean>][] | |
@@ -385,6 +389,10 @@ will not be run. | |||
| 385 | 389 | ||
| 386 | 390 | Logs '1..0 # Skipped: ' + `msg` and exits with exit code `0`. | |
| 387 | 391 | ||
| 392 | + ### `skipIfDumbTerminal()` | ||
| 393 | + | ||
| 394 | + Skip the rest of the tests if the current terminal is a dumb terminal | ||
| 395 | + | ||
| 388 | 396 | ### `skipIfEslintMissing()` | |
| 389 | 397 | ||
| 390 | 398 | Skip the rest of the tests in the current file when `ESLint` is not available | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -112,6 +112,8 @@ const isOpenBSD = process.platform === 'openbsd'; | |||
| 112 | 112 | const isLinux = process.platform === 'linux'; | |
| 113 | 113 | const isOSX = process.platform === 'darwin'; | |
| 114 | 114 | ||
| 115 | + const isDumbTerminal = process.env.TERM === 'dumb'; | ||
| 116 | + | ||
| 115 | 117 | const rootDir = isWindows ? 'c:\\' : '/'; | |
| 116 | 118 | ||
| 117 | 119 | const buildType = process.config.target_defaults ? | |
@@ -653,6 +655,12 @@ function invalidArgTypeHelper(input) { | |||
| 653 | 655 | return ` Received type ${typeof input} (${inspected})`; | |
| 654 | 656 | } | |
| 655 | 657 | ||
| 658 | + function skipIfDumbTerminal() { | ||
| 659 | + if (isDumbTerminal) { | ||
| 660 | + skip('skipping - dumb terminal'); | ||
| 661 | + } | ||
| 662 | + } | ||
| 663 | + | ||
| 656 | 664 | const common = { | |
| 657 | 665 | allowGlobals, | |
| 658 | 666 | buildType, | |
@@ -672,6 +680,7 @@ const common = { | |||
| 672 | 680 | invalidArgTypeHelper, | |
| 673 | 681 | isAIX, | |
| 674 | 682 | isAlive, | |
| 683 | + isDumbTerminal, | ||
| 675 | 684 | isFreeBSD, | |
| 676 | 685 | isLinux, | |
| 677 | 686 | isMainThread, | |
@@ -692,6 +701,7 @@ const common = { | |||
| 692 | 701 | runWithInvalidFD, | |
| 693 | 702 | skip, | |
| 694 | 703 | skipIf32Bits, | |
| 704 | + skipIfDumbTerminal, | ||
| 695 | 705 | skipIfEslintMissing, | |
| 696 | 706 | skipIfInspectorDisabled, | |
| 697 | 707 | skipIfWorker, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,6 +12,7 @@ const { | |||
| 12 | 12 | isIBMi, | |
| 13 | 13 | isLinuxPPCBE, | |
| 14 | 14 | isSunOS, | |
| 15 | + isDumbTerminal, | ||
| 15 | 16 | isFreeBSD, | |
| 16 | 17 | isOpenBSD, | |
| 17 | 18 | isLinux, | |
@@ -31,6 +32,7 @@ const { | |||
| 31 | 32 | mustCall, | |
| 32 | 33 | mustCallAtLeast, | |
| 33 | 34 | hasMultiLocalhost, | |
| 35 | + skipIfDumbTerminal, | ||
| 34 | 36 | skipIfEslintMissing, | |
| 35 | 37 | canCreateSymLink, | |
| 36 | 38 | getCallSite, | |
@@ -57,6 +59,7 @@ export { | |||
| 57 | 59 | isIBMi, | |
| 58 | 60 | isLinuxPPCBE, | |
| 59 | 61 | isSunOS, | |
| 62 | + isDumbTerminal, | ||
| 60 | 63 | isFreeBSD, | |
| 61 | 64 | isOpenBSD, | |
| 62 | 65 | isLinux, | |
@@ -76,6 +79,7 @@ export { | |||
| 76 | 79 | mustCall, | |
| 77 | 80 | mustCallAtLeast, | |
| 78 | 81 | hasMultiLocalhost, | |
| 82 | + skipIfDumbTerminal, | ||
| 79 | 83 | skipIfEslintMissing, | |
| 80 | 84 | canCreateSymLink, | |
| 81 | 85 | getCallSite, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,6 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | 2 | ||
| 3 | - require('../common'); | ||
| 3 | + const common = require('../common'); | ||
| 4 | 4 | const assert = require('assert'); | |
| 5 | 5 | ||
| 6 | 6 | const stdoutWrite = process.stdout.write; | |
@@ -18,5 +18,7 @@ function doTest(isTTY, check) { | |||
| 18 | 18 | } | |
| 19 | 19 | ||
| 20 | 20 | // Fake TTY | |
| 21 | - doTest(true, check); | ||
| 21 | + if (!common.isDumbTerminal) { | ||
| 22 | + doTest(true, check); | ||
| 23 | + } | ||
| 22 | 24 | doTest(false, ''); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,6 +22,7 @@ | |||
| 22 | 22 | // Flags: --expose-internals | |
| 23 | 23 | 'use strict'; | |
| 24 | 24 | const common = require('../common'); | |
| 25 | + common.skipIfDumbTerminal(); | ||
| 25 | 26 | ||
| 26 | 27 | const assert = require('assert'); | |
| 27 | 28 | const readline = require('readline'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,13 +1,15 @@ | |||
| 1 | 1 | // Flags: --expose-internals | |
| 2 | 2 | 'use strict'; | |
| 3 | - require('../common'); | ||
| 3 | + const common = require('../common'); | ||
| 4 | 4 | const { internalBinding } = require('internal/test/binding'); | |
| 5 | 5 | const { PassThrough } = require('stream'); | |
| 6 | 6 | const readline = require('readline'); | |
| 7 | 7 | const assert = require('assert'); | |
| 8 | 8 | ||
| 9 | 9 | const ctrlU = { ctrl: true, name: 'u' }; | |
| 10 | 10 | ||
| 11 | + common.skipIfDumbTerminal(); | ||
| 12 | + | ||
| 11 | 13 | { | |
| 12 | 14 | const input = new PassThrough(); | |
| 13 | 15 | const rl = readline.createInterface({ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,6 +8,8 @@ const assert = require('assert'); | |||
| 8 | 8 | const EventEmitter = require('events').EventEmitter; | |
| 9 | 9 | const { getStringWidth } = require('internal/util/inspect'); | |
| 10 | 10 | ||
| 11 | + common.skipIfDumbTerminal(); | ||
| 12 | + | ||
| 11 | 13 | // This test verifies that the tab completion supports unicode and the writes | |
| 12 | 14 | // are limited to the minimum. | |
| 13 | 15 | [ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,6 +5,8 @@ const assert = require('assert'); | |||
| 5 | 5 | const PassThrough = require('stream').PassThrough; | |
| 6 | 6 | const readline = require('readline'); | |
| 7 | 7 | ||
| 8 | + common.skipIfDumbTerminal(); | ||
| 9 | + | ||
| 8 | 10 | // Checks that tab completion still works | |
| 9 | 11 | // when output column size is undefined | |
| 10 | 12 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,6 +4,8 @@ const { PassThrough } = require('stream'); | |||
| 4 | 4 | const readline = require('readline'); | |
| 5 | 5 | const assert = require('assert'); | |
| 6 | 6 | ||
| 7 | + common.skipIfDumbTerminal(); | ||
| 8 | + | ||
| 7 | 9 | { | |
| 8 | 10 | const input = new PassThrough(); | |
| 9 | 11 | const rl = readline.createInterface({ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,10 +1,12 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | 2 | ||
| 3 | - require('../common'); | ||
| 3 | + const common = require('../common'); | ||
| 4 | 4 | const assert = require('assert'); | |
| 5 | 5 | const repl = require('repl'); | |
| 6 | 6 | const ArrayStream = require('../common/arraystream'); | |
| 7 | 7 | ||
| 8 | + common.skipIfDumbTerminal(); | ||
| 9 | + | ||
| 8 | 10 | // \u001b[nG - Moves the cursor to n st column | |
| 9 | 11 | // \u001b[0J - Clear screen | |
| 10 | 12 | // \u001b[0K - Clear to line end | |
| Back | FazBrowse Home | New Git URL |
0 commit comments