I maintain stuff
eps1lon / codemod-missing-await-act Goto Github PK
View Code? Open in Web Editor NEWWIP Adds missing await to act calls (or its callers)
License: MIT License
WIP Adds missing await to act calls (or its callers)
License: MIT License
I maintain stuff
checkboxes.slice(0, 2).forEach((switchEl) => toggleSwitch(switchEl))
^^^^^^^^^^^^ became async
Curried calls:
const renderMock = (Component) => (props) => render(<Component {...props} />)
// missing `await`
const view = renderMock(() => null)({})
Adding an Awaited
when using ReturnType<typeof someNewlyAsyncTestingLibraryMethod>
import { render } from '@testing-library/react';
-let screen: ReturnType<typeof render>;
+let screen: Awaited<ReturnType<typeof render>>;
With a file like
import render from '../render'
render()
and an import config like
import render2 from '../render'
the transform isn't applied but should.
When an exported method changed to async
we need to propagate that.
We'll stick to ESM for now for simplicity. However, the module specifier will be unknown so that requires user input.
Once #6 is done we can directly output the recommended config and prompt the user for the source specifier.
Codebases will have their own wrappers around React Testing Libraries. Once the codemod is applied these wrappers will now also be async which needs to be propagated.
Ideally we could just propagate this through files but that needs a full resolver implementation and building up a fully dependency tree (in memory). It seems better to use an iterative approach to propagating these changes:
rules = ReactTestingLibraryAPIS
while (rules are not empty)
apply codemod with rules
rules = public APIs that just now became `async`
This issue will just add the config option.
e.g.
/Users/sebastian.silbermann/klapp/clients/packages/features/products-and-search/redux-fetch-module/testUtils/index.tsx: Export 'renderWithStore' is now async. Make sure to update the rules of this codemod and run it again.
should link to line and column directly
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.