diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fc1c17f..a3107ea 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,24 +7,24 @@ on: tags: [ 'v[0-9]+.[0-9]+.[0-9]+' ] jobs: -# temporarily disabled -# test: -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v2 -# - uses: actions/setup-node@v1 -# with: -# node-version: 14.7.0 -# - run: yarn -# - run: yarn test -# - name: Telegram Failure Notification -# uses: appleboy/telegram-action@0.0.7 -# if: failure() -# with: -# message: ❗ Build failed for [${{ github.repository }}](https://github.com/${{ github.repository }}/actions) because of ${{ github.actor }} -# format: markdown -# to: ${{ secrets.TELEGRAM_CHAT_ID }} -# token: ${{ secrets.TELEGRAM_BOT_TOKEN }} + # temporarily disabled + # test: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v2 + # - uses: actions/setup-node@v1 + # with: + # node-version: 14.7.0 + # - run: yarn + # - run: yarn test + # - name: Telegram Failure Notification + # uses: appleboy/telegram-action@0.0.7 + # if: failure() + # with: + # message: ❗ Build failed for [${{ github.repository }}](https://github.com/${{ github.repository }}/actions) because of ${{ github.actor }} + # format: markdown + # to: ${{ secrets.TELEGRAM_CHAT_ID }} + # token: ${{ secrets.TELEGRAM_BOT_TOKEN }} lint: runs-on: ubuntu-latest diff --git a/package.json b/package.json index 4009b6f..95d61f0 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,10 @@ "description": "", "main": "index.js", "scripts": { - "lint": "eslint .", + "eslint": "eslint --ext .js --ignore-path .gitignore .", + "prettier:check": "npx prettier --check . --config .prettierrc", + "prettier:fix": "npx prettier --write . --config .prettierrc", + "lint": "yarn eslint && yarn prettier:check", "test": "mocha --timeout 300000" }, "keywords": [], diff --git a/src/utils.js b/src/utils.js index 88abbbf..e8fdeb7 100644 --- a/src/utils.js +++ b/src/utils.js @@ -1,7 +1,7 @@ /** * A promise that resolves after `ms` milliseconds */ -const sleep = (ms) => new Promise((res) => setTimeout(res, ms)) +const sleep = ms => new Promise(res => setTimeout(res, ms)) /** * A promise that resolves when the source emits specified event diff --git a/test/TxManager.test.js b/test/TxManager.test.js index 202a99d..0f84348 100644 --- a/test/TxManager.test.js +++ b/test/TxManager.test.js @@ -32,9 +32,9 @@ describe('TxManager', () => { const receipt = await tx .send() - .on('transactionHash', (hash) => console.log('hash', hash)) - .on('mined', (receipt) => console.log('Mined in block', receipt.blockNumber)) - .on('confirmations', (confirmations) => console.log('confirmations', confirmations)) + .on('transactionHash', hash => console.log('hash', hash)) + .on('mined', receipt => console.log('Mined in block', receipt.blockNumber)) + .on('confirmations', confirmations => console.log('confirmations', confirmations)) console.log('receipt', receipt) }) @@ -46,9 +46,9 @@ describe('TxManager', () => { const receipt = await tx .send() - .on('transactionHash', (hash) => console.log('hash', hash)) - .on('mined', (receipt) => console.log('Mined in block', receipt.blockNumber)) - .on('confirmations', (confirmations) => console.log('confirmations', confirmations)) + .on('transactionHash', hash => console.log('hash', hash)) + .on('mined', receipt => console.log('Mined in block', receipt.blockNumber)) + .on('confirmations', confirmations => console.log('confirmations', confirmations)) console.log('receipt', receipt) }) @@ -60,9 +60,9 @@ describe('TxManager', () => { const receipt = await tx .send() - .on('transactionHash', (hash) => console.log('hash', hash)) - .on('mined', (receipt) => console.log('Mined in block', receipt.blockNumber)) - .on('confirmations', (confirmations) => console.log('confirmations', confirmations)) + .on('transactionHash', hash => console.log('hash', hash)) + .on('mined', receipt => console.log('Mined in block', receipt.blockNumber)) + .on('confirmations', confirmations => console.log('confirmations', confirmations)) console.log('receipt', receipt) })