question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error in mock-functions doc page of pt-br translate.

See original GitHub issue

🐛 Bug Report

In line 7 of the second code example in page “https://facebook.github.io/jest/docs/pt-BR/mock-functions.html#propriedade-mock” should be “O segundo argumento da primeira chamada foi ‘second arg’”, because the code goes down from the explanation refers to the first mock call.

Found

// O segundo argumento da segunda chamada foi 'second arg'
expect(someMockFunction.mock.calls[0][1]).toBe('second arg');

Expected

// O segundo argumento da primeira chamada foi 'second arg'
expect(someMockFunction.mock.calls[0][1]).toBe('second arg');

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
brunohenriquepjcommented, May 6, 2018

I fixed error in translation, thank you!

1reaction
SimenBcommented, May 7, 2018
Read more comments on GitHub >

github_iconTop Results From Across the Web

Mock Functions - Jest
If no implementation is given, the mock function will return undefined when invoked. info. The TypeScript examples from this page will only work ......
Read more >
Google Tradutor
O serviço do Google, oferecido sem custo financeiro, traduz instantaneamente palavras, frases e páginas da Web do português para mais de cem outros...
Read more >
javascript - 'translate is not a function'-error in react admin with ...
I'm trying to write a test with React Testing Library and Jest. However, I'm getting a TypeError: translate is not a function error....
Read more >
Mocking ES and CommonJS modules with jest.mock() - Medium
If the test subject is a standard function then an error of mockFunction is not defined will be returned. This is due to...
Read more >
Mock Functions · Jest
Mock functions are also known as "spies", because they let you spy on the behavior of a function that is called indirectly by...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found