标签: karma-qunit

使用Karma与SystemJS,gulp和TypeScript时出错

我是新的node.js堆栈之类npm,gulp等等.我之前编写了一些JavaScript单元测试用例,现在想Karma用作测试运行器.然而,经过几次尝试后,我现在完全迷失了.

首先,我有以下项目配置:

  • SystemJS 作为模块加载器.
  • 文件夹结构(为简洁起见,省略了一些):

    project
    |
    |--build //contains all gulp tasks
    |
    |--dist //contains the output (*.html, *.js etc.)
    |
    |--jspm_packages 
    |
    |--node_modules
    |
    |--src //contains the source .html, and *.ts
    |
    |--tests //contains unit tests in *.ts. I also have a gulp task to build tests/**/*.ts to *.js in the same folder.
    |
    |--typings //contains type definitions
    |
    |--config.js //contains SystemJS configuration
    |
    |--karma.conf.js
    
    Run Code Online (Sandbox Code Playgroud)
  • karma.conf.js

    // Karma configuration        
    
    module.exports = …
    Run Code Online (Sandbox Code Playgroud)

typescript karma-runner gulp-karma systemjs karma-qunit

5
推荐指数
0
解决办法
659
查看次数