File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -135,6 +135,21 @@ var Finance = function (faker) {
135135 return symbol ;
136136 }
137137
138+ /**
139+ * bitcoinAddress
140+ *
141+ * @method faker.finance.bitcoinAddress
142+ */
143+ self . bitcoinAddress = function ( ) {
144+ var addressLength = faker . random . number ( { min : 27 , max : 34 } ) ;
145+
146+ var address = faker . random . arrayElement ( [ '1' , '3' ] ) ;
147+
148+ for ( var i = 0 ; i < addressLength - 1 ; i ++ )
149+ address += faker . random . alphaNumeric ( ) . toUpperCase ( ) ;
150+
151+ return address ;
152+ }
138153}
139154
140155module [ 'exports' ] = Finance ;
Original file line number Diff line number Diff line change @@ -203,13 +203,11 @@ describe('finance.js', function () {
203203 } ) ;
204204 } )
205205
206- /*
207206 describe ( "bitcoinAddress()" , function ( ) {
208207 it ( "returns a random bitcoin address" , function ( ) {
209208 var bitcoinAddress = faker . finance . bitcoinAddress ( ) ;
210209
211210 assert . ok ( bitcoinAddress . match ( / ^ [ A - Z 0 - 9 . ] { 27 , 34 } $ / ) ) ;
212211 } ) ;
213212 } ) ;
214- */
215213} ) ;
You can’t perform that action at this time.
0 commit comments