用CoffeeScript编写的测试来进行开玩笑的代码覆盖

Lon*_*ick 5 code-coverage coffeescript jestjs

有没有一种方法可以对用CoffeeScript编写的单元测试运行Jest coverage工具?覆盖率报告始终告诉我100%的覆盖率。

jest --coverage

----------|----------|----------|----------|----------|----------------|
File      |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
----------|----------|----------|----------|----------|----------------|
----------|----------|----------|----------|----------|----------------|
All files |      100 |      100 |      100 |      100 |                |
----------|----------|----------|----------|----------|----------------|
Run Code Online (Sandbox Code Playgroud)

我已经使用以下Jest预处理程序将CoffeeScript转换为JavaScript

var coffee = require('coffee-script');

module.exports = {
  // CoffeeScript files can be .coffee or .litcoffee
  process: function(src, path) {
    if (coffee.helpers.isCoffee(path)) {
      return coffee.compile(src, {
        bare: true,
        literate: coffee.helpers.isLiterate(path)
      });
    }
    return src;
  }
};
Run Code Online (Sandbox Code Playgroud)