我已经创建了一个项目vscode-extension,但是我在调试时遇到了问题。我有/index.js的字符串,但没有像c:/xx/xx/index.js这样的带有__filename或__dirname全局变量的完整路径字符串。如何在nodejs中获取完整路径? This is the project OS:Windows 10vscode:1.33.1 console.log(__filename); // /index.jsconsole.log(process.cwd()); // c:/U
我尝试在Node.js中使用Sinon和Mocha模拟我的数据库进行测试。sinon = require('sinon'); var db = sinon.mock');但我一直收到以下错误:TypeError: Attempted to wrap undefined property execute as function
我假设这是在模仿类,而不是数据