0
我有一个打字稿应用程序已被编译成一个文件,在js文件夹中的myjs.js。我在我的工作区安装了业力茉莉花。如何解决一个“定义未定义”错误时使用编译打字稿茉莉花业测试一个组件?
在myjs.js有代码
var require, define, requirejs;
(function() {compiled typescript code here })();
etc etc etc;
某处我编译打字稿里面是我的茉莉花testscript代码
define('component/to/test', ["dependencies"], function(dependencies){ ... }
,我有,
define([component/to/test], function(component){ jasmine specifications here});
但是,当运行带有karma start的茉莉花文件时,我得到的错误是
define is not defined
我检查了因果报应的配置文件,这两个文件被列为JS/的.js和投机/ .js文件。
任何想法我做错了,这是第一次做这样的事情。
您需要使用AMD兼容加载程序。 –
我该怎么做? – needoriginalname
通过使用AMD加载程序(如RequireJS或Dojo加载程序)。您也可以使用SystemJS加载AMD模块。 –