Now I am trying to unit test the a simple Phonegap application. Especially, I want to test the vibration function in this application. This issue is described here.
In the proposed solution, vibration event is written to the Chrome’s log by calling console.log(). In order to write unit test, I want to parse Chrome’s log after that. Is it possible to do that from JavaScript?
In this reference question, the content of log is written to disk first. I also wonder if it is possible to read the log without saving it to disk.
My answer in the referenced question gave you a way to log to the console, but you could replace that logic in the abstraction with anything you want. You can add the vibration events to a dictionary or an array and then process those values later.