-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add unit tests #45
Add unit tests #45
Conversation
Here is a gist that has a working version of the test in it. There were a few changes:
|
We want to kill the process during the test because the functionality that is under test is that the process dies when it is supposed to. |
Then cut and paste that part into the test. It will have a small pause but still work as expected. so you'd remove the after hook, and adapt the test so it looks like this:
|
Some projects use Jest for test coverage and some use the builtin Node.js test runner. The two frameworks accept different CLI options. Allow the calling workflow to customize the CLI options for the test runner. See nasa-gcn/architect-plugin-search#45.
Some projects use Jest for test coverage and some use the builtin Node.js test runner. The two frameworks accept different CLI options. Allow the calling workflow to customize the CLI options for the test runner. See nasa-gcn/architect-plugin-search#45.
fe962ef
to
6675f79
Compare
@Courey, I did as you suggested: I switched from execa to child_process.spawn. That seemed to do the trick. I don't know what the deal is with execa. We've definitely had other problems with it. I also did as you suggested with splitting out the cleanup and teardown code into before and after hooks; it turns out those can contain assertions. It made the code a lot simpler. This is now passing on my Mac, but it's failing in the Windows CI. Did you and @dakota002 ever test your approach on Windows? |
I believe we tested the previous version on Windows.
It looks like it's failing from the actual test suite itself. |
The process is undefined because it couldn't find the executable
@dakota002, help us! |
fc556a4
to
bb78c0f
Compare
Actually, it's working now, even though I'm using execa. Mysterious! |
@Courey, please review. |
No description provided.