Let's test our proofOfWork method to make sure that it works properly. We'll be testing the method in our test.js file. So, let's get started:
- Open up the test.js file. You might observe the data in a similar way to the following screenshot, which is present in the file from the previous section, Testing the hashBlock method:
- If you don't have any data in the test.js file, add this to your test.js file, as shown in the preceding screenshot, and then you can begin testing the data.
- To test our proofOfWork method, we need the previousBlockHash and currentBlockData. So, in our test case, get rid of the nonce ...