Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added deferred execution support #719

Closed
wants to merge 1 commit into from
Closed

Conversation

tarruda
Copy link

@tarruda tarruda commented Jan 16, 2013

This should solve issue #362.

A global 'wait' function is added so the test files can pause mocha processing and generate
tests asynchronously. The function returns a semaphore with a single method 'resume' to continue processing test files.

@tarruda
Copy link
Author

tarruda commented Jan 16, 2013

Not sure why it reports build failure. Locally all tests pass for me.

@tarruda
Copy link
Author

tarruda commented Jan 17, 2013

Turns out I was running 'make test' instead of 'make test-all'. The last commit introduces a few changes to the Runner class but fixed what was broken in the previous commit.

This function signals mocha to pause processing files while tests are
generated asynchronously.

For this to work, a few changes were required in the Mocha and Runner classes:

- In the Mocha class, the 'loadFiles' method was refactored to work
  asynchonously.
- In the Runner class, the globals initialization was moved out of the
  constructor into a new method: 'initDefaultGlobals'. This method needs
  to be invoked prior to running the tests, so the runner will take a
  'snapshot' of the global properties.

This commit should also solve issue mochajs#362
@camshaft
Copy link

👍

@jbnicolai
Copy link

@tarruda, sorry for the long silence on this. I appreciate the effort, but believe this is no longer of interest to Mocha.

If you feel this PR is still relevant, feel free to comment :-)

@jbnicolai jbnicolai closed this Sep 7, 2014
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.

3 participants