Tag: typescript phantomjs

Karmatesting,PhantomJS错误:无法find模块'事件'

我正在使用TypeScript编写一个Node.js项目。 编译是使用tsc完成的,我没有使用像Gulp或Grunt这样的任务运行。 我会尽可能简洁,但如果需要更多的细节,我会很乐意提供。 我有以下class级: // Foo.ts import { EventEmitter } from 'events'; export class Foo extends EventEmitter { //… } 当我尝试使用茉莉花与Karma和PhantomJStesting,我得到以下错误: Error: Could not find module 'events' from '(…)/foo.js' 。 对我来说,PhantomJS似乎不知道从何处获取events模块。 我的karma.conf.js看起来如下所示: var createCoverageReport = false; module.exports = function(config) { config.set({ // base path that will be used to resolve all patterns (eg. files, exclude) […]