Currently, I am in the process of creating a test suite for a JavaScript widget with Intern.
While I have successfully crafted some pure-JavaScript tests as well as some DOM tests within the page, I've hit a roadblock when it comes to writing functional tests for the Ajax functionality. This part of testing involves communicating with my simple Node.js mock server which has been effective for manual testing purposes.
My specific goals include:
- Launching the Node.js mock server during the setup phase of the test suite
- Shutting down the mock server upon completion of the test
- (Extra credit) Having the capability to analyze the mock server from within my Intern tests, such as verifying the contents of a POST request made to the mock
I'm facing challenges on all three fronts - there is a lack of documentation or example code from Intern on handling the setup and teardown of an external process like a Node.js mock server in the test suite.
My current setup involves using Intern alongside Sauce Labs (which utilizes hosted Selenium). I'm unsure if this issue needs to be resolved solely within Intern or also requires intervention from Sauce Labs. Hopefully, someone who has experience with this can provide guidance.