Skip to content

Commit a595575

Browse files
authored
test: update execa cli calls (#964)
1 parent 97d7757 commit a595575

File tree

5 files changed

+7
-20
lines changed

5 files changed

+7
-20
lines changed

Diff for: @commitlint/cli/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@
5151
"babel-preset-commitlint": "^8.2.0",
5252
"cross-env": "7.0.0",
5353
"execa": "0.11.0",
54-
"fs-extra": "^8.1.0",
55-
"string-to-stream": "3.0.1"
54+
"fs-extra": "^8.1.0"
5655
},
5756
"dependencies": {
5857
"@commitlint/format": "^8.3.4",

Diff for: @commitlint/cli/src/cli.test.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,16 @@ import {fix, git} from '@commitlint/test';
33
import execa from 'execa';
44
import merge from 'lodash/merge';
55
import fs from 'fs-extra';
6-
import stream from 'string-to-stream';
76

87
const bin = require.resolve('../lib/cli.js');
98

109
const cli = (args, options) => {
1110
return (input = '') => {
1211
const c = execa(bin, args, {
13-
capture: ['stdout'],
1412
cwd: options.cwd,
15-
env: options.env
13+
env: options.env,
14+
input: input
1615
});
17-
stream(input).pipe(c.stdin);
1816
return c.catch(err => err);
1917
};
2018
};

Diff for: @commitlint/prompt-cli/cli.test.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
import {git} from '@commitlint/test';
22
import execa from 'execa';
3-
import stream from 'string-to-stream';
43

54
const bin = require.resolve('./cli.js');
65

76
const cli = (args, options) => {
87
return (input = '') => {
98
const c = execa(bin, args, {
10-
capture: ['stdout'],
119
cwd: options.cwd,
12-
env: options.env
10+
env: options.env,
11+
input: input
1312
});
14-
stream(input).pipe(c.stdin);
1513
return c.catch(err => err);
1614
};
1715
};

Diff for: @commitlint/prompt-cli/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@
3232
},
3333
"devDependencies": {
3434
"@commitlint/test": "8.2.0",
35-
"@commitlint/utils": "^8.3.4",
36-
"string-to-stream": "3.0.1"
35+
"@commitlint/utils": "^8.3.4"
3736
},
3837
"dependencies": {
3938
"@commitlint/prompt": "^8.3.5",

Diff for: yarn.lock

+1-8
Original file line numberDiff line numberDiff line change
@@ -8038,7 +8038,7 @@ read@1, read@~1.0.1:
80388038
string_decoder "~1.1.1"
80398039
util-deprecate "~1.0.1"
80408040

8041-
"readable-stream@2 || 3", readable-stream@^3.0.1, readable-stream@^3.0.2, readable-stream@^3.1.1, readable-stream@^3.4.0:
8041+
"readable-stream@2 || 3", readable-stream@^3.0.1, readable-stream@^3.0.2, readable-stream@^3.1.1:
80428042
version "3.4.0"
80438043
resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz#a51c26754658e0a3c21dbf59163bd45ba6f447fc"
80448044
integrity sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==
@@ -8904,13 +8904,6 @@ string-length@^3.1.0:
89048904
astral-regex "^1.0.0"
89058905
strip-ansi "^5.2.0"
89068906

8907-
8908-
version "3.0.1"
8909-
resolved "https://registry.npmjs.org/string-to-stream/-/string-to-stream-3.0.1.tgz#480e6fb4d5476d31cb2221f75307a5dcb6638a42"
8910-
integrity sha512-Hl092MV3USJuUCC6mfl9sPzGloA3K5VwdIeJjYIkXY/8K+mUvaeEabWJgArp+xXrsWxCajeT2pc4axbVhIZJyg==
8911-
dependencies:
8912-
readable-stream "^3.4.0"
8913-
89148907
string-width@^1.0.1:
89158908
version "1.0.2"
89168909
resolved "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3"

0 commit comments

Comments
 (0)