Per this comment on solc-js issue #31, you can append this stanza to package.json.
(which I guess tells jest to run in node, which will bring in the things that solc needs).
The truffle-assertion package can easily help with this.
Once the package is installed you can run the following:
// Import the package to your file
const truffleAssert = require('truffle-assertions');
// Deploy the contract
let testContract = await TestContract.new()
// Get the hash of the deployment transaction
let txHash = testContract.transactionHash
It bears noticing that web3.utils.keccak256 and web3.utils.sha3 are synonyms, so no point using both. You should use keccak256, if given a choice, because the function it implements is not actually Sha3 as defined in the NIST standard, but rather a different function (an early implemementation of Keccak256, before it was modified for the SHA3 standard). I've ...