我有一個失敗的單元測試,我正在寫一個自定義茉莉花記者,這將需要我從它提供的堆棧跟蹤中獲取文件的名稱。從堆棧跟蹤獲取文件名
Verify the most recent consumer review is showing all information. (0.683 sec) - Expected true to be false, 'test title'. at Object.<anonymous> (/Users/xyz/Documents/tests/somefolder/xyz.test.js:25:72) at /Users/xyz/Documents/node_modules/jasminewd2/index.js:96:23 at new Promise (/Users/xyz/Documentsc/node_modules/selenium-webdriver/lib/promise.js:1043:7.....
什麼是剛剛從上面獲取文件xyz.test.js
名的最好方法?
的可能重複[我怎樣才能得到一個Javascript堆棧跟蹤,當我拋出一個異常?( http://stackoverflow.com/questions/591857/how-can-i-get-a-javascript-stack-trace-when-i-throw-an-exception) –