我是新的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)