【发布时间】:2020-07-12 22:15:04
【问题描述】:
我已经基于 typescript 使用以下配置创建了 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"]
}
有什么想法吗?
奇怪的是,我能够运行扩展程序并对其进行调试,但无法执行一些 basic mocha 单元测试。
我尝试使用 nvm(节点 13)切换到较新的节点版本,但没有成功
因为这对我来说是新的,所以 js 中的 mocha 测试也许我错过了一些东西......
【问题讨论】:
标签: javascript node.js typescript mocha.js vscode-extensions