本文介紹了是否可以從命令行運行 JavaScript 文件?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
我有幾個 JS 文件,所以我不想在控制臺窗口(Firefox 和 Chromium)中復制和粘貼每個文件,如果可能的話,我想從 shell 調用它們.
I have several JS files so instead of copy and paste every one in the console window (Firefox and Chromium), I would want to call them from the shell if it is possible.
每個 JS 文件都有測試函數,使用 console.log 顯示它們是否正確.
Every JS file has test functions that show if they are correct using console.log.
推薦答案
如果您的測試需要訪問 DOM,那么總是有 PhantomJS - 無頭 (Webkit) 瀏覽器.
If your tests need access to a DOM there is always PhantomJS - a headless (Webkit) browser.
這篇關于是否可以從命令行運行 JavaScript 文件?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!