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

Centralize setup/teardown code in the test suite #82

Open
gaurav opened this issue Mar 7, 2021 · 0 comments
Open

Centralize setup/teardown code in the test suite #82

gaurav opened this issue Mar 7, 2021 · 0 comments

Comments

@gaurav
Copy link
Member

gaurav commented Mar 7, 2021

Currently, different scripts in the test suite handle setup and teardown themselves -- for example, scripts/phyx2owl.js needs to delete all .owl files in the test/examples/correct directory so it can make sure that these are generated correctly by the phyx2owl.js script. Mocha supports global setup fixtures, root hook plugins as well as per-test before()/after() hooks -- we should use one of these to centralize setup/teardown either on a per-file basis (ideal) or on a per-test-suite basis.

One big example of this is in the jphyloref.js script, which needs to download the JPhyloRef JAR file so that it can be used for testing. I wrote a PR to improve the output of this test (PR #80), but this fails because some parallelization issues between the downloader we use and Mocha result in the tests being run before the JAR file has been fully downloaded. A centralized setup script that runs before any Mocha testing begins would solve this problem and make that PR easy to finish.

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

No branches or pull requests

1 participant