node-modules / mm

An simple but flexible mock(or say stub) package, mock mate
Other
158 stars 16 forks source link

fix: types error #43

Closed whxaxes closed 5 years ago

whxaxes commented 5 years ago

修复这个问题:https://github.com/node-modules/mm/commit/6a84a0a9c01a8e68e08eb63b4d587b73cb8fd74a#r30293552

之前在 https://github.com/eggjs/egg-mock/pull/81#issuecomment-411335563 中提议让 @paranoidjk 改成了基于 interface 的模式,在本机中验证时忘记项目中设置了 skipLibCheck ( 设置了这个会忽略报错 ),但是其实这么写声明是有问题的,ts 是不允许使用 exports = 的同时也使用 esmodule 的 export。

现在还是改回传统的 namespace 模式,不过可以在 namespace 中 export 一个 MockMate 的 type,而在 ts 2.2 版本之后,interface 是可以 extend type 的,所以对于 egg-mock 是没影响。

whxaxes commented 5 years ago

cc @atian25 @paranoidjk @fengmk2

codecov[bot] commented 5 years ago

Codecov Report

Merging #43 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #43   +/-   ##
=======================================
  Coverage   97.75%   97.75%           
=======================================
  Files           3        3           
  Lines         267      267           
=======================================
  Hits          261      261           
  Misses          6        6

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 860f728...22a9b9f. Read the comment docs.

czy88840616 commented 5 years ago

我们刚想提MR。。 cc @GuangWong

fengmk2 commented 5 years ago

@atian25 owner 加你了,你来合并发布。

atian25 commented 5 years ago

2.4.1