Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mocha Config: Enable Mocha Test Explorer #101

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .mocharc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
'allow-uncaught': true,
diff: true,
extension: ['ts', 'js'],
recursive: true,
reporter: 'spec',
require: ['ts-node/register', 'hardhat/register'], // ['ts-node/register/transpile-only'], (for yarn link <plugin>)
slow: 300,
spec: ['test/**/*.test.ts', 'test/**/*.test.js','test/**/*.tests.ts'],
timeout: 0,
ui: 'bdd',
watch: false,
'watch-files': ['src/**/*.sol', 'test/**/*.ts', 'test/**/*.js'],
};
2 changes: 1 addition & 1 deletion test/ExecutorManager.tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe("ExecutorManagerTests", function () {
[owner, pauser, charlie, bob, tf, executor] = await ethers.getSigners();

const executorManagerFactory = await ethers.getContractFactory("ExecutorManager");
executorManager = await executorManagerFactory.deploy();
executorManager = await executorManagerFactory.deploy() as ExecutorManager;
await executorManager.deployed();
});

Expand Down
2 changes: 1 addition & 1 deletion test/LPToken.tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ describe("LPTokenTests", function () {
await tokenManager.addSupportedToken(NATIVE, BigNumber.from(1), BigNumber.from(10).pow(30), 0, 0, 0);

const executorManagerFactory = await ethers.getContractFactory("ExecutorManager");
executorManager = await executorManagerFactory.deploy();
executorManager = await executorManagerFactory.deploy() as ExecutorManager;

const lpTokenFactory = await ethers.getContractFactory("LPToken");
lpToken = (await upgrades.deployProxy(lpTokenFactory, [
Expand Down
4 changes: 2 additions & 2 deletions test/LiquidityPool.DepositAndCall.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ describe("LiquidityPoolTests - Deposit And Call", function () {
await tokenManager.deployed();

const executorManagerFactory = await ethers.getContractFactory("ExecutorManager");
executorManager = await executorManagerFactory.deploy();
executorManager = await executorManagerFactory.deploy() as ExecutorManager;
await executorManager.deployed();

const mockAdaptorFactory = await ethers.getContractFactory("MockAdaptor");
mockAdaptor = await mockAdaptorFactory.deploy("0xE592427A0AEce92De3Edee1F18E0157C05861564", NATIVE_WRAP_ADDRESS);
mockAdaptor = await mockAdaptorFactory.deploy("0xE592427A0AEce92De3Edee1F18E0157C05861564", NATIVE_WRAP_ADDRESS) as MockAdaptor;
await mockAdaptor.deployed();

const lpTokenFactory = await ethers.getContractFactory("LPToken");
Expand Down
4 changes: 2 additions & 2 deletions test/LiquidityPool.tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,11 @@ describe("LiquidityPoolTests", function () {
await tokenManager.deployed();

const executorManagerFactory = await ethers.getContractFactory("ExecutorManager");
executorManager = await executorManagerFactory.deploy();
executorManager = await executorManagerFactory.deploy() as ExecutorManager;
await executorManager.deployed();

const mockAdaptorFactory = await ethers.getContractFactory("MockAdaptor");
mockAdaptor = await mockAdaptorFactory.deploy("0xE592427A0AEce92De3Edee1F18E0157C05861564", NATIVE_WRAP_ADDRESS);
mockAdaptor = await mockAdaptorFactory.deploy("0xE592427A0AEce92De3Edee1F18E0157C05861564", NATIVE_WRAP_ADDRESS) as MockAdaptor;
await mockAdaptor.deployed();

const lpTokenFactory = await ethers.getContractFactory("LPToken");
Expand Down
2 changes: 1 addition & 1 deletion test/LiquidityProviders.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ describe("LiquidityProviderTests", function () {
await tokenManager.connect(owner).setDepositConfig([1], [token.address], [tokenDepositConfig]);

const executorManagerFactory = await ethers.getContractFactory("ExecutorManager");
executorManager = await executorManagerFactory.deploy();
executorManager = await executorManagerFactory.deploy() as ExecutorManager;

await executorManager.addExecutor(executor.address);

Expand Down
2 changes: 1 addition & 1 deletion test/Pauser.tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ describe("PauserTests", function () {
await tokenManager.addSupportedToken(NATIVE, BigNumber.from(1), BigNumber.from(10).pow(30), 0, 0, 0);

const executorManagerFactory = await ethers.getContractFactory("ExecutorManager");
executorManager = await executorManagerFactory.deploy();
executorManager = await executorManagerFactory.deploy() as ExecutorManager;

const lpTokenFactory = await ethers.getContractFactory("LPToken");
lpToken = (await upgrades.deployProxy(lpTokenFactory, [
Expand Down
6 changes: 3 additions & 3 deletions test/UniswapAdaptor.tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ describe("AdaptorTests", function () {
[owner, pauser, charlie, bob, tf, executor] = await ethers.getSigners();

const mockRouterFactory = await ethers.getContractFactory("MockSwapRouter");
mockswapManager = await mockRouterFactory.deploy();
mockswapManager = await mockRouterFactory.deploy() as MockSwapRouter;
await mockswapManager.deployed();

const uniswapAdaptorFactory = await ethers.getContractFactory("UniswapAdaptor");
uniswapManager = await uniswapAdaptorFactory.deploy(mockswapManager.address, NATIVE_WRAP_ADDRESS);
uniswapManager = await uniswapAdaptorFactory.deploy(mockswapManager.address, NATIVE_WRAP_ADDRESS) as UniswapAdaptor;
await uniswapManager.deployed();

const erc20factory = await ethers.getContractFactory("ERC20Token");
Expand Down Expand Up @@ -170,7 +170,7 @@ describe("AdaptorTests", function () {
await mockswapFailManager.deployed();

const uniswapAdaptorFactory = await ethers.getContractFactory("UniswapAdaptor");
uniswapManager = await uniswapAdaptorFactory.deploy(mockswapFailManager.address, NATIVE_WRAP_ADDRESS);
uniswapManager = await uniswapAdaptorFactory.deploy(mockswapFailManager.address, NATIVE_WRAP_ADDRESS) as UniswapAdaptor;
await uniswapManager.deployed();

await token.approve(uniswapManager.address, minTokenCap);
Expand Down
2 changes: 1 addition & 1 deletion test/Upgradibility.tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe("Upgradibility", function () {
])) as TokenManager;

const executorManagerFactory = await ethers.getContractFactory("ExecutorManager");
executorManager = await executorManagerFactory.deploy();
executorManager = await executorManagerFactory.deploy() as ExecutorManager;
await executorManager.deployed();

const lpTokenFactory = await ethers.getContractFactory("LPToken");
Expand Down
2 changes: 1 addition & 1 deletion test/WhitelistPeriodManager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe("WhiteListPeriodManager", function () {
await tokenManager.addSupportedToken(token.address, BigNumber.from(1), BigNumber.from(10).pow(30), 0, 0, 0);

const executorManagerFactory = await ethers.getContractFactory("ExecutorManager");
executorManager = await executorManagerFactory.deploy();
executorManager = await executorManagerFactory.deploy() as ExecutorManager;

const lpTokenFactory = await ethers.getContractFactory("LPToken");
lpToken = (await upgrades.deployProxy(lpTokenFactory, [
Expand Down