Download full-stack-ethereum/test/Greeter.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 549 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/full-stack-ethereum/test/Greeter.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@f5071caa249115f3b590492f1c8eb471e02aae4b/full-stack-ethereum/test/Greeter.js
-
curl -L -o Greeter.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/full-stack-ethereum/test/Greeter.js
549 Bytes
| const { expect } = require("chai"); | |
| describe("Greeter", function () { | |
| it("Should return the new greeting once it's changed", async function () { | |
| const Greeter = await ethers.getContractFactory("Greeter"); | |
| const greeter = await Greeter.deploy("Hello, world!"); | |
| expect(await greeter.greet()).to.equal("Hello, world!"); | |
| const setGreetingTx = await greeter.setGreeting("Hola, mundo!"); | |
| // wait until the transaction is mined | |
| await setGreetingTx.wait(); | |
| expect(await greeter.greet()).to.equal("Hola, mundo!"); | |
| }); | |
| }); |