运行vscode扩展单元测试

时间:2020-04-01 08:07:12

标签: javascript node.js typescript mocha vscode-extensions

我已经使用以下配置基于打字稿创建了vscode扩展

测试路径为

vscode_extensions / my-ext / src / test / runTest.ts:1

**The error is:**

import * as path from "path";
       ^

SyntaxError: Unexpected token *

tsconfig是

{
  "compilerOptions": {
    "module": "commonjs",
    "target": "es6",
    "outDir": "out",
    "lib": ["es6"],
    "sourceMap": true,
    "rootDir": "src"
    // "esModuleInterop": true
    // "strict": true /* enable all strict type-checking options */
  },
  "exclude": ["node_modules", ".vscode-test"]
}

有什么主意吗?

奇怪的是,我能够运行扩展并对其进行调试,但无法执行某些基本摩卡单元测试。

我尝试使用nvm(节点13)切换到较新的节点版本,但未成功

因为这对我来说是新事物,所以在JS中进行摩卡测试也许会错过一些东西...

0 个答案:

没有答案
相关问题