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

Some transaction tests were not run… #1229

Merged
merged 1 commit into from
May 13, 2015

Conversation

dskloet
Copy link
Contributor

@dskloet dskloet commented May 13, 2015

Some transaction tests were not run because of the way they were built. The builder was invoked, but the built test wasn't. Fixed this so they are run and fixed one test that still assumed the dust limit at 5460 instead of 546.

…t. Fixed this so they are run and fixed one test that still assumed the dust limit at 5460 instead of 546.
@coveralls
Copy link

Coverage Status

Coverage remained the same at 97.79% when pulling e294505 on dskloet:test/fix-transaction into bb843ee on bitpay:master.

@dskloet
Copy link
Contributor Author

dskloet commented May 13, 2015

The reason the test coverage didn't increase is because there are some ifs that used to only take the true branch and now they also take the false branch, but that doesn't increase the number of lines/statements covered because they don't have an else block. Pull request #1226 restructured these ifs which uncovered the missing coverage.

@braydonf
Copy link
Contributor

Good catch. We may want to run these instead by doing:

it('can skip the check for too much fee', function() {
  buildSkipTest(function(transaction) {
    //...
  }, 'disableLargeFees')();
});

@dskloet
Copy link
Contributor Author

dskloet commented May 13, 2015

Why? buildSkipTest already returns a function. The extra wrapper doesn't add anything except another stack frame, and (apparently) an easy way to hide when a test is not run. Or am I missing something?

@braydonf
Copy link
Contributor

Right, build returns a function (and without a first argument).

@dskloet
Copy link
Contributor Author

dskloet commented May 13, 2015

Which first argument?

Another option is to rename buildSkipTest to doSkipTest and make it actually perform the test instead of return a function. Then I just invoke that from the actual test. What do you think?

@braydonf
Copy link
Contributor

I think it's good the way you have it now.

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