VSCode扩展程序测试运行器,用于jest。

8

1
你是找到了什么还是自己构建的? - fabianmoronzirfas
1
我找到了一个有可用代码的项目:https://github.com/rozzzly/vscode-prompt-debug/tree/master/test。 - user1795832
1个回答

0

目前还没有官方的,您需要自己创建。

Igor Soloydenko在去年(2019)写了一份关于如何创建的指南:

https://medium.com/@soloydenko/end-to-end-testing-vs-code-extensions-via-jest-828e5edfeb75

伪代码:

const jestTestRunnerForVSCodeE2E: ITestRunner = {
  run(testsRoot: string, clb: (error: Error, failures?: number) => void): void {
    try {
      const result = runJestTests(configuration);
      if (result.executionError) {
        clb(result.executionError);
      } else {
        clb(undefined, result.numberOfFailedTests);
      }
    } catch (e) {
      clb(e);
    }
  }
};

module.exports = jestTestRunnerForVSCodeE2E;

当然还有@user1795832提供的链接:https://github.com/rozzzly/vscode-prompt-debug/tree/master/test

该链接中的代码最后更新于2018年5月,所以不确定它是否仍然有效。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接