How to get text from alertbox in spectron


I am trying to get alert text as part of my test.
Can some one guide me what is wrong in the code.



As discussed with webdriverio community its difficult to handle default alert() function and they suggested to implement my own alertbox. So using I implemented my own l alert and test is working fine