Skip to content

Commit

Permalink
test: update execa cli calls (#964)
Browse files Browse the repository at this point in the history
  • Loading branch information
armano2 committed Feb 6, 2020
1 parent 97d7757 commit a595575
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 20 deletions.
3 changes: 1 addition & 2 deletions @commitlint/cli/package.json
Expand Up @@ -51,8 +51,7 @@
"babel-preset-commitlint": "^8.2.0",
"cross-env": "7.0.0",
"execa": "0.11.0",
"fs-extra": "^8.1.0",
"string-to-stream": "3.0.1"
"fs-extra": "^8.1.0"
},
"dependencies": {
"@commitlint/format": "^8.3.4",
Expand Down
6 changes: 2 additions & 4 deletions @commitlint/cli/src/cli.test.js
Expand Up @@ -3,18 +3,16 @@ import {fix, git} from '@commitlint/test';
import execa from 'execa';
import merge from 'lodash/merge';
import fs from 'fs-extra';
import stream from 'string-to-stream';

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

const cli = (args, options) => {
return (input = '') => {
const c = execa(bin, args, {
capture: ['stdout'],
cwd: options.cwd,
env: options.env
env: options.env,
input: input
});
stream(input).pipe(c.stdin);
return c.catch(err => err);
};
};
Expand Down
6 changes: 2 additions & 4 deletions @commitlint/prompt-cli/cli.test.js
@@ -1,17 +1,15 @@
import {git} from '@commitlint/test';
import execa from 'execa';
import stream from 'string-to-stream';

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

const cli = (args, options) => {
return (input = '') => {
const c = execa(bin, args, {
capture: ['stdout'],
cwd: options.cwd,
env: options.env
env: options.env,
input: input
});
stream(input).pipe(c.stdin);
return c.catch(err => err);
};
};
Expand Down
3 changes: 1 addition & 2 deletions @commitlint/prompt-cli/package.json
Expand Up @@ -32,8 +32,7 @@
},
"devDependencies": {
"@commitlint/test": "8.2.0",
"@commitlint/utils": "^8.3.4",
"string-to-stream": "3.0.1"
"@commitlint/utils": "^8.3.4"
},
"dependencies": {
"@commitlint/prompt": "^8.3.5",
Expand Down
9 changes: 1 addition & 8 deletions yarn.lock
Expand Up @@ -8038,7 +8038,7 @@ read@1, read@~1.0.1:
string_decoder "~1.1.1"
util-deprecate "~1.0.1"

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

string-to-stream@3.0.1:
version "3.0.1"
resolved "https://registry.npmjs.org/string-to-stream/-/string-to-stream-3.0.1.tgz#480e6fb4d5476d31cb2221f75307a5dcb6638a42"
integrity sha512-Hl092MV3USJuUCC6mfl9sPzGloA3K5VwdIeJjYIkXY/8K+mUvaeEabWJgArp+xXrsWxCajeT2pc4axbVhIZJyg==
dependencies:
readable-stream "^3.4.0"

string-width@^1.0.1:
version "1.0.2"
resolved "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3"
Expand Down

0 comments on commit a595575

Please sign in to comment.