liip / TheA11yMachine

The A11y Machine is an automated accessibility testing tool which crawls and tests pages of any web application to produce detailed reports.
https://www.liip.ch/
622 stars 66 forks source link

CLI: Fix exit codes #37

Closed Hywan closed 8 years ago

Hywan commented 8 years ago

We call queue.kill to stop the test queue. Unfortunately, this removes the drain function. We previously used it to properly exit the process. So, instead, we wrap the onTaskComplete callback inside a new onTaskComplete callback. This latter adds the process.exit code in case errors have occured.

We do that this way because it must run after the last report has been written. Keep in mind that everything is asynchronous.