Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • G gulp
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 24
    • Issues 24
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 3
    • Merge requests 3
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gulp
  • gulp
  • Merge requests
  • !1818

Adds failing test for inheriting gulp.task from Orchestrator.add

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/danjm/master into master Sep 24, 2016
  • Overview 1
  • Commits 1
  • Pipelines 0
  • Changes 1

Created by: danjm

On line 14 of index.js, the task method on Gulp's prototype is set to the Gulp.prototype.add, which is inherited from Orchestrator.

14 Gulp.prototype.task = Gulp.prototype.add;

This ensures that a call to Gulp's task() is a direct call to Orchestrator's add(), and inheritance with Orchestrator's task() is no more. One effect of this is that a task() call with only a name param (and no dep or fn) will set the dep and fn properties of the task with the given name to default empty-ish values (i.e. empty array and noop)

However, this code is untested. Indeed, if line 14 is removed, all of Gulp's tests still pass. Because orchestrator's task() calls Orchestrator's add(), it is not immediately office why this line 14 is even necessary.

To avoid confusion in that matter and guard against regressions, this PR adds a test that fails if line 14 is removed. It does so by checking that only the default functionality of Orchestrator's add()', and not Orchestrator'stask()', is executed when there is only one truthy param (the name param) passed to gulp.task

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/danjm/master