어떤 이유로 프로그램의 xml 출력을 파일이나 다른 곳으로 리디렉션 할 수 없습니다. 명령은 다음과 같습니다.
node $mocha --reporter xunit $testScript
<testsuite name="Mocha Tests" tests="40" failures="0" errors="0" skipped="0" timestamp="Wed, 16 Oct 2013 11:03:28 GMT" t
ime="0.664">
<testcase classname="Testing preview" name="preview index is set to correct value" time="0.007"/>
...
그러나 파일에 저장하려면 아무것도 작동하지 않습니다. 첫 번째 줄만 저장됩니다. 다음을 시도했습니다.
node $mocha --reporter xunit $testScript >result.xml
node $mocha --reporter xunit $testScript | tee result.xml
node $mocha --reporter xunit $testScript | out-file result.xml
node $mocha --reporter xunit $testScript | out-string result.xml
node $mocha --reporter xunit $testScript | set-content result.xml
node $mocha --reporter xunit $testScript | add-content result.xml
iex(node ...) | out-string results.xml
$res = node $mocha --reporter xunit $testScript
위의 각 경우에는 첫 번째 줄만 저장됩니다.
내가 찾은 유일한 해결책은 다음과 같습니다.
cmd /c "node "$mocha" --reporter xunit "$testScript" > result.xml"
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다