MinimaLT | WIP implementation of a variant of the MinimaLT protocol
kandi X-RAY | MinimaLT Summary
kandi X-RAY | MinimaLT Summary
This contains my WIP implementation of a variant of the MinimaLT protocol
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of MinimaLT
MinimaLT Key Features
MinimaLT Examples and Code Snippets
Community Discussions
Trending Discussions on MinimaLT
QUESTION
I want to test that a BootstrapVue table is rendered correctly based on the data provided by an API. As part of this, I've mocked the fetch
function. When I provide the data statically using the loadItems()
method, it works fine - 3 rows are rendered. But when I instead swap it to using the API calling method getData()
- the rows aren't rendered.
The mocking of fetch
appears to work as the API response is logged successfully, but it doesn't seem to make it to the data option of the Vue component.
The Vue component to test:
...ANSWER
Answered 2021-Apr-12 at 21:46It seems you're expecting Jest to automatically await the Promise
s, but you actually have to do that explicitly. You can wait until the next macro tick when the fetch
's Promise
s resolve by awaiting a setTimeout()
without a specified delay:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install MinimaLT
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page