Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Includes a few improvements to the Mocha testing set up.
95b5896 adds a convenience method for running a specific test.
39ab10c improves the console output when running karma/browserstack tests.
a8c8dae ensures that test app tear down happens after running any selection of tests.
f4acdda adds a prettier config - this was because when I was working on 106a117 I was getting a lot of annoying whitespace changes. I figured it would be better to take an opinionated approach so that these kinds of conflicts don't happen again in future. In a separate branch in future I hope to run prettier against all of our source code and add a CI check to make sure that all future code is compliant, but that was beyond the scope of this PR so I just used it on the spec/*.test.js files.
106a117 is a massive commit (sorry) which fundamentally changes the approach to async testing in mocha and refactors all of the test fixtures to use the mocha API directly. I couldn't find a reasonable way to split this in to multiple tests since most of the tests depend on helper methods which also needed to be changed, which in turn broke other tests, etc. Before we were using an assertion counter which seemed to occasionally fail tests due to some race condition. This commit changes the async tests to control when the test is complete by keeping tests open until
done
is called, and using lots oftry/catch
statements to try and catch errors and calldone
with those errors (causes the test to fail). This seems to have made the tests less flaky and means that they now usually fail with descriptive error messages (where before they would wait 60s and then fail with a timeout error).63e0d5f is a workaround due to actions/setup-node#214