jakejs / jake

JavaScript build tool, similar to Make or Rake. Built to work with Node.js.
http://jakejs.com
Apache License 2.0
1.97k stars 190 forks source link

Repeating the same task doesn't work. #369

Closed elonmitchell closed 4 years ago

elonmitchell commented 4 years ago

After upgraded from 8.1.1 to 10.4.5, the jake.Task#execute() doesn't run the task again in my BDD test. These are the cucumber and step definitions that will trigger running the reenable task.

reminder.feature

  Scenario Outline: Email reminder does not work on the wrong days
    When <days> days pass
    And the "email:reminder" task runs
    And jobs run
    Then joy@example.com should not have sent the reminder event to mailer
    Examples:
      | days |
      | 9       |
      | 11      |

step definition

Given /^the "([^"]*)" task runs$/, (task_name, next) ->
  task = jake.Task[task_name]
  expect(task, "Jake Task - #{task_name}").to.exist
  task.once 'complete', (result) ->
    console.log result
    next()
  task.execute()
  null

email.jake.coffee

namespace 'email', ->
  desc 'Queue create reminder emails'
  task 'reminder', ['prior_task'], async: true, ->
    task_action complete

While looking into the lib, I found this weird code... https://github.com/jakejs/jake/blob/863750c17e388f6ed75d62d551da3fcdf4be83be/lib/task/task.js#L377

@mde this._skippped should be this._skipped?

If it won't affect to the issue above, any idea to resolve it out?

(As I checked the other lower versions, https://www.npmjs.com/package/jake/v/10.0.3 worked with the repeated task, but not working since https://www.npmjs.com/package/jake/v/10.0.6)

elonmitchell commented 4 years ago

The issue now fixed and merged in the master.