Closed CaptainOfPhB closed 2 years ago
please review code @i5ting @Pana
1、tap测试是没有问题 2、test-console用起来没有coffee用的直观 3、可以把sinon引入,理解一下spies,stubs,mocks,测试用例代码看着可读性还需要提升。
功能是类似的,可读性上是有差异的。另外我理解coffee对跨平台做了很多兼容。
tap的mock功能我还没看到,https://github.com/tapjs/node-tap/blob/main/package.json#L22依赖有点多。
先合并,一点点优化吧
OK,谢狼叔指点。
This is a Work In Progress merge request, CAN NOT merge directly now.
Motivation
When I tried to add some test cases for
cli.js
, I found some test cases will run fail for some reason, for example,npm.config.get('registry')
will get a wrong registry(https://registry.yarnpkg.com/
) sometimes, I am sure about that the registry(https://registry.yarnpkg.com/
) does not exist in any related configuration file.In addition, use
npm
lib to write.npmrc
file is unnecessary,fs.writeFileSync
is enough. And the programmatic API was removed innpm
from v8.0.0, as we can see inindex.js
, so, thevar npm = require('npm')
usage is not recommended and already has been deprecated.I will do
npm
dependencyrequest
withnode-fetch