Skip to content

Commit

Permalink
add types and also mocha config, fix errors:
Browse files Browse the repository at this point in the history
  • Loading branch information
0xCardinalError committed Apr 5, 2024
1 parent 58e1053 commit 4cd535e
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
run: yarn compile

- name: Test
run: yarn test
run: yarn hardhat test

- name: Coverage
run: yarn coverage
16 changes: 16 additions & 0 deletions .mocharc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
'use strict';
process.env.TS_NODE_FILES = true;
module.exports = {
'allow-uncaught': true,
diff: true,
extension: ['ts'],
recursive: true,
reporter: 'spec',
require: ['ts-node/register', 'hardhat/register'],
slow: 300,
spec: 'test/**/*.test.ts',
timeout: 20000,
ui: 'bdd',
watch: false,
'watch-files': ['src/**/*.sol', 'test/**/*.ts'],
};
18 changes: 7 additions & 11 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ const accounts: string[] | { mnemonic: string } =
const config: HardhatUserConfig = {
namedAccounts: {
deployer: 0,
admin: 1,
named_1: 2,
named_2: 3,
named_3: 4,
alice: 1,
bob: 2,
carol: 3,
other: 4,
},
defaultNetwork: 'hardhat',
solidity: {
Expand All @@ -53,6 +53,9 @@ const config: HardhatUserConfig = {
},
],
},
mocha: {
timeout: Number.MAX_SAFE_INTEGER,
},
networks: {
hardhat: {
chainId: 12345,
Expand Down Expand Up @@ -144,13 +147,6 @@ const config: HardhatUserConfig = {
},
],
},
namedAccounts: {
deployer: 0,
alice: 1,
bob: 2,
carol: 3,
other: 4,
},
paths: {
sources: 'contracts',
},
Expand Down
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
"name": "sw3",
"version": "0.2.0",
"description": "Contracts for Swap, Swear and Swindle.",
"directories": {
"test": "test"
},
"repository": {
"type": "git",
"url": "https://github.com/ethersphere/swap-swear-and-swindle.git"
Expand Down
6 changes: 4 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
"moduleResolution": "node",
"forceConsistentCasingInFileNames": true,
"outDir": "dist",
"resolveJsonModule": true
"resolveJsonModule": true,
"typeRoots": ["./types"],
"types": ["openzeppelin-test-helpers"]
},
"include": ["hardhat.config.ts", "./scripts", "./deploy", "./test", "./utils", "./tasks"],
"include": ["hardhat.config.ts", "./scripts", "./deploy", "./test", "./utils", "./tasks", "./types"],
"exclude": ["node_modules", "**/*.spec.ts"]
}
2 changes: 2 additions & 0 deletions types/openzeppelin-test-helpers.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// openzeppelin-test-helpers.d.ts
declare module '@openzeppelin/test-helpers';

0 comments on commit 4cd535e

Please # to comment.