-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Hardhat testing to tutorials FLR-560 (#271)
- Loading branch information
1 parent
e23bdbe
commit 58f1b3d
Showing
2 changed files
with
51 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const { expect } = require("chai"); | ||
|
||
describe("GettingDataFeeds", async function () { | ||
let contract; | ||
beforeEach(async function () { | ||
contract = await ethers.deployContract("GettingDataFeeds"); | ||
}); | ||
it("Should return sensible values", async function () { | ||
const res = await contract.getTokenPriceWei("BTC"); | ||
|
||
expect(res._timestamp).to.greaterThan(1695817332); | ||
expect(res._decimals).to.within(0, 18); | ||
expect(res._price).to.within(0, 1000000 * 10 ** Number(res._decimals)); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters