Answer the question
In order to leave comments, you need to log in
Mocha, chai. How to run tests with prompt?
I master javascript and write tests for tasks in one, I get used to it.
Often in tasks you need to take data from the user, now the question is how to emulate the damn prompt?
now I have a function lying around in a file with tests
let defPrompt = prompt;
prompt = function(returnValue) {
return returnValue;
}
Answer the question
In order to leave comments, you need to log in
Better use selenium or a headless browser.
https://pptr.dev/#?product=Puppeteer&version=v1.7....
https://habr.com/ru/company/oleg-bunin/blog/421137/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question