So I’m trying to make a series of unit tests for a project in class. Unfortunately I can’t copy a lot of code due to plagiarism issues. So I’ll try to explain the problem. We are running unit tests using Mocha and Chai on a calculator app and I’m not sure how to test the functions. They use form.display.value in the functions to get user input from the calculator buttons being pressed but I’m having issues taking the input and using it in my test cases.
I wanted to try to use document.myForm.name_of_form but I now realize you cannot access the document in command line unit testing/with node. So I’m not quite sure how to access that form.display.value data from the calculator functions to run tests. Sorry if this is not enough info but if anybody has any ideas, would love some help!
Thank you!