1
在我的package.json中的腳本目前看起來是這樣的:運行伊斯坦布爾的測試覆蓋率通過shell腳本包裝節點模塊
"scripts": {
"test": "./spec/run-local-tests.sh",
"coverage": "istanbul cover jasmine-node spec",
"start": "gulp"
}
測試腳本運行此sh文件:
#!/bin/sh
echo "Renaming database file produced by previous test run"
mv -f 'shared-local-instance.db' 'shared-local-instance.db.previous'
echo "Starting DynamoDB"
java -Djava.library.path=./DynamoDBLocal_lib -jar dynamodb/DynamoDBLocal.jar -sharedDb &
export JAVA_PID=$!
echo "Running Tests"
./node_modules/jasmine-node/bin/jasmine-node spec
echo "Cleaning up DynamoDB - killing local instance"
kill -9 $JAVA_PID
然而現在我想改變我的coverage
腳本運行shell文件:
"coverage": "istanbul cover ./spec/run-local-tests.sh"
但後來我得到一個錯誤說:
echo "Renaming database file produced by previous test run"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Unexpected string
有沒有辦法,我能得到instanbul和我的shell文件來運行?
很好的答案!謝謝!附:我已經閱讀了文檔,並知道istanbul運行節點腳本,我只是想幫助搞清楚如何運行我的shell腳本(我是編寫shell腳本的新手)。再次感謝您的答案! – Ruth