0
對於我目前的項目,我正在用Jasmine設置JS測試。我們希望我們的測試能夠在每個構建中自動運行,因此我將其插入到Maven構建中。我可以運行Javascript的一些基本測試,並且一切都很好用。到現在爲止還挺好!然而,我們正在構建一個富客戶端接口,並且對服務器進行了大量回調 - 因此,我們的代碼中有很多$ .ajax調用。每當我嘗試加載包含撥打我們的JS文件(不執行測試,加工甚至沒有到那一步),Maven構建崩潰每次,因爲它試圖做已經回調:用Jasmine-Maven測試AJAX調用
[ERROR] Caused by: java.io.FileNotFoundException: F:\Users\gjoris\Development\Source\xxx\xxx-war\target\jasmine\rest\xxx\search (The system cannot find the path specified)
所以,只是爲了說清楚:我是而不是在這裏運行測試,我只是加載源代碼。這是我的插件thusfar配置:
<plugin>
<groupId>com.github.searls</groupId>
<artifactId>jasmine-maven-plugin</artifactId>
<version>1.2.0.0</version>
<extensions>true</extensions>
<executions>
<execution>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
<configuration>
<sourceIncludes>
<include>sorting*.js</include>
<include>*blabla*.js</include>
</sourceIncludes>
<jsSrcDir>${project.basedir}/src/main/webapp/resources/scripts/</jsSrcDir>
<jsTestSrcDir>${project.basedir}/src/test/javascript</jsTestSrcDir>
<timeout>300</timeout>
<preloadSources>
<!-- Load basic libraries for application-->
<source>${project.basedir}/src/main/webapp/resources/scripts/libs/knockout-2.1.0.js</source>
<source>${project.basedir}/src/main/webapp/resources/scripts/libs/jquery-1.7.2.min.js</source>
<!-- Load all necessary Jasmine plugins -->
<source>${project.basedir}/src/test/javascript/libs/jasmine-ajax/mock-ajax.js</source>
<source>${project.basedir}/src/test/javascript/libs/jasmine-jquery/jasmine-jquery.js</source>
<!-- Load our own mocks -->
(some of our mocks in JS go here)
<!-- Load additional libraries, application specific, which are needed to run -->
(some general JS, which are used everywhere)
</preloadSources>
</configuration>
</plugin>
任何人任何這方面的經驗,知道我怎麼也得配置呢?