Typescript support for jest?
See original GitHub issueAs the title implies, is there typescript support for @react-native-async-storage/async-storage
?
I figured in other discussions that the @types
should be the same as the original react-native
async-storage or the predecessor react-native-community
async-storage. However, I don’t know how to implement the previous types on this module.
Instructions would be appreciated!
Could not find a declaration file for module '@react-native-async-storage/async-storage/jest/async-storage-mock'
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (3 by maintainers)
Top Results From Across the Web
Getting Started - Jest
Jest supports TypeScript, via Babel. First, make sure you followed the instructions on using Babel above. Next, install the @babel/preset- ...
Read more >Testing TypeScript apps using Jest - LogRocket Blog
Jest is a simple, lightweight testing framework that provides a variety of testing capabilities to JavaScript and TypeScript projects. It ...
Read more >Jest - TypeScript Deep Dive - Gitbook
That said, jest is an excellent unit testing option which provides great TypeScript support. Note: We assume you start off with a simple...
Read more >Setting up a project with jest in TypeScript. - ITNEXT
ts-jest is a TypeScript preprocessor for jest , that lets you use jest to test projects written in TypeScript. But first we need...
Read more >How to configure Jest with TypeScript | Swizec Teller
Configure TypeScript The key parts are: "types": ["node", "jest"] , tells TypeScript to assume node and jest types are globally available. Make ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m having the same issue here with the import. Although I’m able to import
import AsyncStorage from "@react-native-async-storage/async-storage"
, I get a type error when importingimport mockAsyncStorage from '@react-native-async-storage/async-storage/jest/async-storage-mock'
Typescript issue comes from the fact that the mock is not declared in our typings. In that case, I advise to use Jest setup file to mock AsyncStorage