我正在尝试配置 jasmine maven 插件以使用 require.js 加载 jasmine 规范。
下面是我的maven配置
<plugin>
<groupId>com.github.searls</groupId>
<artifactId>jasmine-maven-plugin</artifactId>
<version>1.1.0</version>
<configuration>
<specRunnerTemplate>REQUIRE_JS</specRunnerTemplate>
<jsSrcDir>${project.basedir}/src/main/webapp/backbone/js</jsSrcDir>
<jsTestSrcDir>${project.basedir}/src/test/javascript/spec</jsTestSrcDir>
<srcDirectoryName>js</srcDirectoryName>
<specDirectoryName>spec</specDirectoryName>
<specIncludes>
<include>*Spec.js</include>
</specIncludes>
<preloadSources>
<source>backbone/js/libs/jquery/jquery.js</source>
<source>backbone/js/libs/require/require.js</source>
<source>backbone/js/libs/underscore/underscore.js</source>
<source>backbone/js/libs/backbone/backbone.js</source>
<source>backbone/js/libs/bootstrap/bootstrap.js</source>
<source>backbone/js/config.js</source>
</preloadSources>
</configuration>
</plugin>
以下是我的茉莉花规格:
define(['models/Specification'], function(Specification) {
describe("Specification", function() {
var specification;
beforeEach(function() {
specification = new Specification();
})
it("thickness set to 4 by default", function () {
expect(specification.thickness).toEqual(4);
});
});
});
下面是javascript文件
define(["backbone"], function ($, _, Backbone) {
return Backbone.Model.extend({
defaults: {
thickness: 4
}
});
});
我收到以下错误:TypeError:无法调用未定义的方法“扩展”
无论如何加载我的 require.js 配置而不是手动加载它们?
任何帮助表示赞赏。
谢谢,拉维