Skip to content

Conversation

@novemberborn
Copy link
Member

Fixes #622.

Catch exceptions when initially running files. Don't run any tests, just report the exception.

Move test teardown into a callback for the run promise so it can be used when --match is used but there are no matches, and when exceptions occur while initially running files.

Teardown causes the test promise to reject, which leads to an attempt to run the tests. Add a guard to prevent this.

Catch exceptions when initially running files. Don't run any tests, just report
the exception.

Move test teardown into a callback for the run promise so it can be used when
--match is used but there are no matches, and when exceptions occur while
initially running files.

Teardown causes the test promise to reject, which leads to an attempt to run
the tests. Add a guard to prevent this.

Fixes #622.
@mention-bot
Copy link

By analyzing the blame information on this pull request, we identified @sotojuan, @ariporad and @spudly to be potential reviewers

// receive test count from all files and then run the tests
var unreportedFiles = self.fileCount;

var tests = new Array(self.fileCount);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you explain why is array of N (self.fileCount) null elements needed?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It gets filled with promises for run results here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea. I'm just preallocating it to the right size.

@sindresorhus
Copy link
Member

LGTM

@jamestalmage
Copy link
Contributor

👍

sindresorhus added a commit that referenced this pull request Mar 10, 2016
Don't crash watch mode when tests files fail to transpile
@sindresorhus sindresorhus merged commit e810ed4 into master Mar 10, 2016
@sindresorhus sindresorhus deleted the watch-and-syntax-errors branch March 10, 2016 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants