我正在尝试将 jasmine 集成到我的 maven 项目中,但我总是收到此错误:ReferenceError: "define" is not defined。
我有一个简单的测试:
define("activerequests", function(example) {
describe("activerequests", function() {
it("should return active requestss", function() {
expect(getActiveRequests).toBe(false);
});
});
});
我的 pom 看起来像这样:
<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>
<jsSrcDir>src/main/webapp/</jsSrcDir>
<haltOnFailure>false</haltOnFailure>
<sourceIncludes>
<include>services/jquery/jquery.js</include>
<include>services/jquery-mobile/jquery-mobile.js</include>
</sourceIncludes>
<jsTestSrcDir>src/test/javascript/jasmine/spec</jsTestSrcDir> <!-- Define your Test source Dir -->
<haltOnFailure>true</haltOnFailure>
<browserVersion>FIREFOX_3</browserVersion>
<serverPort>8234</serverPort>
<specDirectoryName>specs</specDirectoryName>
<specIncludes>
<include>test.js</include>
</specIncludes>
</configuration>
</plugin>
我被困住了。
你能帮助我吗?