Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(Anchor): optimize dataNowMockFn, avoid being consumed in advance #18663

Merged
merged 7 commits into from Sep 5, 2019
Merged

test(Anchor): optimize dataNowMockFn, avoid being consumed in advance #18663

merged 7 commits into from Sep 5, 2019

Conversation

shaodahong
Copy link
Member

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / document update
  • Component style update
  • TypeScript definition update
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

🔗 Related issue link

#17827

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English optimize dataNowMockFn, Avoid being consumed in advance
🇨🇳 Chinese 优化 dataNowMockFn, 避免被提前消费

☑️ Self Check before Merge

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

Copy link

@tests-checker tests-checker bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add tests to make sure this change works as expected?

@netlify
Copy link

netlify bot commented Sep 4, 2019

Deploy preview for ant-design ready!

Built with commit da5c01b

https://deploy-preview-18663--ant-design.netlify.com

@shaodahong
Copy link
Member Author

shaodahong commented Sep 4, 2019

@afc163 @zombieJ 我换了下 circleci 的 docker image,然后跑的测试,看起来像是没问题的

    ✓ Anchor targetOffset prop (11ms)

circleci/node:latest 这个版本是不是 latest lts 比较好

@afc163
Copy link
Member

afc163 commented Sep 4, 2019

circleci/node:latest 这个版本是不是 latest lts 比较好

对的,改之。

@shaodahong
Copy link
Member Author

看了下 node 版本是 10.16.3 但是现在报的其它一些错

@shaodahong
Copy link
Member Author

shaodahong commented Sep 4, 2019

这个测试错误看起来像是 facebook/react#12214 (comment) 命名导出的问题,没发现 node 新的版本对导出有什么限制更新

@zombieJ
Copy link
Member

zombieJ commented Sep 4, 2019

合一下 master, 下午 fix 了 React.createElement: type is invalid 相关的错误,估计是同一个。

@codecov
Copy link

codecov bot commented Sep 4, 2019

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #18663   +/-   ##
=======================================
  Coverage   96.74%   96.74%           
=======================================
  Files         281      281           
  Lines        7551     7551           
  Branches     2106     2106           
=======================================
  Hits         7305     7305           
  Misses        244      244           
  Partials        2        2

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 bf374da...da5c01b. Read the comment docs.

@shaodahong
Copy link
Member Author

合一下 master, 下午 fix 了 React.createElement: type is invalid 相关的错误,估计是同一个。

还是不行

@shaodahong
Copy link
Member Author

我本地试了下是有问题

 FAIL  components/list/__tests__/demo.test.js (11.789s)
  ● renders ./components/list/demo/basic.md correctly

    ReferenceError: window is not defined

      at node_modules/ismobilejs/dist/isMobile.min.js:1:1292
      at Object.<anonymous> (node_modules/ismobilejs/dist/isMobile.min.js:1:1314)
      at Object.<anonymous> (node_modules/rc-menu/lib/util.js:17:16)

@daqi
Copy link

daqi commented Sep 4, 2019

@shaodahong 正好赶上我们发布上线,服务端渲染也报这个错误

@shaodahong
Copy link
Member Author

嗯,isMobile 库用了 window,其实我奇怪的是为什么之前 node:8 的测试是没有问题的,emm……

@shaodahong
Copy link
Member Author

shaodahong commented Sep 4, 2019

@afc163 我建议学下 jest 的 CI 把主流的 node 版本都加进去

@shaodahong
Copy link
Member Author

shaodahong commented Sep 4, 2019

  • 支持主流 Node 版本 CI
  • 修复 React.createElement: type is invalid 相关报错
  • 修复部分组件 Demo Test 中 undefined 错误(暂时没找到原因)

@zombieJ
Copy link
Member

zombieJ commented Sep 5, 2019

重装一下,rc-menu 的 is mobile 降级发了个 patch

@afc163
Copy link
Member

afc163 commented Sep 5, 2019

@afc163 我建议学下 jest 的 CI 把主流的 node 版本都加进去

没啥必要,jest 是 node 端的工具,兼容不同 node 版本很重要。我们是 UI 库,node 环境保证自用就行,测试的是浏览器环境。

@shaodahong
Copy link
Member Author

好的,那看来是没问题了

@afc163 afc163 merged commit d9bfc68 into ant-design:master Sep 5, 2019
@shaodahong shaodahong deleted the fix/anchor-test-suite branch September 5, 2019 03:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants