diff options
| author | Ash Prosser <[email protected]> | 2018-09-27 02:12:03 +0100 |
|---|---|---|
| committer | Ash Prosser <[email protected]> | 2018-09-27 02:12:03 +0100 |
| commit | b944bbcf991ba9f9d54dab50fc71f64c125546ab (patch) | |
| tree | a7da6cc3c87eaf60fc0877fb1b135458f7b2ca31 | |
| parent | 5bfe5af4e25adcda65293d31020011446c49c4bf (diff) | |
| download | faker-b944bbcf991ba9f9d54dab50fc71f64c125546ab.tar.xz faker-b944bbcf991ba9f9d54dab50fc71f64c125546ab.zip | |
fix(bitcoinAddress): fix tests for bitcoin addresses
The tests for bitcoin addresses had an invalid regex.
| -rw-r--r-- | test/finance.unit.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/finance.unit.js b/test/finance.unit.js index a6d14feb..a64b879a 100644 --- a/test/finance.unit.js +++ b/test/finance.unit.js @@ -234,7 +234,12 @@ describe('finance.js', function () { it("returns a random bitcoin address", function(){ var bitcoinAddress = faker.finance.bitcoinAddress(); - assert.ok(bitcoinAddress.match(/^[13][a-km-zA-HJ-NP-Z1-9]{25,34}$/)); + /** + * Note: Although the total length of a Bitcoin address can be 25-33 characters, regex quantifiers only check the proceding token + * Therefore we take one from the total length of the address not including the first character ([13]) + */ + + assert.ok(bitcoinAddress.match(/^[13][a-km-zA-HJ-NP-Z1-9]{24,33}$/)); }); }); |
