> ## Content Index
> Fetch the complete content index at: https://lucas-schiavini.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Daily Dispatch 28 - Jesting
- URL: https://lucas-schiavini.com/daily-dispatch-28-jesting/
- Published: 2022-06-16T13:07:00.000Z
- Updated: 2022-06-17T13:10:39.000Z
- Author: Lucas Schiavini
- Tags: jest, react, #Import 2026-08-11 14:49

Hey it’s me again, so I’ve been learning how to work with [Jest](https://jestjs.io/?ref=lucas-schiavini.com), one testing library used by some [React](https://reactjs.org/?ref=lucas-schiavini.com) projects.

Here are my thoughts:

- Compared to other testing libraries like [JUnit](https://junit.org/junit5/?ref=lucas-schiavini.com) or [Kotlin’s test](https://kotlinlang.org/api/latest/kotlin.test/?ref=lucas-schiavini.com), I saw it as a bit less organized.
- I still don’t know why exactly I felt that way.

Some errors:

- mockImplementationOnce is not a functionJest at:

     it('loads initial data', async () => {
       const getPrismicClientMocked = mocked(createPrismicClient)  
       const clientMocked = {
          query: jest.fn().mockResolvedValueOnce({
              results: [
                  {
                    uid: 'my-new-post',
                    data: {
                        content: [
                         {type: 'heading1', text: 'My new post'},
                         {type: 'paragraph', text: 'Post excerpt'}
                        ]
                    },
                    last_publication_date: '04-01-2021'
                }
              ]
          })
       }

       getPrismicClientMocked.mockImplementationOnce( (config) => { // Error here
          return clientMocked as any
       })
    
        ...
    }

- How I solved it:
  - I forgot to add at the top of the file this line  
  `typescript jest.mock('../services/prismic')`
  - To tell the code that my functions at prismic would be called as mocks.

---

That is it for today.