Skip to content

Commit

Permalink
chore: add test to pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielSchiavini committed Oct 16, 2024
1 parent 8ac5e04 commit d6e5fd9
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 5 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/lint.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Lint
name: Test
on:
push:

Expand All @@ -10,6 +10,10 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: '20'
# todo: we should commit the lock file and use npm ci
- run: npm install
- run: npm run build
- run: npm run build:tests
- run: npm run test
- run: npm run lint
if: always()
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ pnpm-lock.yaml
yarn.lock
test/temp.test.ts
test/rpcUrls.test.ts
cache/
13 changes: 13 additions & 0 deletions hardhat.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = {
networks: {
hardhat: {
chainId: 1,
hardfork: "shanghai",
// base fee of 0 allows use of 0 gas price when testing
initialBaseFeePerGas: 0,
// brownie expects calls and transactions to throw on revert
throwOnTransactionFailures: true,
throwOnCallFailures: true,
},
},
};
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@
"url": "https://github.com/curvefi/curve-lending-js/issues"
},
"scripts": {
"build": "rm -rf lib && tsc -p tsconfig.build.json",
"lint": "eslint src --ext .ts"
"build": "rm -rf lib && tsc --project tsconfig.build.json",
"build:tests": "rm -rf dist && tsc",
"lint": "eslint src --ext .ts",
"test": "mocha dist/test",
"watch": "npm run build -- --watch",
"watch:tests": "npm run build:tests -- --watch"
},
"type": "module",
"devDependencies": {
Expand All @@ -28,6 +32,7 @@
"babel-eslint": "^10.1.0",
"chai": "^4.3.4",
"eslint": "^7.32.0",
"hardhat": "^2.22.13",
"mocha": "^8.4.0",
"typescript": "^4.5.2",
"vue-eslint-parser": "^7.6.0"
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

/* Basic Options */
// "incremental": true, /* Enable incremental compilation */
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
"target": "ESNext", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
"module": "ESNext", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
"lib": ["ES2020"], /* Specify library files to be included in the compilation. */
"lib": ["ESNext"], /* Specify library files to be included in the compilation. */
// "allowJs": true, /* Allow javascript files to be compiled. */
// "checkJs": true, /* Report errors in .js files. */
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', 'react', 'react-jsx' or 'react-jsxdev'. */
Expand Down

0 comments on commit d6e5fd9

Please sign in to comment.