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

Remove extraneous console output from TransactionStateManager tests #7838

Merged
merged 1 commit into from
Jan 16, 2020

Conversation

whymarrh
Copy link
Contributor

This PR removes the single use of console.log from the TransactionStateManager tests to reduce noise in the output.

Before:

$ yarn test:unit
yarn run v1.19.2
$ cross-env METAMASK_ENV=test mocha --exit --require test/setup.js --recursive "test/unit/**/*.js" "ui/app/**/*.test.js"


  TransactionStateManager
    #setTxStatusSigned
      ✓ sets the tx status to signed
      ✓ should emit a signed event to signal the exciton of callback
    #setTxStatusRejected
      ✓ sets the tx status to rejected and removes it from history
Error:  1
      ✓ should emit a rejected event to signal the exciton of callback
    #getFullTxList
      ✓ when new should return empty array
    #getTxList
      ✓ when new should return empty array
    #addTx
      ✓ adds a tx returned in getTxList
      ✓ throws error and does not add tx if txParams are invalid
      ✓ does not override txs from other networks
      ✓ cuts off early txs beyond a limit
      ✓ cuts off early txs beyond a limit whether or not it is confirmed or rejected
      ✓ cuts off early txs beyond a limit but does not cut unapproved txs
    #updateTx
      ✓ replaces the tx with the same id
      ✓ throws error and does not update tx if txParams are invalid
      ✓ updates gas price and adds history items
    #getUnapprovedTxList
      ✓ returns unapproved txs in a hash
    #getTx
      ✓ returns a tx with the requested id
    #getFilteredTxList
      ✓ returns a tx with the requested data
    #wipeTransactions
      ✓ should remove only the transactions from a specific address
      ✓ should not remove the transactions from other networks
    #_removeTx
      ✓ should remove the transaction from the storage
      ✓ should only remove the transaction with ID 1 from the storage


  22 passing (306ms)

✨  Done in 16.27s.

After:

$ yarn test:unit
yarn run v1.19.2
$ cross-env METAMASK_ENV=test mocha --exit --require test/setup.js --recursive "test/unit/**/*.js" "ui/app/**/*.test.js"


  TransactionStateManager
    #setTxStatusSigned
      ✓ sets the tx status to signed
      ✓ should emit a signed event to signal the exciton of callback
    #setTxStatusRejected
      ✓ sets the tx status to rejected and removes it from history
      ✓ should emit a rejected event to signal the exciton of callback
    #getFullTxList
      ✓ when new should return empty array
    #getTxList
      ✓ when new should return empty array
    #addTx
      ✓ adds a tx returned in getTxList
      ✓ throws error and does not add tx if txParams are invalid
      ✓ does not override txs from other networks
      ✓ cuts off early txs beyond a limit
      ✓ cuts off early txs beyond a limit whether or not it is confirmed or rejected
      ✓ cuts off early txs beyond a limit but does not cut unapproved txs
    #updateTx
      ✓ replaces the tx with the same id
      ✓ throws error and does not update tx if txParams are invalid
      ✓ updates gas price and adds history items
    #getUnapprovedTxList
      ✓ returns unapproved txs in a hash
    #getTx
      ✓ returns a tx with the requested id
    #getFilteredTxList
      ✓ returns a tx with the requested data
    #wipeTransactions
      ✓ should remove only the transactions from a specific address
      ✓ should not remove the transactions from other networks
    #_removeTx
      ✓ should remove the transaction from the storage
      ✓ should only remove the transaction with ID 1 from the storage


  22 passing (326ms)

✨  Done in 17.53s.

Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM!

The build failure is unrelated; just needs to be re-run I'm guessing.

@tmashuang tmashuang merged commit 4257858 into MetaMask:develop Jan 16, 2020
@whymarrh whymarrh deleted the fix-tx-state-tests branch January 16, 2020 17:48
yqrashawn pushed a commit to yqrashawn/conflux-portal that referenced this pull request Jan 19, 2020
yqrashawn pushed a commit to Conflux-Chain/conflux-portal that referenced this pull request Jan 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants