Skip to content

Commit 9529c5e

Browse files
Bruno Bernardinogustavohenke
Bruno Bernardino
authored andcommittedJun 25, 2019
Use prefixLength (#189)
The setting was not being sent through. Also added a test confirm the behavior and prevent regressions.
1 parent 313de53 commit 9529c5e

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed
 

‎bin/concurrently.js

+1
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ concurrently(args._.map((command, index) => {
154154
: (args.killOthersOnFail ? ['failure'] : []),
155155
raw: args.raw,
156156
prefix: args.prefix,
157+
prefixLength: args.prefixLength,
157158
restartDelay: args.restartAfter,
158159
restartTries: args.restartTries,
159160
successCondition: args.success,

‎bin/concurrently.spec.js

+20
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,26 @@ describe('--prefix', () => {
207207
});
208208
});
209209

210+
describe('--prefix-length', () => {
211+
it('is alised to -l', done => {
212+
const child = run('-p command -l 5 "echo foo" "echo bar"');
213+
child.log.pipe(buffer(child.close)).subscribe(lines => {
214+
expect(lines).toContainEqual(expect.stringContaining('[ec..o] foo'));
215+
expect(lines).toContainEqual(expect.stringContaining('[ec..r] bar'));
216+
done();
217+
}, done);
218+
});
219+
220+
it('specifies custom prefix length', done => {
221+
const child = run('--prefix command --prefix-length 5 "echo foo" "echo bar"');
222+
child.log.pipe(buffer(child.close)).subscribe(lines => {
223+
expect(lines).toContainEqual(expect.stringContaining('[ec..o] foo'));
224+
expect(lines).toContainEqual(expect.stringContaining('[ec..r] bar'));
225+
done();
226+
}, done);
227+
});
228+
});
229+
210230
describe('--restart-tries', () => {
211231
it('changes how many times a command will restart', done => {
212232
const child = run('--restart-tries 1 "exit 1"');

0 commit comments

Comments
 (0)
Please sign in to comment.