Skip to content

Instantly share code, notes, and snippets.

@mseemann
Created January 6, 2022 15:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mseemann/75ebdac132dec6286c906787b088c655 to your computer and use it in GitHub Desktop.
Save mseemann/75ebdac132dec6286c906787b088c655 to your computer and use it in GitHub Desktop.
const SampleContract = artifacts.require("SampleContract");
contract("SampleContract", function (accounts) {
it("...should store the value 89.", async function () {
const simpleStorageInstance = await SampleContract.deployed();
// Set value of 89
await simpleStorageInstance.set(89, {from: accounts[1]});
// Get stored value
const storedData = await simpleStorageInstance.get();
assert.equal(storedData.toString(), "89", "The value 89 was not stored.");
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment