mocha-phantomjs을 사용하여 테스트를 실행 중입니다.mocha-phatomJS로 리소스 처리를 구성하는 방법은 무엇입니까? 리소스 파일로드 오류 :
단위 테스트를 실행하는 동안 http 서버가 실행되지 않아 내 리소스가 절대 URL (예 : /static/images/face.png)을 통해 제공되지 않고 출력이 다음과 같이 표시됩니다.
% node_modules/mocha-phantomjs/bin/mocha-phantomjs test/runner/runner.html
test app.Main
✓ should show a command line
1 test complete (79 ms)
Error loading resource file:///static/images/face.png (203). Details: Error opening /static/images/face.png: No such file or directory
내 시험 :
이describe "test app.Main", ->
beforeEach ->
@app = App.Main()
React.renderComponent @app, root[0]
afterEach -> React.unmountComponentAtNode root[0]
it "should show a command line", ->
@cmdForm = root.find("div.header-block").first().find('form')
expect(@cmdForm.length).to.equal 1
expect(@cmdForm.find('div.select2-container ul.select2-choices').length).equal 1
시험은 성공하지만, 그 동안 나는이 추한 오류 메시지가 있습니다. phantomJS (또는 mocha?)가 해당 리소스로드를 무시하도록 구성하거나이 오류 메시지를 표시하지 않는 방법은 무엇입니까?
이것은 예외 (테스트 통과)는 아니지만 phantomJS의 오류 로그입니다. –