Skip to content

Commit

Permalink
Fix: Avoid setting displayName on series/parallel functions (ref gulp…
Browse files Browse the repository at this point in the history
  • Loading branch information
coreyfarrell authored and phated committed Apr 6, 2019
1 parent f94fd87 commit 1ee58b1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
7 changes: 3 additions & 4 deletions lib/parallel.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@ function parallel() {
var args = normalizeArgs(this._registry, arguments);
var extensions = createExtensions(this);
var fn = create(args, extensions);

fn.displayName = '<parallel>';
var name = '<parallel>';

metadata.set(fn, {
name: fn.displayName,
name: name,
branch: true,
tree: {
label: fn.displayName,
label: name,
type: 'function',
branch: true,
nodes: buildTree(args),
Expand Down
7 changes: 3 additions & 4 deletions lib/series.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@ function series() {
var args = normalizeArgs(this._registry, arguments);
var extensions = createExtensions(this);
var fn = create(args, extensions);

fn.displayName = '<series>';
var name = '<series>';

metadata.set(fn, {
name: fn.displayName,
name: name,
branch: true,
tree: {
label: fn.displayName,
label: name,
type: 'function',
branch: true,
nodes: buildTree(args),
Expand Down
6 changes: 6 additions & 0 deletions test/parallel.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,10 @@ describe('parallel', function() {
done();
});
});

it('should not register a displayName on the returned function by default', function(done) {
var task = taker.parallel(fn1);
expect(task.displayName).toEqual(undefined);
done();
});
});
5 changes: 5 additions & 0 deletions test/series.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,9 @@ describe('series', function() {
});
});

it('should not register a displayName on the returned function by default', function(done) {
var task = taker.series(fn1);
expect(task.displayName).toEqual(undefined);
done();
});
});

0 comments on commit 1ee58b1

Please sign in to comment.