Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Corantin committed Aug 31, 2023
1 parent 5a37f6e commit 127095f
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 123 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@
"ts-node": "^10.2.1",
"typescript": "^4.4.2"
}
}
}
1 change: 0 additions & 1 deletion packages/hardhat/coverage.json

This file was deleted.

2 changes: 1 addition & 1 deletion packages/hardhat/hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { config as dotenvConfig } from "dotenv";
import "solidity-coverage";
import "hardhat-deploy";
import fs from "fs";
import chalk from "chalk";
Expand All @@ -9,6 +8,7 @@ import "@openzeppelin/hardhat-upgrades";
import "@nomiclabs/hardhat-ethers";
import "hardhat-typechain";
import "typechain";
import "solidity-coverage";
import { task, HardhatUserConfig, types } from "hardhat/config";
import { HttpNetworkUserConfig } from "hardhat/types";
import { resolve } from "path";
Expand Down
43 changes: 9 additions & 34 deletions packages/hardhat/test/QuestFactory.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,32 +44,6 @@ describe("[Contract] QuestFactory", function () {
.mint(owner.address, fromNumber(1000));
});

it("SHOULD transfer ownership WHEN initialOwner is different than deployer", async function () {
// Arrange
const contractFactory = await ethers.getContractFactory(
"QuestFactory",
owner
);
// Act
const contract = (await upgrades.deployProxy(
contractFactory,
[
owner.address,
createDepositToken.address,
depositAmount,
playDepositToken.address,
depositAmount,
stranger.address,
],
{
initializer: "initialize",
}
)) as QuestFactory;
await contract.deployed();
// Assert
expect(await contract.owner()).to.equal(stranger.address);
});

describe("Methods", () => {
beforeEach(async function () {
const contractFactory = await ethers.getContractFactory(
Expand All @@ -78,18 +52,19 @@ describe("[Contract] QuestFactory", function () {
);
questFactoryContract = (await upgrades.deployProxy(
contractFactory,
[
owner.address,
createDepositToken.address,
depositAmount,
playDepositToken.address,
depositAmount,
owner.address,
],
[owner.address],
{
initializer: "initialize",
}
)) as QuestFactory;
questFactoryContract.setCreateDeposit(
createDepositToken.address,
depositAmount
);
questFactoryContract.setPlayDeposit(
playDepositToken.address,
depositAmount
);
await questFactoryContract.deployed();
});

Expand Down
Loading

0 comments on commit 127095f

Please sign in to comment.