comment faire un test unitaire d'un emit dans une boucle for ? "function…
Jump to turn (6)
- 1comment faire un test unitaire d'un emit dans une boucle for ? "function checkLe
- 2avec expectEvent
- 3pourquoi ei je cette erreur " No 'LetterWin' events found + expected - actual -f
- 4est ce que " games[gameId].player1" peut être défini de cette manière dans" expe
- 5" describe ("Vérifie la fonction checkLetterWin", () => { it("doit émettre l’évé
- 6pourquoi cette erreur false true " No 'LetterWin' events found + expected - actu
- User
comment faire un test unitaire d'un emit dans une boucle for ? "function checkLetterWin(string memory _letterFiltered) internal { bytes1 filteredLetterByte = bytes(_letterFiltered)[0]; bytes memory gameWordBytes = bytes(currentWord); for (uint64 i = 0; i < gameWordBytes.length; i++) { if (gameWordBytes[i] == filteredLetterByte) { emit LetterWin(gameId, games[gameId].player1, games[gameId].player2, _letterFiltered); break; } } }" avec cette configuration ? " context ("FONCTION POUR COMPARER LA LETTRE AU MOT", () => {
codebefore(async function() { penduelInstance = await Penduel.new(subId); await penduelInstance.createGame( {from: player1}); await penduelInstance.joinGame({ from: player2 }); const value = web3.utils.toWei("1", "ether"); await penduelInstance.deposit({ from: player1, value: value }); await penduelInstance.deposit({ from: player2, value: value }); currentWord = "IMMUABLE"; }); describe ("Vérifie la fonction checkLetterWin", () => {"