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: upgrade @testing-library/react and adjust tests #1949

Merged
merged 5 commits into from Nov 1, 2022

Conversation

miracles1919
Copy link
Collaborator

@miracles1919 miracles1919 commented Nov 1, 2022

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Internationalization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

🔗 Related issue link

💡 Background and solution

  • 升级依赖至最新版 react react-dom react-router @testing-library/*
  • 由于 @testing-library/react-hooks 不在支持 react18,改用 @testing-library/react
  • hook.waitForNextUpdate(这个 api 已经没有了) 替换成 waitfor
  • useEffect 中的报错暂时捕获不到,先注释了
  • 调整了一下测试用例(不然通不过..)

例如

// before
await act(async () => { 
  // ...一堆 export
})

// after 
expert(xxx)
await act(async () => { 
  // ...关键操作
})
expert(xxx)

📝 Changelog

Language Changelog
🇺🇸 English
🇨🇳 Chinese

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • 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

@CLAassistant
Copy link

CLAassistant commented Nov 1, 2022

CLA assistant check
All committers have signed the CLA.

@crazylxr crazylxr merged commit 5bb2f8e into alibaba:master Nov 1, 2022
@miracles1919 miracles1919 deleted the test/react-18 branch November 1, 2022 09:58
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

3 participants