popomore / projj

Manage repository easily.
MIT License
266 stars 40 forks source link

feat: change dir when config change_directory true and platform is darwin #34

Closed DiamondYuan closed 5 years ago

DiamondYuan commented 5 years ago

因为老版本 coffee 不支持插入 script,所以就升级到了最新版。 升级 coffee 后测试覆盖率无法收集,所以升级了 egg-bin。

DiamondYuan commented 5 years ago

@popomore 写完了。 似乎需要手动重新跑一下测试。

codecov[bot] commented 5 years ago

Codecov Report

Merging #34 into master will increase coverage by 0.39%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #34      +/-   ##
==========================================
+ Coverage   99.22%   99.61%   +0.39%     
==========================================
  Files          11       11              
  Lines         257      259       +2     
==========================================
+ Hits          255      258       +3     
+ Misses          2        1       -1
Impacted Files Coverage Δ
lib/command/find.js 100% <100%> (+3.44%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 0e199fb...9d1a908. Read the comment docs.

DiamondYuan commented 5 years ago

@popomore 测试覆盖率收集不正确的原因是 test/fixtures/find-change-directory/mock_darwin.js 里面的 mock

mm(FindCommand.prototype, 'runScript', function* (cmd) {
  console.log(cmd);
}); 
popomore commented 5 years ago

测试覆盖率收集不正确的原因是 test/fixtures/find-change-directory/mock_darwin.js 里面的 mock

那应该只影响一个用例?

DiamondYuan commented 5 years ago

测试覆盖率收集不正确的原因是 test/fixtures/find-change-directory/mock_darwin.js 里面的 mock

那应该只影响一个用例?

刚才有问题是 coffee 的问题,已经修好了。 目前唯一问题就是不知道为什么 find 里面的一些函数没有覆盖到。估计是是 mock 了runScript 的原因。

DiamondYuan commented 5 years ago

@popomore 因为 mock 了 yield this.runScript(script); 导致 if (process.platform === 'darwin') 内的代码无法收集测试覆盖率,虽然测试代码已经覆盖到了。

加了两个 istanbul ignore next

popomore commented 5 years ago

2018-12-18 6 30 15

看起来挂了

popomore commented 5 years ago

我先回滚了

popomore commented 5 years ago

我试了下应该是 iterm 没装,那句话就报错了

DiamondYuan commented 5 years ago

抱歉,没看到邮件。 搜了一下发现 AppleScript 在编译时候就会确认 app 是否存在,如果不存在则报语法错误。 还在研究怎么避免。