Skip to content

Commit

Permalink
change all tests to work with HH and are TS style
Browse files Browse the repository at this point in the history
  • Loading branch information
0xCardinalError committed Apr 1, 2024
1 parent 62baef0 commit 4af8a26
Show file tree
Hide file tree
Showing 6 changed files with 231 additions and 174 deletions.
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,21 @@
"url": "https://github.com/ethersphere/swap-swear-and-swindle.git"
},
"dependencies": {
"@nomiclabs/hardhat-ethers": "^2.2.1",
"@nomicfoundation/hardhat-network-helpers": "^1.0.10",
"@nomicfoundation/hardhat-verify": "^2.0.5",
"@nomiclabs/hardhat-ethers": "^2.2.1",
"@openzeppelin/contracts": "^3.4.1-solc-0.7-2",
"dotenv": "^16.0.3",
"ethers": "^5.7.0",
"hardhat": "^2.11.2",
"hardhat-contract-sizer": "^2.8.0",
"hardhat-deploy": "^0.11.25",
"hardhat-deploy-ethers": "^0.3.0-beta.5",
"hardhat-gas-reporter": "^1.0.9",
"hardhat-contract-sizer": "^2.8.0",
"hardhat-preprocessor": "^0.1.5",
"typescript": "^4.0.5",
"solidity-coverage": "^0.8.2",
"ts-node": "^10.8.1",
"solidity-coverage": "^0.8.2"
"typescript": "^4.0.5"
},
"devDependencies": {
"@ethereum-waffle/chai": "^4.0.10",
Expand Down
14 changes: 6 additions & 8 deletions test/ERC20SimpleSwap.behavior.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { BN, time } from '@openzeppelin/test-helpers';
import { expect } from 'chai';
import { ethers, getNamedAccounts, getUnnamedAccounts } from 'hardhat';
import { BigNumber, Contract, ContractTransaction } from 'ethers';

import { BN } from '@openzeppelin/test-helpers';
import { time } from '@nomicfoundation/hardhat-network-helpers';
import {
shouldReturnDefaultHardDepositTimeout,
shouldReturnPaidOut,
Expand All @@ -29,7 +26,7 @@ import {
shouldDeposit,
} from './ERC20SimpleSwap.should';

// Define the structure of your enabledTests object to make its properties strongly typed
//Define the structure of your enabledTests object to make its properties strongly typed
interface EnabledTests {
defaultHardDepositTimeout: boolean;
cheques: boolean;
Expand Down Expand Up @@ -193,7 +190,7 @@ function shouldBehaveLikeERC20SimpleSwap([issuer, alice, bob, carol]: string[],
toDecrease,
expectedDecreaseTimeout,
new BN(42)
); // 42 (not BN(0)) signifies that we have to define it later
); //42 (not BN(0)) signifies that we have to define it later
});
});
});
Expand Down Expand Up @@ -573,7 +570,7 @@ function shouldBehaveLikeERC20SimpleSwap([issuer, alice, bob, carol]: string[],
const caller = issuer;
const callerPayout = new BN(0);
const beneficiarySignee = beneficiary;
const issuerSignee = beneficiary; // on purpose not the correct signee, as it is not needed
const issuerSignee = beneficiary; //on purpose not the correct signee, as it is not needed
describe(describeTest + 'shouldCashCheque', function () {
shouldCashCheque(
beneficiary,
Expand Down Expand Up @@ -723,6 +720,7 @@ function shouldBehaveLikeERC20SimpleSwap([issuer, alice, bob, carol]: string[],
);
});
});

describe('when we send value along', function () {
const value = new BN(1);
const revertMessage = 'revert';
Expand Down
Loading

0 comments on commit 4af8a26

Please # to comment.